File tree Expand file tree Collapse file tree
tests/tests/wgpu-gpu/shader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,10 +73,7 @@ async fn array_size_overrides(
7373 label : None ,
7474 source : wgpu:: ShaderSource :: Wgsl ( std:: borrow:: Cow :: Borrowed ( SHADER ) ) ,
7575 } ) ;
76- let pipeline_options = wgpu:: PipelineCompilationOptions {
77- constants : & [ ( "n" , f64:: from ( n. unwrap_or ( 0 ) ) ) ] ,
78- ..Default :: default ( )
79- } ;
76+ let pipeline_constants = n. map ( f64:: from) . map ( |n| [ ( "n" , n) ] ) ;
8077 let compute_pipeline = fail_if (
8178 & ctx. device ,
8279 should_fail,
@@ -87,11 +84,13 @@ async fn array_size_overrides(
8784 layout : None ,
8885 module : & module,
8986 entry_point : Some ( "main" ) ,
90- compilation_options : if n. is_some ( ) {
91- pipeline_options
92- } else {
93- wgpu:: PipelineCompilationOptions :: default ( )
94- } ,
87+ compilation_options : pipeline_constants
88+ . as_ref ( )
89+ . map ( |constants| wgpu:: PipelineCompilationOptions {
90+ constants,
91+ ..Default :: default ( )
92+ } )
93+ . unwrap_or_default ( ) ,
9594 cache : None ,
9695 } )
9796 } ,
You can’t perform that action at this time.
0 commit comments