8000 GPU Vulkan: set correct destination usage mode for storage buffer read/write bindings by dbolin · Pull Request #13009 · libsdl-org/SDL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

GPU Vulkan: set correct destination usage mode for storage buffer read/write bindings #13009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2025

Conversation

dbolin
Copy link
Contributor
@dbolin dbolin commented May 11, 2025

Description

Currently, read/write buffers used in compute pipelines can produce various sync validation errors, such as the following:

vkQueueSubmit(): WRITE_AFTER_WRITE hazard detected. vkCmdDispatchIndirect (from VkCommandBuffer 0x1984545e2d0 submitted on the current VkQueue 0x1983c426b50) writes to VkBuffer 0x61a000000061a, which was previously written by another vkCmdDispatchIndirect command (from VkCommandBuffer 0x1988a31c320 submitted on VkQueue 0x1983c426b50).
The current synchronization allows VK_ACCESS_2_SHADER_READ_BIT accesses at VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT|VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT|VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, but to prevent this hazard, it must allow VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT accesses at VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT.

This resolves the issue by setting the destination usage mode to VULKAN_BUFFER_USAGE_MODE_COMPUTE_STORAGE_READ_WRITE instead of VULKAN_BUFFER_USAGE_MODE_COMPUTE_STORAGE_READ.

@slouken slouken requested a review from thatcosmonaut May 11, 2025 22:21
Copy link
Collaborator
@thatcosmonaut thatcosmonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filing this one in the "how did this ever work" category... Thanks!

@thatcosmonaut thatcosmonaut merged commit 2ae3418 into libsdl-org:main May 11, 2025
40 checks passed
thatcosmonaut pushed a commit that referenced this pull request May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0