File tree 4 files changed +25
-5
lines changed
4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -313,8 +313,8 @@ impl Global {
313
313
arc_desc. timestamp_writes = if let Some ( tw) = desc. timestamp_writes {
314
314
let & PassTimestampWrites {
315
315
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,
318
318
} = tw;
319
319
320
320
match cmd_buf
@@ -335,6 +335,16 @@ impl Global {
335
335
Err ( e) => return make_err ( e. into ( ) , arc_desc) ,
336
336
}
337
337
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
+
338
348
Some ( ArcPassTimestampWrites {
339
349
query_set,
340
350
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 {
654
654
InvalidResource ( #[ from] InvalidResourceError ) ,
655
655
#[ error( transparent) ]
656
656
MissingFeatures ( #[ from] MissingFeatures ) ,
657
+ #[ error( transparent) ]
658
+ TimestampWritesInvalid ( #[ from] QueryUseError ) ,
657
659
}
658
660
659
661
impl Global {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ pub enum ResolveError {
160
160
}
161
161
162
162
impl QuerySet {
163
- fn validate_query (
163
+ pub ( crate ) fn validate_query (
164
164
self : & Arc < Self > ,
165
165
query_type : SimplifiedQueryType ,
166
166
query_index : u32 ,
Original file line number Diff line number Diff line change 1
1
use crate :: binding_model:: BindGroup ;
2
2
use crate :: command:: {
3
3
validate_and_begin_occlusion_query, validate_and_begin_pipeline_statistics_query,
4
+ SimplifiedQueryType ,
4
5
} ;
5
6
use crate :: init_tracker:: BufferInitTrackerAction ;
6
7
use crate :: pipeline:: RenderPipeline ;
@@ -1394,8 +1395,8 @@ impl Global {
1394
1395
arc_desc. timestamp_writes = if let Some ( tw) = desc. timestamp_writes {
1395
1396
let & PassTimestampWrites {
1396
1397
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,
1399
1400
} = tw;
1400
1401
1401
1402
let query_set = query_sets. get ( query_set) . get ( ) ?;
@@ -1404,6 +1405,13 @@ impl Global {
1404
1405
1405
1406
query_set. same_device ( device) ?;
1406
1407
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
+
1407
1415
Some ( ArcPassTimestampWrites {
1408
1416
query_set,
1409
1417
beginning_of_pass_write_index : tw. beginning_of_pass_write_index ,
You can’t perform that action at this time.
0 commit comments