@@ -2,8 +2,8 @@ use mygraphics_shaders::ShaderConstants;
22use wgpu:: {
33 ColorTargetState , ColorWrites , Device , FragmentState , FrontFace , MultisampleState ,
44 PipelineLayoutDescriptor , PolygonMode , PrimitiveState , PrimitiveTopology , PushConstantRange ,
5- RenderPass , RenderPipeline , RenderPipelineDescriptor , ShaderModuleDescriptorPassthrough ,
6- ShaderRuntimeChecks , ShaderStages , TextureFormat , VertexState ,
5+ RenderPass , RenderPipeline , RenderPipelineDescriptor , ShaderStages , TextureFormat , VertexState ,
6+ include_spirv ,
77} ;
88
99pub struct MyRenderPipeline {
@@ -12,27 +12,7 @@ pub struct MyRenderPipeline {
1212
1313impl MyRenderPipeline {
1414 pub fn new ( device : & Device , out_format : TextureFormat ) -> anyhow:: Result < Self > {
15- // Workaround in wgpu 27.0.1 where the macro expansion of `include_spirv_raw!` doesn't compile
16- // see https://github.com/gfx-rs/wgpu/pull/8250
17- // let module = unsafe {
18- // device.create_shader_module_passthrough(include_spirv_raw!(env!("SHADER_SPV_PATH")))
19- // };
20- let module = unsafe {
21- device. create_shader_module_passthrough ( ShaderModuleDescriptorPassthrough {
22- label : Some ( env ! ( "SHADER_SPV_PATH" ) ) ,
23- entry_point : "" . to_owned ( ) ,
24- num_workgroups : ( 0 , 0 , 0 ) ,
25- runtime_checks : ShaderRuntimeChecks :: unchecked ( ) ,
26- spirv : Some ( wgpu:: util:: make_spirv_raw ( include_bytes ! ( env!(
27- "SHADER_SPV_PATH"
28- ) ) ) ) ,
29- dxil : None ,
30- msl : None ,
31- hlsl : None ,
32- glsl : None ,
33- wgsl : None ,
34- } )
35- } ;
15+ let module = device. create_shader_module ( include_spirv ! ( env!( "SHADER_SPV_PATH" ) ) ) ;
3616
3717 let layout = device. create_pipeline_layout ( & PipelineLayoutDescriptor {
3818 label : Some ( "MyRenderPipeline layout" ) ,
0 commit comments