mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
Fix QuerySet ownership of ComputePass (#5671)
* add new tests for checking on query set lifetime * Fix ownership management of query sets on compute passes for write_timestamp, timestamp_writes (on desc) and pipeline statistic queries * changelog entry
This commit is contained in:
1 parent
d258d6ce73
commit
9a27ba53ca
6 files changed
+343
-211
No files matched your search
@@ -1,3 +1,6 @@
|
||||
use crate::command::{
|
||||
validate_and_begin_occlusion_query, validate_and_begin_pipeline_statistics_query,
|
||||
};
|
||||
use crate::resource::Resource;
|
||||
use crate::snatch::SnatchGuard;
|
||||
use crate::{
|
||||
@@ -2258,7 +2261,6 @@ impl Global {
|
||||
query_set
|
||||
.validate_and_write_timestamp(
|
||||
raw,
|
||||
query_set_id,
|
||||
query_index,
|
||||
Some(&mut cmd_buf_data.pending_query_resets),
|
||||
)
|
||||
@@ -2278,22 +2280,20 @@ impl Global {
|
||||
.ok_or(RenderCommandError::InvalidQuerySet(query_set_id))
|
||||
.map_pass_err(scope)?;
|
||||
|
||||
query_set
|
||||
.validate_and_begin_occlusion_query(
|
||||
raw,
|
||||
query_set_id,
|
||||
query_index,
|
||||
Some(&mut cmd_buf_data.pending_query_resets),
|
||||
&mut active_query,
|
||||
)
|
||||
.map_pass_err(scope)?;
|
||||
validate_and_begin_occlusion_query(
|
||||
query_set.clone(),
|
||||
raw,
|
||||
query_index,
|
||||
Some(&mut cmd_buf_data.pending_query_resets),
|
||||
&mut active_query,
|
||||
)
|
||||
.map_pass_err(scope)?;
|
||||
}
|
||||
RenderCommand::EndOcclusionQuery => {
|
||||
api_log!("RenderPass::end_occlusion_query");
|
||||
let scope = PassErrorScope::EndOcclusionQuery;
|
||||
|
||||
end_occlusion_query(raw, &*query_set_guard, &mut active_query)
|
||||
.map_pass_err(scope)?;
|
||||
end_occlusion_query(raw, &mut active_query).map_pass_err(scope)?;
|
||||
}
|
||||
RenderCommand::BeginPipelineStatisticsQuery {
|
||||
query_set_id,
|
||||
@@ -2308,21 +2308,20 @@ impl Global {
|
||||
.ok_or(RenderCommandError::InvalidQuerySet(query_set_id))
|
||||
.map_pass_err(scope)?;
|
||||
|
||||
query_set
|
||||
.validate_and_begin_pipeline_statistics_query(
|
||||
raw,
|
||||
query_set_id,
|
||||
query_index,
|
||||
Some(&mut cmd_buf_data.pending_query_resets),
|
||||
&mut active_query,
|
||||
)
|
||||
.map_pass_err(scope)?;
|
||||
validate_and_begin_pipeline_statistics_query(
|
||||
query_set.clone(),
|
||||
raw,
|
||||
query_index,
|
||||
Some(&mut cmd_buf_data.pending_query_resets),
|
||||
&mut active_query,
|
||||
)
|
||||
.map_pass_err(scope)?;
|
||||
}
|
||||
RenderCommand::EndPipelineStatisticsQuery => {
|
||||
api_log!("RenderPass::end_pipeline_statistics_query");
|
||||
let scope = PassErrorScope::EndPipelineStatisticsQuery;
|
||||
|
||||
end_pipeline_statistics_query(raw, &*query_set_guard, &mut active_query)
|
||||
end_pipeline_statistics_query(raw, &mut active_query)
|
||||
.map_pass_err(scope)?;
|
||||
}
|
||||
RenderCommand::ExecuteBundle(bundle_id) => {
|
||||
|
||||
Reference in new issue
Block a user