You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use DeviceLocalBuffer in compute shader (instead of CpuAccessibleBuffer, to speed up memory access), but I need to update it every frame, so I created a few "staging" CpuAccessibleBuffer buffers with {storage_buffer: true, transfer_source: true}, and my DeviceLocalBuffer is {storage_buffer: true, transfer_destination: true}.
Then on each frame I'm building a command buffer, first I'm copying needed segment of a buffer from a CpuAccessibleBuffer to DeviceLocalBuffer with copy_buffer_dimensions, and then using this buffer in descriptor set of my compute pipeline. But I'm getting an error that device buffer is already GPU locked. It seesms that it happens because vulkano thinks that buffer is in "read" access by previous frame but then I'm building a new frame where I'm writing to this buffer with copy_buffer_dimensions command, so it returns me this error. Is it possible to fix this? Somehow detect that when we will start writing to the buffer, read access will expire already, because compute shader will finish until then.
self.copy_buffer_dimensions(...).unwrap()// here I'm writing to the device buffer from host buffer.bind_pipeline_compute(...).push_constants(...).bind_descriptor_sets(...).dispatch(...).unwrap()// here I'm reading from device buffer in compute shader
The text was updated successfully, but these errors were encountered:
I'm trying to use
DeviceLocalBuffer
in compute shader (instead ofCpuAccessibleBuffer
, to speed up memory access), but I need to update it every frame, so I created a few "staging"CpuAccessibleBuffer
buffers with{storage_buffer: true, transfer_source: true}
, and myDeviceLocalBuffer
is{storage_buffer: true, transfer_destination: true}
.Then on each frame I'm building a command buffer, first I'm copying needed segment of a buffer from a
CpuAccessibleBuffer
toDeviceLocalBuffer
withcopy_buffer_dimensions
, and then using this buffer in descriptor set of my compute pipeline. But I'm getting an error that device buffer is already GPU locked. It seesms that it happens because vulkano thinks that buffer is in "read" access by previous frame but then I'm building a new frame where I'm writing to this buffer withcopy_buffer_dimensions
command, so it returns me this error. Is it possible to fix this? Somehow detect that when we will start writing to the buffer, read access will expire already, because compute shader will finish until then.The text was updated successfully, but these errors were encountered: