pub enum BuiltIn {
Show 49 variants
Position {
invariant: bool,
},
ViewIndex,
BaseInstance,
BaseVertex,
ClipDistance,
CullDistance,
InstanceIndex,
PointSize,
VertexIndex,
DrawIndex,
FragDepth,
PointCoord,
FrontFacing,
PrimitiveIndex,
Barycentric {
perspective: bool,
},
SampleIndex,
SampleMask,
GlobalInvocationId,
LocalInvocationId,
LocalInvocationIndex,
WorkGroupId,
WorkGroupSize,
NumWorkGroups,
NumSubgroups,
SubgroupId,
SubgroupSize,
SubgroupInvocationId,
MeshTaskSize,
CullPrimitive,
PointIndex,
LineIndices,
TriangleIndices,
VertexCount,
Vertices,
PrimitiveCount,
Primitives,
RayInvocationId,
NumRayInvocations,
InstanceCustomData,
GeometryIndex,
WorldRayOrigin,
WorldRayDirection,
ObjectRayOrigin,
ObjectRayDirection,
RayTmin,
RayTCurrentMax,
ObjectToWorld,
WorldToObject,
HitKind,
}Expand description
Built-in inputs and outputs.
Variants§
Position
Written in vertex/mesh shaders, read in fragment shaders
ViewIndex
Read in task, mesh, vertex, and fragment shaders
BaseInstance
Read in vertex shaders
BaseVertex
Read in vertex shaders
ClipDistance
Written in vertex & mesh shaders
CullDistance
Written in vertex & mesh shaders
InstanceIndex
Read in vertex, any- and closest-hit shaders
PointSize
Written in vertex & mesh shaders
VertexIndex
Read in vertex shaders
DrawIndex
Read in vertex & task shaders, or mesh shaders in pipelines without task shaders
FragDepth
Written in fragment shaders
PointCoord
Read in fragment shaders
FrontFacing
Read in fragment shaders
PrimitiveIndex
Read in fragment shaders, written in mesh shaders, read in any and closest hit shaders.
Barycentric
Read in fragment shaders
SampleIndex
Read in fragment shaders
SampleMask
Read or written in fragment shaders
GlobalInvocationId
Read in compute, task, and mesh shaders
LocalInvocationId
Read in compute, task, and mesh shaders
LocalInvocationIndex
Read in compute, task, and mesh shaders
WorkGroupId
Read in compute, task, and mesh shaders
WorkGroupSize
Read in compute, task, and mesh shaders
NumWorkGroups
Read in compute, task, and mesh shaders
NumSubgroups
Read in compute, task, and mesh shaders
SubgroupId
Read in compute, task, and mesh shaders
SubgroupSize
Read in compute, fragment, task, and mesh shaders
SubgroupInvocationId
Read in compute, fragment, task, and mesh shaders
MeshTaskSize
Written in task shaders
CullPrimitive
Written in mesh shaders
PointIndex
Written in mesh shaders
LineIndices
Written in mesh shaders
TriangleIndices
Written in mesh shaders
VertexCount
Written to a workgroup variable in mesh shaders
Vertices
Written to a workgroup variable in mesh shaders
PrimitiveCount
Written to a workgroup variable in mesh shaders
Primitives
Written to a workgroup variable in mesh shaders
RayInvocationId
Read in all ray tracing pipeline shaders, the id within the number of rays that this current ray is.
NumRayInvocations
Read in all ray tracing pipeline shaders, the number of rays created.
InstanceCustomData
Read in closest hit and any hit shaders, the custom data in the tlas instance
GeometryIndex
Read in closest hit and any hit shaders, the index of the geometry in the blas.
WorldRayOrigin
Read in closest hit, any hit, and miss shaders, the origin of the ray.
WorldRayDirection
Read in closest hit, any hit, and miss shaders, the direction of the ray.
ObjectRayOrigin
Read in closest hit and any hit shaders, the direction of the ray in object space.
ObjectRayDirection
Read in closest hit and any hit shaders, the direction of the ray in object space.
RayTmin
Read in closest hit, any hit, and miss shaders, the t min provided by in the ray desc.
RayTCurrentMax
Read in closest hit, any hit, and miss shaders, the final bounds at which a hit is accepted (the closest committed hit if there is one otherwise, t max provided in the ray desc).
ObjectToWorld
Read in closest hit and any hit shaders, the matrix for converting from object space to world space
WorldToObject
Read in closest hit and any hit shaders, the matrix for converting from world space to object space
HitKind
Read in closest hit and any hit shaders, the type of hit as provided by the intersection function if any, otherwise this is 254 (0xFE) for a front facing triangle and 255 (0xFF) for a back facing triangle
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for BuiltIn
impl<'arbitrary> Arbitrary<'arbitrary> for BuiltIn
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§impl<'de> Deserialize<'de> for BuiltIn
impl<'de> Deserialize<'de> for BuiltIn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Ord for BuiltIn
impl Ord for BuiltIn
Source§impl PartialOrd for BuiltIn
impl PartialOrd for BuiltIn
Source§impl TryToWgsl for BuiltIn
impl TryToWgsl for BuiltIn
Source§const DESCRIPTION: &'static str = "builtin value"
const DESCRIPTION: &'static str = "builtin value"
Self represents.Source§fn try_to_wgsl(self) -> Option<&'static str>
fn try_to_wgsl(self) -> Option<&'static str>
impl Copy for BuiltIn
impl Eq for BuiltIn
impl StructuralPartialEq for BuiltIn
Auto Trait Implementations§
impl Freeze for BuiltIn
impl RefUnwindSafe for BuiltIn
impl Send for BuiltIn
impl Sync for BuiltIn
impl Unpin for BuiltIn
impl UnwindSafe for BuiltIn
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.