Description
- Implement
DispatchRaysDimensions
clang builtin,LinkDispatchRaysDimensions
clang builtin withhlsl_intrinsics.h
Add sema checks forDispatchRaysDimensions
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forDispatchRaysDimensions
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/DispatchRaysDimensions.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/DispatchRaysDimensions-errors.hlsl
Create theint_dx_DispatchRaysDimensions
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_DispatchRaysDimensions
to146
inDXIL.td
Create theDispatchRaysDimensions.ll
andDispatchRaysDimensions_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_DispatchRaysDimensions
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theDispatchRaysDimensions
lowering and map it toint_spv_DispatchRaysDimensions
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/DispatchRaysDimensions.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
146 | DispatchRaysDimensions | 6.3 | ('library', 'raygeneration', 'intersection', 'anyhit', 'closesthit', 'miss', 'callable') |
SPIR-V
Description
LaunchSizeKHR
A variable decorated with the LaunchSizeKHR
decoration will contain
the width
, height
, and depth
dimensions passed to the
vkCmdTraceRaysKHR command that initiated this
shader execution. The width
is in the first component, the
height
is in the second component, and the depth
is in the third
component.
Valid Usage
-
VUID-LaunchSizeKHR-LaunchSizeKHR-04269
TheLaunchSizeKHR
decoration must be used only within the
RayGenerationKHR
,IntersectionKHR
,AnyHitKHR
,
ClosestHitKHR
,MissKHR
, orCallableKHR
Execution
Model
-
VUID-LaunchSizeKHR-LaunchSizeKHR-04270
The variable decorated withLaunchSizeKHR
must be declared
using theInput
Storage
Class
-
VUID-LaunchSizeKHR-LaunchSizeKHR-04271
The variable decorated withLaunchSizeKHR
must be declared as
a three-component vector of 32-bit integer values
Test Case(s)
Example 1
//dxc DispatchRaysDimensions_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export uint3 fn() {
return DispatchRaysDimensions();
}
SPIRV Example(s):
Example 2
//dxc DispatchRaysDimensions_spirv_test.hlsl -T lib_6_8 -E fn -enable-16bit-types -spirv -fspv-target-env=universal1.5 -fcgl -O0
[shader("intersection")]
void fn() {
uint3 ret = DispatchRaysDimensions();
}
HLSL:
The width, height and depth values from the D3D12_DISPATCH_RAYS_DESC structure specified in the originating DispatchRays call.
Syntax
uint3 DispatchRaysDimensions();
Remarks
This function can be called from the following raytracing shader types:
- Any Hit Shader
- Callable Shader
- Closest Hit Shader
- Intersection Shader
- Miss Shader
- Ray Generation Shader
See also
Metadata
Metadata
Assignees
Type
Projects
Status
Activity