Implement the TraceRay
HLSL Function
#99178
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.
TraceRay
clang builtin,TraceRay
clang builtin withhlsl_intrinsics.h
TraceRay
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
TraceRay
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/TraceRay.hlsl
clang/test/SemaHLSL/BuiltIns/TraceRay-errors.hlsl
int_dx_TraceRay
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_TraceRay
to157
inDXIL.td
TraceRay.ll
andTraceRay_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_TraceRay
intrinsic inIntrinsicsSPIRV.td
TraceRay
lowering and map it toint_spv_TraceRay
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/TraceRay.ll
DirectX
SPIR-V
OpTraceRayKHR:
Description:
Reserved.
Capability:
RayTracingKHR
Reserved.
12
4445
<id>
Accel
<id>
Ray Flags
<id>
Cull Mask
<id>
SBT Offset
<id>
SBT Stride
<id>
Miss Index
<id>
Ray Origin
<id>
Ray Tmin
<id>
Ray Direction
<id>
Ray Tmax
<id>
Payload
Test Case(s)
Example 1
HLSL:
Sends a ray into a search for hits in an acceleration structure.
Syntax
This intrinsic function definition is equivalent to the following function template:
Parameters
AccelerationStructure
The top-level acceleration structure to use. Specifying a NULL acceleration structure forces a miss.
RayFlags
Valid combination of ray_flag values. Only defined ray flags are propagated by the system, i.e. are visible to the RayFlags shader intrinsic.
InstanceInclusionMask
An unsigned integer, the bottom 8 bits of which are used to include or reject geometry instances based on the InstanceMask in each instance. For example:
RayContributionToHitGroupIndex
An unsigned integer specifying the offset to add into addressing calculations within shader tables for hit group indexing. Only the bottom 4 bits of this value are used.
MultiplierForGeometryContributionToHitGroupIndex
An unsigned integer specifying the stride to multiply by GeometryContributionToHitGroupIndex, which is just the 0 based index the geometry was supplied by the app into its bottom-level acceleration structure. Only the bottom 16 bits of this multiplier value are used.
MissShaderIndex
An unsigned integer specifying the index of the miss shader within a shader table.
Ray
A RayDesc representing the ray to be traced.
Payload
A user defined ray payload accessed both for both input and output by shaders invoked during raytracing. After TraceRay completes, the caller can access the payload as well.
Return Value
void
Remarks
This function can be called from the following raytracing shader types:
See also
Direct3D 12 Raytracing HLSL Reference
The text was updated successfully, but these errors were encountered: