File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed
Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -313,8 +313,8 @@ impl Global {
313313 arc_desc. timestamp_writes = if let Some ( tw) = desc. timestamp_writes {
314314 let & PassTimestampWrites {
315315 query_set,
316- beginning_of_pass_write_index : _ ,
317- end_of_pass_write_index : _ ,
316+ beginning_of_pass_write_index,
317+ end_of_pass_write_index,
318318 } = tw;
319319
320320 match cmd_buf
@@ -335,6 +335,16 @@ impl Global {
335335 Err ( e) => return make_err ( e. into ( ) , arc_desc) ,
336336 }
337337
338+ for idx in [ beginning_of_pass_write_index, end_of_pass_write_index]
339+ . into_iter ( )
340+ . flatten ( )
341+ {
342+ match query_set. validate_query ( SimplifiedQueryType :: Timestamp , idx, None ) {
343+ Ok ( ( ) ) => ( ) ,
344+ Err ( e) => return make_err ( e. into ( ) , arc_desc) ,
345+ }
346+ }
347+
338348 Some ( ArcPassTimestampWrites {
339349 query_set,
340350 beginning_of_pass_write_index : tw. beginning_of_pass_write_index ,
Original file line number Diff line number Diff line change @@ -654,6 +654,8 @@ pub enum CommandEncoderError {
654654 InvalidResource ( #[ from] InvalidResourceError ) ,
655655 #[ error( transparent) ]
656656 MissingFeatures ( #[ from] MissingFeatures ) ,
657+ #[ error( transparent) ]
658+ TimestampWritesInvalid ( #[ from] QueryUseError ) ,
657659}
658660
659661impl Global {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ pub enum ResolveError {
160160}
161161
162162impl QuerySet {
163- fn validate_query (
163+ pub ( crate ) fn validate_query (
164164 self : & Arc < Self > ,
165165 query_type : SimplifiedQueryType ,
166166 query_index : u32 ,
Original file line number Diff line number Diff line change 11use crate :: binding_model:: BindGroup ;
22use crate :: command:: {
33 validate_and_begin_occlusion_query, validate_and_begin_pipeline_statistics_query,
4+ SimplifiedQueryType ,
45} ;
56use crate :: init_tracker:: BufferInitTrackerAction ;
67use crate :: pipeline:: RenderPipeline ;
@@ -1394,8 +1395,8 @@ impl Global {
13941395 arc_desc. timestamp_writes = if let Some ( tw) = desc. timestamp_writes {
13951396 let & PassTimestampWrites {
13961397 query_set,
1397- beginning_of_pass_write_index : _ ,
1398- end_of_pass_write_index : _ ,
1398+ beginning_of_pass_write_index,
1399+ end_of_pass_write_index,
13991400 } = tw;
14001401
14011402 let query_set = query_sets. get ( query_set) . get ( ) ?;
@@ -1404,6 +1405,13 @@ impl Global {
14041405
14051406 query_set. same_device ( device) ?;
14061407
1408+ for idx in [ beginning_of_pass_write_index, end_of_pass_write_index]
1409+ . into_iter ( )
1410+ . flatten ( )
1411+ {
1412+ query_set. validate_query ( SimplifiedQueryType :: Timestamp , idx, None ) ?;
1413+ }
1414+
14071415 Some ( ArcPassTimestampWrites {
14081416 query_set,
14091417 beginning_of_pass_write_index : tw. beginning_of_pass_write_index ,
You can’t perform that action at this time.
0 commit comments