Description
- Implement
AllMemoryBarrier
clang builtin,LinkAllMemoryBarrier
clang builtin withhlsl_intrinsics.h
Add sema checks forAllMemoryBarrier
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forAllMemoryBarrier
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/AllMemoryBarrier.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/AllMemoryBarrier-errors.hlsl
Create theint_dx_AllMemoryBarrier
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_AllMemoryBarrier
to80
inDXIL.td
Create theAllMemoryBarrier.ll
andAllMemoryBarrier_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_AllMemoryBarrier
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theAllMemoryBarrier
lowering and map it toint_spv_AllMemoryBarrier
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/AllMemoryBarrier.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
80 | Barrier | 6.0 | () |
SPIR-V
OpMemoryBarrier:
Description:
Control the order that memory accesses are observed.
Ensures that memory accesses issued before this instruction are observed
before memory accesses issued after this instruction. This control is
ensured only for memory accesses issued by this
invocation and observed by another invocation executing
within Memory scope. If the Vulkan memory model
is declared, this ordering only applies to memory accesses that use the
NonPrivatePointer memory operand or
NonPrivateTexel image operand.
Semantics declares what kind of memory is being controlled and what
kind of control to apply.
To execute both a memory barrier and a control barrier, see
OpControlBarrier.
Word Count | Opcode | Results | Operands |
---|---|---|---|
3 |
225 |
Scope <id> |
Memory Semantics
<id> |
Test Case(s)
Example 1
//dxc AllMemoryBarrier_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export void fn() {
return AllMemoryBarrier();
}
HLSL:
Blocks execution of all threads in a group until all memory accesses have been completed.
Syntax
void AllMemoryBarrier(void);
Parameters
This function has no parameters.
Return value
This function does not return a value.
Remarks
A memory barrier guarantees that outstanding memory operations have completed. Threads are synchronized at GroupSync barriers. This may stall a thread or threads if memory operations are in progress.
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 5 and higher shader models | yes |
This function is supported in the following types of shaders:
Vertex | Hull | Domain | Geometry | Pixel | Compute |
---|---|---|---|---|---|
x |
See also
Metadata
Metadata
Assignees
Type
Projects
Status
Activity
Barrier
HLSL Function #99234