mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[wgpu-core] validate occlusion and pipeline statistics queries end (#8684)
This commit is contained in:
parent
51490ea45a
commit
d41e43bc60
@ -180,3 +180,4 @@ webgpu:shader,validation,statement,statement_behavior:invalid_statements:body="l
|
||||
webgpu:shader,validation,statement,statement_behavior:invalid_statements:body="switch1"
|
||||
//FAIL: 9 invalid_statements subtests due to https://github.com/gfx-rs/wgpu/issues/7733
|
||||
webgpu:api,validation,render_pipeline,vertex_state:many_attributes_overlapping:*
|
||||
webgpu:api,validation,encoding,queries,begin_end:occlusion_query,*
|
||||
|
||||
@ -150,6 +150,8 @@ pub enum QueryUseError {
|
||||
set_type: SimplifiedQueryType,
|
||||
query_type: SimplifiedQueryType,
|
||||
},
|
||||
#[error("A query of type {query_type:?} was not ended before the encoder was finished")]
|
||||
MissingEnd { query_type: SimplifiedQueryType },
|
||||
}
|
||||
|
||||
impl WebGpuError for QueryUseError {
|
||||
@ -160,7 +162,8 @@ impl WebGpuError for QueryUseError {
|
||||
| Self::UsedTwiceInsideRenderpass { .. }
|
||||
| Self::AlreadyStarted { .. }
|
||||
| Self::AlreadyStopped
|
||||
| Self::IncompatibleType { .. } => ErrorType::Validation,
|
||||
| Self::IncompatibleType { .. }
|
||||
| Self::MissingEnd { .. } => ErrorType::Validation,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2241,6 +2241,18 @@ pub(super) fn encode_render_pass(
|
||||
.map_pass_err(pass_scope),
|
||||
)?;
|
||||
}
|
||||
if state.active_occlusion_query.is_some() {
|
||||
Err(RenderPassErrorInner::QueryUse(QueryUseError::MissingEnd {
|
||||
query_type: super::SimplifiedQueryType::Occlusion,
|
||||
})
|
||||
.map_pass_err(pass_scope))?;
|
||||
}
|
||||
if state.active_pipeline_statistics_query.is_some() {
|
||||
Err(RenderPassErrorInner::QueryUse(QueryUseError::MissingEnd {
|
||||
query_type: super::SimplifiedQueryType::PipelineStatistics,
|
||||
})
|
||||
.map_pass_err(pass_scope))?;
|
||||
}
|
||||
|
||||
state
|
||||
.info
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user