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;
4
4
extern crate wgpu;
5
5
6
6
use std:: borrow:: Cow ;
7
+ use std:: collections:: HashMap ;
7
8
use wgpu:: SurfaceError ;
8
9
9
10
use sdl2:: event:: { Event , WindowEvent } ;
@@ -79,12 +80,18 @@ fn main() -> Result<(), String> {
79
80
push_constant_ranges : & [ ] ,
80
81
} ) ;
81
82
83
+ let compilation_options = wgpu:: PipelineCompilationOptions {
84
+ constants : & HashMap :: new ( ) ,
85
+ zero_initialize_workgroup_memory : true ,
86
+ } ;
87
+
82
88
let render_pipeline = device. create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
83
89
layout : Some ( & pipeline_layout) ,
84
90
vertex : wgpu:: VertexState {
85
91
buffers : & [ ] ,
86
92
module : & shader,
87
93
entry_point : "vs_main" ,
94
+ compilation_options : compilation_options. clone ( ) ,
88
95
} ,
89
96
fragment : Some ( wgpu:: FragmentState {
90
97
targets : & [ Some ( wgpu:: ColorTargetState {
@@ -94,6 +101,7 @@ fn main() -> Result<(), String> {
94
101
} ) ] ,
95
102
module : & shader,
96
103
entry_point : "fs_main" ,
104
+ compilation_options : compilation_options. clone ( ) ,
97
105
} ) ,
98
106
primitive : wgpu:: PrimitiveState {
99
107
topology : wgpu:: PrimitiveTopology :: TriangleList ,
You can’t perform that action at this time.
0 commit comments