fix(core): Validate occlusion query set type in begin_render_pass (#9086)

This commit is contained in:
Andy Leiserson authored and GitHub committed 2026-02-23 14:38:46 -08:00
1 parent ee46a45195
commit 3676e0e247
4 files changed
+10 -1

No files matched your search

+1
View File
@@ -145,6 +145,7 @@ By @cwfitzgerald in [#8999](https://github.com/gfx-rs/wgpu/pull/8999).
- Fix incorrect acceptance of some swizzle selectors that are not valid for their operand, e.g. `const v = vec2<i32>(); let r = v.xyz`. By @andyleiserson in [#8949](https://github.com/gfx-rs/wgpu/pull/8949).
- Fixed calculation of the total number of bindings in a pipeline layout when validating against device limits. By @andyleiserson in [#8997](https://github.com/gfx-rs/wgpu/pull/8997).
- Reject non-constructible types (runtime- and override-sized arrays, and structs containing non-constructible types) in more places where they should not be allowed. By @andyleiserson in [#8873](https://github.com/gfx-rs/wgpu/pull/8873).
- The query set type for an occlusion query is now validated when opening the render pass, in addition to within the call to `beginOcclusionQuery`. By @andyleiserson in [#9086](https://github.com/gfx-rs/wgpu/pull/9086).
#### Vulkan
- Fixed a variety of mesh shader SPIR-V writer issues from the original implementation. By @inner-daemons in [#8756](https://github.com/gfx-rs/wgpu/pull/8756)
-1
View File
@@ -56,7 +56,6 @@ webgpu:api,validation,queue,destroyed,* // 71%, writeBuffer/writeTexture return
webgpu:api,validation,queue,writeBuffer:ranges:* // 0%, missing OperationError for invalid ranges
webgpu:api,validation,render_pass,attachment_compatibility:render_pass_or_bundle_and_pipeline,depth_stencil_read_only_write_state:* // fails on dx12
webgpu:api,validation,render_pass,render_pass_descriptor:depth_stencil_attachment,loadOp_storeOp_match_depthReadOnly_stencilReadOnly:* // 33%, missing validation: depth/stencil load/store ops provided for missing texture format aspects
webgpu:api,validation,render_pass,render_pass_descriptor:occlusionQuerySet,query_set_type:* // 50%, occlusionQuerySet type validation
webgpu:api,validation,render_pipeline,depth_stencil_state:depth_bias:* // open PR
webgpu:api,validation,render_pipeline,depth_stencil_state:depth_write,frag_depth:* // 86%, https://github.com/gfx-rs/wgpu/pull/8856
webgpu:api,validation,render_pipeline,depth_stencil_state:depthCompare_optional:* // https://github.com/gfx-rs/wgpu/issues/8830
+1
View File
@@ -236,6 +236,7 @@ webgpu:api,validation,render_pass,render_pass_descriptor:attachments,*
webgpu:api,validation,render_pass,render_pass_descriptor:color_attachments,*
webgpu:api,validation,render_pass,render_pass_descriptor:depth_stencil_attachment,depth_clear_value:*
webgpu:api,validation,render_pass,render_pass_descriptor:depth_stencil_attachment,sample_counts_mismatch:*
webgpu:api,validation,render_pass,render_pass_descriptor:occlusionQuerySet,query_set_type:*
webgpu:api,validation,render_pass,render_pass_descriptor:resolveTarget,*
webgpu:api,validation,render_pass,render_pass_descriptor:timestampWrite,query_index:*
webgpu:api,validation,render_pass,render_pass_descriptor:timestampWrites,query_set_type:*
+8
View File
@@ -1736,6 +1736,14 @@ impl Global {
let query_set = query_sets.get(occlusion_query_set).get()?;
query_set.same_device(device)?;
if !matches!(query_set.desc.ty, wgt::QueryType::Occlusion) {
return Err(QueryUseError::IncompatibleType {
set_type: query_set.desc.ty.into(),
query_type: super::SimplifiedQueryType::Occlusion,
}
.into());
}
Some(query_set)
} else {
None