Skip to content

Commit

Permalink
Check for VK_BUFFER_USAGE_STORAGE_BUFFER_BIT if buffer is accessed …
Browse files Browse the repository at this point in the history
…in compute shaders
  • Loading branch information
corporateshark committed Sep 23, 2024
1 parent f43dd48 commit 737c93e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,8 @@ void lvk::CommandBuffer::cmdDispatchThreadGroups(const Dimensions& threadgroupCo
useComputeTexture(deps.textures[i], VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
}
for (uint32_t i = 0; i != Dependencies::LVK_MAX_SUBMIT_DEPENDENCIES && deps.buffers[i]; i++) {
const lvk::VulkanBuffer* buf = ctx_->buffersPool_.get(deps.buffers[i]);
LVK_ASSERT_MSG(buf->vkUsageFlags_ & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, "Did you forget to specify BufferUsageBits_Storage on your buffer?");
bufferBarrier(
deps.buffers[i], VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
}
Expand Down

0 comments on commit 737c93e

Please sign in to comment.