-
Notifications
You must be signed in to change notification settings - Fork 408
Open
Description
Hi, I have a question about using named interface blocks in Glium.
What I mean by that is GLSL syntax like this:
layout(std140) uniform Light {
vec3 position
} light;
out vec4 color;
void main() {
color = vec4(light.position, 1.0);
}On the Rust side, I created a struct like:
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct Light {
pub position: [f32; 3],
// Not sure if needed
_padding0: i32,
}
implement_uniform_block!(Light, position);And I tried calling draw with uniform! { light: Light {...} } and uniform! { Light: Light {...} }, without success:
- The first one doesn't do anything (values in GLSL are all 0s)
- The second one errors with
UniformBlockLayoutMismatch { name: "Light", err: MissingField { name: "Light" } }
Does Glium support? If so, how do I use this correctly? Thanks!
Metadata
Metadata
Assignees
Labels
No labels