pub struct PushConstantItem {
pub access_path: String,
pub ty: Handle<Type>,
pub offset: u32,
}
Expand description
All information to bind a single uniform value to the shader.
Push constants are emulated using traditional uniforms in OpenGL.
These are composed of a set of primatives (scalar, vector, matrix) that are given names. Because they are not backed by the concept of a buffer, we must do the work of calculating the offset of each primative in the push constant block.
Fields§
§access_path: String
GL uniform name for the item. This name is the same as if you were to access it directly from a GLSL shader.
The with the following example, the following names will be generated, one name per GLSL uniform.
struct InnerStruct {
value: f32,
}
struct PushConstant {
InnerStruct inner;
vec4 array[2];
}
uniform PushConstants _push_constant_binding_cs;
- _push_constant_binding_cs.inner.value
- _push_constant_binding_cs.array[0]
- _push_constant_binding_cs.array[1]
ty: Handle<Type>
Type of the uniform. This will only ever be a scalar, vector, or matrix.
offset: u32
The offset in the push constant memory block this uniform maps to.
The size of the uniform can be derived from the type.
Trait Implementations§
source§impl Clone for PushConstantItem
impl Clone for PushConstantItem
source§fn clone(&self) -> PushConstantItem
fn clone(&self) -> PushConstantItem
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more