Implement the InterlockedExchange
HLSL Function
#99129
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
InterlockedExchange
clang builtin,InterlockedExchange
clang builtin withhlsl_intrinsics.h
InterlockedExchange
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
InterlockedExchange
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/InterlockedExchange.hlsl
clang/test/SemaHLSL/BuiltIns/InterlockedExchange-errors.hlsl
int_dx_InterlockedExchange
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_InterlockedExchange
to78
inDXIL.td
InterlockedExchange.ll
andInterlockedExchange_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_InterlockedExchange
intrinsic inIntrinsicsSPIRV.td
InterlockedExchange
lowering and map it toint_spv_InterlockedExchange
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/InterlockedExchange.ll
DirectX
SPIR-V
OpAtomicExchange:
Description:
Perform the following steps atomically with respect to any other atomic
accesses within Scope to the same location:
The instruction’s result is the Original Value.
Result Type must be a scalar of integer type or
floating-point type.
The type of Value must be the same as Result Type. The type of the
value pointed to by Pointer must be the same as Result Type.
Memory is a memory Scope.
7
229
<id>
Result Type
Result <id>
<id>
Pointer
Scope <id>
Memory
Memory Semantics <id>
Semantics
<id>
Value
Test Case(s)
Example 1
Example 2
Example 3
HLSL:
Assigns value to dest and returns the original value.
Syntax
Parameters
dest [in]
Type: R
The destination address.
value [in]
Type: T
The input value.
original_value [out]
Type: T
The original value.
Return value
This function does not return a value.
Remarks
This operation can only be performed on scalar-typed resources and shared memory variables. There are two possible uses for this function. The first is when R is a shared memory variable type. In this case, the function performs the operation on the shared memory register referenced by dest. The second scenario is when R is a resource variable type. In this scenario, the function performs the operation on the resource location referenced by dest. This operation is only available when R is readable and writable.
Interlocked operations do not imply any memory fence/barrier.
Minimum Shader Model
This function is supported in the following shader models.
This function is supported in the following types of shaders:
See also
Intrinsic Functions
Shader Model 5
The text was updated successfully, but these errors were encountered: