Module arch

Source
Expand description

SPIR-V Intrinsics

This module is intended as a low level abstraction over SPIR-V instructions. These functions will typically map to a single instruction, and will perform no additional safety checks beyond type-checking.

Structs§

SubgroupMask
SubgroupMask is a glam::UVec4 representing a bitmask of all invocations within a subgroup. Mostly used in group ballot operations.

Enums§

GroupOperation
Defines the class of group operation.
QuadDirection
Direction is the kind of swap to perform.

Traits§

Derivative
Types that can be derived by partial derivatives
IndexUnchecked
Index into an array without bounds checking.

Functions§

all
Result is true if all components of vector is true, otherwise result is false.
all_memory_barrier
Blocks execution of all threads in a group until all memory accesses have been completed.
all_memory_barrier_with_group_sync
Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call.
any
Result is true if any component of vector is true, otherwise result is false.
atomic_and
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_compare_exchange
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_exchange
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_f_add
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_f_max
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_f_min
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_i_add
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_i_decrement
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_i_increment
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_i_sub
Perform the following steps atomically with respect to any other atomic accesses within SCOPE to the same location:
atomic_load
Atomically load through ptr using the given SEMANTICS. All subparts of the value that is loaded are read atomically with respect to all other atomic accesses to it within SCOPE.
atomic_or
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_s_max
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_s_min
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_store
Atomically store through ptr using the given SEMANTICS. All subparts of value are written atomically with respect to all other atomic accesses to it within SCOPE.
atomic_u_max
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_u_min
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
atomic_xor
Perform the following steps atomically with respect to any other atomic accesses within Scope to the same location:
control_barrier
Wait for other invocations of this module to reach the current point of execution.
demote_to_helper_invocation
Demote fragment shader invocation to a helper invocation. Equivalvent to discard() in HLSL. Any stores to memory after this instruction are suppressed and the fragment does not write outputs to the framebuffer.
device_memory_barrier
Blocks execution of all threads in a group until all device memory accesses have been completed.
device_memory_barrier_with_group_sync
Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call.
emit_mesh_tasks_ext
Defines the grid size of subsequent mesh shader workgroups to generate upon completion of the task shader workgroup.
emit_mesh_tasks_ext_payload
Defines the grid size of subsequent mesh shader workgroups to generate upon completion of the task shader workgroup.
emit_stream_vertex
Emits the current values of all output variables to the current output primitive. After execution, the values of all output variables are undefined.
emit_vertex
Emits the current values of all output variables to the current output primitive. After execution, the values of all output variables are undefined. Requires capability Geometry.
end_primitive
Finish the current primitive and start a new one. No vertex is emitted. Requires capability Geometry.
end_stream_primitive
Finish the current primitive and start a new one. No vertex is emitted.
execute_callable
Invoke a callable shader.
ignore_intersection
Ignores the current potential intersection, terminating the invocation that executes it, and continues the ray traversal. This instruction is allowed only in any_hit execution model.
is_helper_invocation
Returns true if the invocation is currently a helper invocation, otherwise result is false. An invocation is currently a helper invocation if it was originally invoked as a helper invocation or if it has been demoted to a helper invocation by demote_to_helper_invocation.
kill
Fragment-shader discard. Equivalvent to discard() from GLSL
memory_barrier
Control the order that memory accesses are observed.
read_clock_khr
Read from the shader clock with either the Subgroup or Device scope.
read_clock_uvec2_khr
Like read_clock_khr but returns a vector to avoid requiring the Int64 capability. It returns a ‘vector of two-components of 32-bit unsigned integer type with the first component containing the 32 least significant bits and the second component containing the 32 most significant bits.’
report_intersection
Reports an intersection back to the traversal infrastructure.
set_mesh_outputs_ext
Sets the actual output size of the primitives and vertices that the mesh shader workgroup will emit upon completion.
signed_max
Compute the maximum of two signed integers via a GLSL extended instruction.
signed_min
Compute the minimum of two signed integers via a GLSL extended instruction.
subgroup_all
Evaluates a predicate for all active invocations in the group, resulting in true if predicate evaluates to true for all active invocations in the group, otherwise the result is false.
subgroup_all_equal
Evaluates a value for all active invocations in the group. The result is true if value is equal for all active invocations in the group. Otherwise, the result is false.
subgroup_and
A bitwise and group operation of all value operands contributed by active invocations in the group.
subgroup_any
Evaluates a predicate for all active invocations in the group, resulting in true if predicate evaluates to true for any active invocation in the group, otherwise the result is false.
subgroup_ballot
Result is a bitfield value combining the predicate value from all invocations in the group that execute the same dynamic instance of this instruction. The bit is set to one if the corresponding invocation is active and the predicate for that invocation evaluated to true; otherwise, it is set to zero.
subgroup_ballot_bit_count
Result is the number of bits that are set to 1 in value, considering only the bits in value required to represent all bits of the group’s invocations.
subgroup_ballot_bit_extract
Evaluates a value for all active invocations in the group, resulting in true if the bit in value that corresponds to index is set to one, otherwise the result is false.
subgroup_ballot_exclusive_bit_count
Result is the number of bits that are set to 1 in value, considering only the bits in value required to represent all bits of the group’s invocations.
subgroup_ballot_find_lsb
Find the least significant bit set to 1 in value, considering only the bits in value required to represent all bits of the group’s invocations. If none of the considered bits is set to 1, the resulting value is undefined.
subgroup_ballot_find_msb
Find the most significant bit set to 1 in value, considering only the bits in value required to represent all bits of the group’s invocations. If none of the considered bits is set to 1, the resulting value is undefined.
subgroup_ballot_inclusive_bit_count
Result is the number of bits that are set to 1 in value, considering only the bits in value required to represent all bits of the group’s invocations.
subgroup_barrier
The function subgroupBarrier() enforces that all active invocations within a subgroup must execute this function before any are allowed to continue their execution, and the results of any memory stores performed using coherent variables performed prior to the call will be visible to any future coherent access to the same memory performed by any other shader invocation within the same subgroup.
subgroup_broadcast
Result is the value of the invocation identified by the id id to all active invocations in the group.
subgroup_broadcast_first
Result is the value of the invocation from the active invocation with the lowest id in the group to all active invocations in the group.
subgroup_clustered_and
A bitwise and group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_f_add
A floating point add group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_f_max
A floating point maximum group operation of all value operands contributed by active invocations in by group.
subgroup_clustered_f_min
A floating point minimum group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_f_mul
A floating point multiply group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_i_add
An integer add group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_i_mul
An integer multiply group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_logical_and
A logical and group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_logical_or
A logical or group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_logical_xor
A logical xor group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_or
A bitwise or group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_s_max
A signed integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_s_min
A signed integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_u_max
An unsigned integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_u_min
An unsigned integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_clustered_xor
A bitwise xor group operation of all value operands contributed by active invocations in the group.
subgroup_elect
Result is true only in the active invocation with the lowest id in the group, otherwise result is false.
subgroup_exclusive_and
A bitwise and group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_f_add
A floating point add group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_f_max
A floating point maximum group operation of all value operands contributed by active invocations in by group.
subgroup_exclusive_f_min
A floating point minimum group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_f_mul
A floating point multiply group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_i_add
An integer add group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_i_mul
An integer multiply group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_logical_and
A logical and group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_logical_or
A logical or group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_logical_xor
A logical xor group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_or
A bitwise or group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_s_max
A signed integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_s_min
A signed integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_u_max
An unsigned integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_u_min
An unsigned integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_exclusive_xor
A bitwise xor group operation of all value operands contributed by active invocations in the group.
subgroup_f_add
A floating point add group operation of all value operands contributed by active invocations in the group.
subgroup_f_max
A floating point maximum group operation of all value operands contributed by active invocations in by group.
subgroup_f_min
A floating point minimum group operation of all value operands contributed by active invocations in the group.
subgroup_f_mul
A floating point multiply group operation of all value operands contributed by active invocations in the group.
subgroup_i_add
An integer add group operation of all value operands contributed by active invocations in the group.
subgroup_i_mul
An integer multiply group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_and
A bitwise and group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_f_add
A floating point add group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_f_max
A floating point maximum group operation of all value operands contributed by active invocations in by group.
subgroup_inclusive_f_min
A floating point minimum group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_f_mul
A floating point multiply group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_i_add
An integer add group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_i_mul
An integer multiply group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_logical_and
A logical and group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_logical_or
A logical or group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_logical_xor
A logical xor group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_or
A bitwise or group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_s_max
A signed integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_s_min
A signed integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_u_max
An unsigned integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_u_min
An unsigned integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_inclusive_xor
A bitwise xor group operation of all value operands contributed by active invocations in the group.
subgroup_inverse_ballot
Evaluates a value for all active invocations in the group, resulting in true if the bit in value for the corresponding invocation is set to one, otherwise the result is false.
subgroup_logical_and
A logical and group operation of all value operands contributed by active invocations in the group.
subgroup_logical_or
A logical or group operation of all value operands contributed by active invocations in the group.
subgroup_logical_xor
A logical xor group operation of all value operands contributed by active invocations in the group.
subgroup_memory_barrier
The function subgroupMemoryBarrier() enforces the ordering of all memory transactions issued within a single shader invocation, as viewed by other invocations in the same subgroup.
subgroup_memory_barrier_buffer
The function subgroupMemoryBarrierBuffer() enforces the ordering of all memory transactions to buffer variables issued within a single shader invocation, as viewed by other invocations in the same subgroup.
subgroup_memory_barrier_image
The function subgroupMemoryBarrierImage() enforces the ordering of all memory transactions to images issued within a single shader invocation, as viewed by other invocations in the same subgroup.
subgroup_memory_barrier_shared
The function subgroupMemoryBarrierShared() enforces the ordering of all memory transactions to shared variables issued within a single shader invocation, as viewed by other invocations in the same subgroup.
subgroup_or
A bitwise or group operation of all value operands contributed by active invocations in the group.
subgroup_quad_broadcast
Result is the value of the invocation within the quad with a quad index equal to index.
subgroup_quad_swap
Swap the value of the invocation within the quad with another invocation in the quad using Direction.
subgroup_s_max
A signed integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_s_min
A signed integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_shuffle
Result is the value of the invocation identified by the id id.
subgroup_shuffle_down
Result is the value of the invocation identified by the current invocation’s id within the group + Delta.
subgroup_shuffle_up
Result is the value of the invocation identified by the current invocation’s id within the group - Delta.
subgroup_shuffle_xor
Result is the value of the invocation identified by the current invocation’s id within the group xor’ed with Mask.
subgroup_u_max
An unsigned integer maximum group operation of all value operands contributed by active invocations in the group.
subgroup_u_min
An unsigned integer minimum group operation of all value operands contributed by active invocations in the group.
subgroup_xor
A bitwise xor group operation of all value operands contributed by active invocations in the group.
terminate_ray
Terminates the invocation that executes it, stops the ray traversal, accepts the current hit, and invokes the closest_hit execution model (if active). This instruction is allowed only in the any_hit execution model.
unsigned_max
Compute the maximum of two unsigned integers via a GLSL extended instruction.
unsigned_min
Compute the minimum of two unsigned integers via a GLSL extended instruction.
vector_extract_dynamic
Extract a single, dynamically selected, component of a vector.
vector_insert_dynamic
Make a copy of a vector, with a single, variably selected, component modified.
workgroup_memory_barrier
Blocks execution of all threads in a group until all group shared accesses have been completed.
workgroup_memory_barrier_with_group_sync
Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call.