Skip to content
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

wgpu-core should enforce proper nesting of push_debug_group and pop_debug_group #3911

Open
jimblandy opened this issue Jul 7, 2023 · 1 comment
Labels
area: validation Issues related to validation, diagnostics, and error handling

Comments

@jimblandy
Copy link
Member

jimblandy commented Jul 7, 2023

There is no code in wgpu-core or wgpu-hal to prevent unmatched push and pop calls at the wgpu or WebGPU level turning into unmatched Begin and End calls at the Vulkan API. But on Vulkan, VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 requires:

There must be an outstanding vkCmdBeginDebugUtilsLabelEXT command prior to the vkCmdEndDebugUtilsLabelEXT on the queue that commandBuffer is submitted to

After much discussion, the VulkanValidationLayers people seemed to decide that this was impossible to check in the validation layer, and the check was removed altogether. But the VUID is still in the spec, so Vulkan implementations have the right to assume the stack won't underflow.

wgpu-core should require that the command buffers submitted to a queue produce properly nested push and pop pairs, to ensure that our usage respects the specification.

Issue #3377 shows that even stricter limitations may be necessary to avoid bugs in certain versions of Mesa. But wgpu-core should always respect the Vulkan spec's general rules.

@jimblandy jimblandy changed the title wgpu should enforce proper nesting of push_debug_group and pop_debug_group` wgpu-core should enforce proper nesting of push_debug_group and pop_debug_group Jul 7, 2023
@teoxoy teoxoy added this to the WebGPU Specification V1 milestone Jul 7, 2023
@teoxoy
Copy link
Member

teoxoy commented Jul 7, 2023

It's required by the WebGPU spec for these to be well-balanced, so we can implement the validation in wgpu-core.

@teoxoy teoxoy added the area: validation Issues related to validation, diagnostics, and error handling label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling
Projects
Status: No status
Development

No branches or pull requests

2 participants