Module Scanned
modules/world-runtime/src/gpu_mesher.zig
Summary
The finalizeCompletedMeshes function calls vkWaitForFences but discards the return value. If the fence wait fails, the code continues to read potentially stale data from the result buffer.
Location
modules/world-runtime/src/gpu_mesher.zig:168
Severity: High
Incorrect rendering, memory corruption, crashes
Impact
When vkWaitForFences returns VK_TIMEOUT or VK_ERROR_DEVICE_LOST, the code proceeds to read results from the buffer. If GPU has not finished writing, data is stale/garbage.
Evidence
Line 168: _ = c.vkWaitForFences(...); // Return value discarded
Lines 185-244: Results read immediately assuming fence wait succeeded
Proposed Fix
Check return value and handle failures: if (wait_result != c.VK_SUCCESS) { log.warn(...); return; }
Acceptance Criteria
- vkWaitForFences return value is checked
- On failure, function returns early
- Submitted items cleared on failure
- zig build test passes
Module Scanned
modules/world-runtime/src/gpu_mesher.zig
Summary
The finalizeCompletedMeshes function calls vkWaitForFences but discards the return value. If the fence wait fails, the code continues to read potentially stale data from the result buffer.
Location
modules/world-runtime/src/gpu_mesher.zig:168
Severity: High
Incorrect rendering, memory corruption, crashes
Impact
When vkWaitForFences returns VK_TIMEOUT or VK_ERROR_DEVICE_LOST, the code proceeds to read results from the buffer. If GPU has not finished writing, data is stale/garbage.
Evidence
Line 168: _ = c.vkWaitForFences(...); // Return value discarded
Lines 185-244: Results read immediately assuming fence wait succeeded
Proposed Fix
Check return value and handle failures: if (wait_result != c.VK_SUCCESS) { log.warn(...); return; }
Acceptance Criteria