Using Bevy pbr pipeline because I'm not really up to write my own pipelines.
Bevy is using the same shader for both fragment and vertex stages, and sharing some of the data structures between both. There are also two binding groups that are shared:
In the shader in wsgl:
[[group(0), binding(0)]]
var<uniform> view: View;
// other binding that are bound only in the fragment stage
...
[[group(2), binding(0)]]
var<uniform> mesh: Mesh;
In the vertex shader in glsl:
uniform View_block_0Vertex { View _group_0_binding_0; };
uniform Mesh_block_1Vertex { Mesh _group_2_binding_0; };
In the fragment shader in glsl:
uniform View_block_0Fragment { View _group_0_binding_0; };
uniform Mesh_block_5Fragment { Mesh _group_2_binding_0; };
This works under Firefox and Chrome, but gives an error with Safari:
"wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
note: label = `pbr_opaque_mesh_pipeline`
Internal error in VERTEX | FRAGMENT | VERTEX_FRAGMENT shader: Name conflicts between uniform block field names: _group_0_binding_0
"
If I change the glsl back in naga by removing the ID and stage from:
|
let block_name = format!( |
|
"{}_block_{}{:?}", |
|
ty_name, |
|
self.block_id.generate(), |
|
self.entry_point.stage, |
|
); |
It works again with Safari, and also Firefox and Chrome.
I can submit a PR, but I'm not sure if this is the right fix, or other impacts that it may have
Using Bevy pbr pipeline because I'm not really up to write my own pipelines.
Bevy is using the same shader for both fragment and vertex stages, and sharing some of the data structures between both. There are also two binding groups that are shared:
In the shader in wsgl:
In the vertex shader in glsl:
In the fragment shader in glsl:
This works under Firefox and Chrome, but gives an error with Safari:
If I change the glsl back in naga by removing the ID and stage from:
naga/src/back/glsl/mod.rs
Lines 895 to 900 in c2328fe
It works again with Safari, and also Firefox and Chrome.
I can submit a PR, but I'm not sure if this is the right fix, or other impacts that it may have