Skip to content

Commit a57f9ad

Browse files
authored
Merge pull request #1412 from caspark/fix-wgpu-example
Make wgpu example compile and run again
2 parents c06bf40 + fd4844b commit a57f9ad

File tree

1 file changed

+8
-0
lines changed
  • examples/raw-window-handle-with-wgpu

1 file changed

+8
-0
lines changed

examples/raw-window-handle-with-wgpu/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extern crate sdl2;
44
extern crate wgpu;
55

66
use std::borrow::Cow;
7+
use std::collections::HashMap;
78
use wgpu::SurfaceError;
89

910
use 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,

0 commit comments

Comments
 (0)