Expand description
SPIR-V Instrinics
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.
Traits§
- Index
Unchecked - 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 givenSEMANTICS
. All subparts of the value that is loaded are read atomically with respect to all other atomic accesses to it withinSCOPE
. - 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 givenSEMANTICS
. All subparts ofvalue
are written atomically with respect to all other atomic accesses to it withinSCOPE
. - 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.
- ddx
- Returns the partial derivative of
component
with respect to the window’s X coordinate. Returns the same result as eitherddx_fine
orddx_coarse
, selection of which one is dependent on external factors. - ddx_
coarse - Returns the partial derivative of
component
with respect to the window’s X coordinate. Uses local differencing based on the value ofcomponent
for the current fragment’s neighbors, and possibly, but not necessarily, includes the value ofcomponent
for the current fragment. That is, over a given area, the implementation can compute X derivatives in fewer unique locations than would be allowed byddx_fine
. - ddx_
coarse_ vector - Returns the partial derivative of
component
with respect to the window’s X coordinate. Uses local differencing based on the value ofcomponent
for the current fragment’s neighbors, and possibly, but not necessarily, includes the value ofcomponent
for the current fragment. That is, over a given area, the implementation can compute X derivatives in fewer unique locations than would be allowed byddx_fine
. - ddx_
fine - Returns the partial derivative of
component
with respect to the window’s X coordinate. Uses local differencing based on the value ofcomponent
for the current fragment and its immediate neighbor(s). - ddx_
fine_ vector - Returns the partial derivative of
component
with respect to the window’s X coordinate. Uses local differencing based on the value ofcomponent
for the current fragment and its immediate neighbor(s). - ddx_
vector - Returns the partial derivative of
component
with respect to the window’s X coordinate. Returns the same result as eitherddx_fine
orddx_coarse
, selection of which one is dependent on external factors. - ddy
- Returns the partial derivative of
component
with respect to the window’s Y coordinate. Returns the same result as eitherddy_fine
orddy_coarse
, selection of which one is dependent on external factors. - ddy_
coarse - Returns the partial derivative of
component
with respect to the window’s Y coordinate. Uses local differencing based on the value ofcomponent
for the current fragment’s neighbors, and possibly, but not necessarily, includes the value ofcomponent
for the current fragment. That is, over a given area, the implementation can compute Y derivatives in fewer unique locations than would be allowed byddy_fine
. - ddy_
coarse_ vector - Returns the partial derivative of
component
with respect to the window’s Y coordinate. Uses local differencing based on the value ofcomponent
for the current fragment’s neighbors, and possibly, but not necessarily, includes the value ofcomponent
for the current fragment. That is, over a given area, the implementation can compute Y derivatives in fewer unique locations than would be allowed byddy_fine
. - ddy_
fine - Returns the partial derivative of
component
with respect to the window’s Y coordinate. Uses local differencing based on the value ofcomponent
for the current fragment and its immediate neighbor(s). - ddy_
fine_ vector - Returns the partial derivative of
component
with respect to the window’s Y coordinate. Uses local differencing based on the value ofcomponent
for the current fragment and its immediate neighbor(s). - ddy_
vector - Returns the partial derivative of
component
with respect to the window’s Y coordinate. Returns the same result as eitherddy_fine
orddy_coarse
, selection of which one is dependent on external factors. - 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_
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.
- fwidth
- Returns the sum of the absolute values of
ddx
andddy
as a single operation. - fwidth_
coarse - Returns the sum of the absolute values of
ddx_coarse
andddy_coarse
as a single operation. - fwidth_
coarse_ vector - Returns the sum of the absolute values of
ddx_coarse
andddy_coarse
as a single operation. - fwidth_
fine - Returns the sum of the absolute values of
ddx_fine
andddy_fine
as a single operation. - fwidth_
fine_ vector - Returns the sum of the absolute values of
ddx_fine
andddy_fine
as a single operation. - fwidth_
vector - Returns the sum of the absolute values of
ddx
andddy
as a single operation. - 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 isfalse
. 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.
- report_
intersection ⚠ - Reports an intersection back to the traversal infrastructure.
- 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.
- 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 theany_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.