diff --git a/example/src/shader_bindings.rs b/example/src/shader_bindings.rs index b5b00d1..b2673bf 100644 --- a/example/src/shader_bindings.rs +++ b/example/src/shader_bindings.rs @@ -1065,8 +1065,8 @@ fn fragment_main(input_1: VertexOutput) -> @location(0) vec4 { ) -> () { composer .add_composable_module(naga_oil::compose::ComposableModuleDescriptor { - source: include_str!("..\\shaders\\utils\\types.wgsl"), - file_path: "..\\shaders\\utils\\types.wgsl", + source: include_str!("../shaders/utils/types.wgsl"), + file_path: "../shaders/utils/types.wgsl", language: naga_oil::compose::ShaderLanguage::Wgsl, shader_defs: shader_defs.clone(), as_name: Some("utils::types".into()), @@ -1081,8 +1081,8 @@ fn fragment_main(input_1: VertexOutput) -> @location(0) vec4 { ) -> wgpu::naga::Module { composer .make_naga_module(naga_oil::compose::NagaModuleDescriptor { - source: include_str!("..\\shaders\\testbed.wgsl"), - file_path: "..\\shaders\\testbed.wgsl", + source: include_str!("../shaders/testbed.wgsl"), + file_path: "../shaders/testbed.wgsl", shader_defs, ..Default::default() }) @@ -1116,10 +1116,10 @@ fn fragment_main(input_1: VertexOutput) -> @location(0) vec4 { }) } pub const SHADER_ENTRY_PATH: &str = include_absolute_path::include_absolute_path!( - "..\\shaders\\testbed.wgsl" + "../shaders/testbed.wgsl" ); pub const UTILS_TYPES_PATH: &str = include_absolute_path::include_absolute_path!( - "..\\shaders\\utils\\types.wgsl" + "../shaders/utils/types.wgsl" ); pub const SHADER_PATHS: &[&str] = &[SHADER_ENTRY_PATH, UTILS_TYPES_PATH]; pub fn load_shader_modules_from_path( @@ -1132,7 +1132,7 @@ fn fragment_main(input_1: VertexOutput) -> @location(0) vec4 { composer .add_composable_module(naga_oil::compose::ComposableModuleDescriptor { source: &std::fs::read_to_string(UTILS_TYPES_PATH).unwrap(), - file_path: "..\\shaders\\utils\\types.wgsl", + file_path: "../shaders/utils/types.wgsl", language: naga_oil::compose::ShaderLanguage::Wgsl, shader_defs: shader_defs.clone(), as_name: Some("utils::types".into()), @@ -1147,7 +1147,7 @@ fn fragment_main(input_1: VertexOutput) -> @location(0) vec4 { composer .make_naga_module(naga_oil::compose::NagaModuleDescriptor { source: &std::fs::read_to_string(SHADER_ENTRY_PATH).unwrap(), - file_path: "..\\shaders\\testbed.wgsl", + file_path: "../shaders/testbed.wgsl", shader_defs, ..Default::default() }) @@ -1551,8 +1551,8 @@ fn fs_main(in_1: VertexOutput) -> @location(0) vec4 { ) -> wgpu::naga::Module { composer .make_naga_module(naga_oil::compose::NagaModuleDescriptor { - source: include_str!("..\\shaders\\triangle.wgsl"), - file_path: "..\\shaders\\triangle.wgsl", + source: include_str!("../shaders/triangle.wgsl"), + file_path: "../shaders/triangle.wgsl", shader_defs, ..Default::default() }) @@ -1586,7 +1586,7 @@ fn fs_main(in_1: VertexOutput) -> @location(0) vec4 { }) } pub const SHADER_ENTRY_PATH: &str = include_absolute_path::include_absolute_path!( - "..\\shaders\\triangle.wgsl" + "../shaders/triangle.wgsl" ); pub const SHADER_PATHS: &[&str] = &[SHADER_ENTRY_PATH]; pub fn load_shader_modules_from_path( @@ -1605,7 +1605,7 @@ fn fs_main(in_1: VertexOutput) -> @location(0) vec4 { composer .make_naga_module(naga_oil::compose::NagaModuleDescriptor { source: &std::fs::read_to_string(SHADER_ENTRY_PATH).unwrap(), - file_path: "..\\shaders\\triangle.wgsl", + file_path: "../shaders/triangle.wgsl", shader_defs, ..Default::default() }) diff --git a/wgsl_bindgen/src/generate/shader_module.rs b/wgsl_bindgen/src/generate/shader_module.rs index ca192e2..144f7d9 100644 --- a/wgsl_bindgen/src/generate/shader_module.rs +++ b/wgsl_bindgen/src/generate/shader_module.rs @@ -201,7 +201,7 @@ impl<'a> ComputeModuleBuilder<'a> { label: Some(#label), layout: Some(&layout), module: &module, - entry_point: #entry_point, + entry_point: Some(#entry_point), compilation_options: Default::default(), cache: None, }) @@ -656,7 +656,7 @@ mod tests { label: Some("Compute Pipeline main1"), layout: Some(&layout), module: &module, - entry_point: "main1", + entry_point: Some("main1"), compilation_options: Default::default(), cache: None, }, @@ -672,7 +672,7 @@ mod tests { label: Some("Compute Pipeline main2"), layout: Some(&layout), module: &module, - entry_point: "main2", + entry_point: Some("main2"), compilation_options: Default::default(), cache: None, }, diff --git a/wgsl_bindgen/tests/output/bindgen_main.expected.rs b/wgsl_bindgen/tests/output/bindgen_main.expected.rs index 55ec443..6ba28c9 100644 --- a/wgsl_bindgen/tests/output/bindgen_main.expected.rs +++ b/wgsl_bindgen/tests/output/bindgen_main.expected.rs @@ -319,7 +319,7 @@ pub mod main { label: Some("Compute Pipeline main"), layout: Some(&layout), module: &module, - entry_point: "main", + entry_point: Some("main"), compilation_options: Default::default(), cache: None, }, @@ -341,7 +341,7 @@ pub mod main { label: Some("Compute Pipeline main"), layout: Some(&layout), module: &module, - entry_point: "main", + entry_point: Some("main"), compilation_options: Default::default(), cache: None, }, diff --git a/wgsl_bindgen/tests/output/bindgen_minimal.expected.rs b/wgsl_bindgen/tests/output/bindgen_minimal.expected.rs index 267a62b..4c4c444 100644 --- a/wgsl_bindgen/tests/output/bindgen_minimal.expected.rs +++ b/wgsl_bindgen/tests/output/bindgen_minimal.expected.rs @@ -168,7 +168,7 @@ pub mod minimal { label: Some("Compute Pipeline main"), layout: Some(&layout), module: &module, - entry_point: "main", + entry_point: Some("main"), compilation_options: Default::default(), cache: None, }) diff --git a/wgsl_bindgen/tests/output/bindgen_padding.expected.rs b/wgsl_bindgen/tests/output/bindgen_padding.expected.rs index 6624679..ed0d948 100644 --- a/wgsl_bindgen/tests/output/bindgen_padding.expected.rs +++ b/wgsl_bindgen/tests/output/bindgen_padding.expected.rs @@ -171,7 +171,7 @@ pub mod padding { label: Some("Compute Pipeline main"), layout: Some(&layout), module: &module, - entry_point: "main", + entry_point: Some("main"), compilation_options: Default::default(), cache: None, })