Bind group with multiple buffers broken on WebGL2 backend #3339
Answered
by
Rainb0wCodes
Rainb0wCodes
asked this question in
Q&A
-
When using code that uses two buffers in the same bind group like this: Rust sourcelet projection_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("Perspective Bind Group Layout"),
entries: &[
wgpu::BindGroupLayoutEntry {
binding: 0,
visibility: wgpu::ShaderStages::VERTEX,
ty: wgpu::BindingType::Buffer {
ty: wgpu::BufferBindingType::Uniform,
has_dynamic_offset: false,
min_binding_size: None,
},
count: None,
},
wgpu::BindGroupLayoutEntry {
binding: 1,
visibility: wgpu::ShaderStages::VERTEX,
ty: wgpu::BindingType::Buffer {
ty: wgpu::BufferBindingType::Uniform,
has_dynamic_offset: false,
min_binding_size: None,
},
count: None,
},
],
});
let projection_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
label: Some("Projection Bind Group"),
layout: &projection_bind_group_layout,
entries: &[
wgpu::BindGroupEntry {
binding: 0,
resource: projection_buffer.as_entire_binding(),
},
wgpu::BindGroupEntry {
binding: 1,
resource: transform_buffer.as_entire_binding(),
},
],
});
// ...
render_pass.set_bind_group(0, &self.projection_bind_group, &[]); Shader source:@group(0) @binding(0) var<uniform> perspective: mat4x4<f32>;
@group(0) @binding(1) var<uniform> transform: mat4x4<f32>; The two uniforms end up pointing to the same buffer (with the contents of |
Beta Was this translation helpful? Give feedback.
Answered by
Rainb0wCodes
Dec 30, 2022
Replies: 1 comment
-
Should be fixed by gfx-rs/naga#2189 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Rainb0wCodes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should be fixed by gfx-rs/naga#2189
Edit: fixed in naga 0.11