File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
examples/raw-window-handle-with-wgpu Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ extern crate sdl2;
44extern crate wgpu;
55
66use std:: borrow:: Cow ;
7+ use std:: collections:: HashMap ;
78use wgpu:: SurfaceError ;
89
910use sdl2:: event:: { Event , WindowEvent } ;
@@ -79,12 +80,18 @@ fn main() -> Result<(), String> {
7980 push_constant_ranges : & [ ] ,
8081 } ) ;
8182
83+ let compilation_options = wgpu:: PipelineCompilationOptions {
84+ constants : & HashMap :: new ( ) ,
85+ zero_initialize_workgroup_memory : true ,
86+ } ;
87+
8288 let render_pipeline = device. create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
8389 layout : Some ( & pipeline_layout) ,
8490 vertex : wgpu:: VertexState {
8591 buffers : & [ ] ,
8692 module : & shader,
8793 entry_point : "vs_main" ,
94+ compilation_options : compilation_options. clone ( ) ,
8895 } ,
8996 fragment : Some ( wgpu:: FragmentState {
9097 targets : & [ Some ( wgpu:: ColorTargetState {
@@ -94,6 +101,7 @@ fn main() -> Result<(), String> {
94101 } ) ] ,
95102 module : & shader,
96103 entry_point : "fs_main" ,
104+ compilation_options : compilation_options. clone ( ) ,
97105 } ) ,
98106 primitive : wgpu:: PrimitiveState {
99107 topology : wgpu:: PrimitiveTopology :: TriangleList ,
You can’t perform that action at this time.
0 commit comments