diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e2d36c3..dd9bf14cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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(); 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) diff --git a/cts_runner/fail.lst b/cts_runner/fail.lst index a7e3c93f7..7e6f37fdd 100644 --- a/cts_runner/fail.lst +++ b/cts_runner/fail.lst @@ -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 diff --git a/cts_runner/test.lst b/cts_runner/test.lst index aeacf951f..b83b62a93 100644 --- a/cts_runner/test.lst +++ b/cts_runner/test.lst @@ -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:* diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index ce9a3bcfb..70b824399 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -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