Commit a48b67e
committed
framebuffer: Fix timeline semaphore leak and corruption on resize
During sequence reconfiguration (e.g., resolution change), the
NvPerFrameDecodeImageSet::init() function was unconditionally creating
new timeline semaphores without checking if they already existed.
This caused two problems:
1. Memory leak: Old semaphores were never destroyed (the 8 allocations
/ 1456 bytes leak seen in debug builds)
2. Synchronization corruption: In-flight GPU work was still waiting on
the OLD semaphore values, but the NEW semaphores started at
initialValue=0. This caused device lost when using display
presentation, because the swap chain consumer was using the
corrupted timeline synchronization.
Headless mode (--noPresent) was unaffected because timeline semaphores
are not used for presentation synchronization in that path.
Fix: Only create the timeline semaphores if they don't already exist.
On reconfigure, reuse the existing semaphores to preserve in-flight
synchronization state.
Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>1 parent efb5ce7 commit a48b67e
File tree
1 file changed
+16
-12
lines changed- vk_video_decoder/libs/VulkanVideoFrameBuffer
1 file changed
+16
-12
lines changedLines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
957 | 960 | | |
958 | | - | |
959 | | - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
960 | 964 | | |
961 | 965 | | |
962 | 966 | | |
| |||
0 commit comments