Skip to content

Commit

Permalink
Hack around unexplained validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed May 5, 2024
1 parent 1693fbd commit 7cf0cd6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions client/src/graphics/voxels/surface_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,29 @@ impl ScratchBuffer {
&[],
&[],
);
// HACKITY HACK: Queue submit synchronization validation thinks we're
// racing with the preceding chunk draws. Our logic to allocate unique
// ranges should be preventing this, so this may be a false positive.
// However, if that's true, why does the validation error only trigger a
// handful of times at startup? Perhaps we're freeing and reusing
// storage before the previous draw completes, and validation is somehow
// smart enough to notice?
device.cmd_pipeline_barrier(
cmd,
vk::PipelineStageFlags::VERTEX_SHADER,
vk::PipelineStageFlags::COMPUTE_SHADER,
Default::default(),
&[],
&[vk::BufferMemoryBarrier {
buffer: face_buffer,
src_access_mask: vk::AccessFlags::SHADER_READ,
dst_access_mask: vk::AccessFlags::SHADER_WRITE,
offset: 0,
size: vk::WHOLE_SIZE,
..Default::default()
}],
&[],
);

// Prepare shared state
device.cmd_update_buffer(
Expand Down

0 comments on commit 7cf0cd6

Please sign in to comment.