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 primitives (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 primitive 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 moreAuto Trait Implementations§
impl Freeze for PushConstantItem
impl RefUnwindSafe for PushConstantItem
impl Send for PushConstantItem
impl Sync for PushConstantItem
impl Unpin for PushConstantItem
impl UnwindSafe for PushConstantItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)