Implement the RayTCurrent
HLSL Function
#99192
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.
RayTCurrent
clang builtin,RayTCurrent
clang builtin withhlsl_intrinsics.h
RayTCurrent
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
RayTCurrent
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/RayTCurrent.hlsl
clang/test/SemaHLSL/BuiltIns/RayTCurrent-errors.hlsl
int_dx_RayTCurrent
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_RayTCurrent
to154
inDXIL.td
RayTCurrent.ll
andRayTCurrent_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_RayTCurrent
intrinsic inIntrinsicsSPIRV.td
RayTCurrent
lowering and map it toint_spv_RayTCurrent
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/RayTCurrent.ll
DirectX
SPIR-V
RayTmaxKHR
Short Description
RayTmaxKHR - Maximum T value of a ray
Description
RayTmaxKHR
A variable decorated with the
RayTmaxKHR
decoration will contain theparametric t max value of the ray
being processed. The value is independent of the space in which the ray
origin and direction exist. The value is initialized to the parameter
passed into the pipeline trace ray instruction.
The t max value changes throughout
the lifetime of the ray that produced the intersection. In the closest
hit shader, the value reflects the closest distance to the intersected
primitive. In the any-hit shader, it reflects the distance to the
primitive currently being intersected. In the intersection shader, it
reflects the distance to the closest primitive intersected so far or the
initial value. The value can change in the intersection shader after
calling
OpReportIntersectionKHR
if the corresponding any-hit shaderdoes not ignore the intersection. In a miss shader, the value is
identical to the parameter passed into the pipeline trace ray instruction.
Valid Usage
VUID-RayTmaxKHR-RayTmaxKHR-04348
The
RayTmaxKHR
decoration must be used only within theIntersectionKHR
,AnyHitKHR
,ClosestHitKHR
, orMissKHR
Execution
Model
VUID-RayTmaxKHR-RayTmaxKHR-04349
The variable decorated with
RayTmaxKHR
must be declared usingthe
Input
Storage
Class
VUID-RayTmaxKHR-RayTmaxKHR-04350
The variable decorated with
RayTmaxKHR
must be declared as ascalar 32-bit floating-point value
Test Case(s)
Example 1
SPIRV Example(s):
Example 2
HLSL:
A float representing the current parametric ending point for the ray.
Syntax
Remarks
RayTCurrent defines the current ending point of the ray according to the following formula: Origin + (Direction * RayTCurrent). Origin and Direction may be in either world or object space, which results in either a world or an object space ending point.
RayTCurrent is initialized in the call TraceRay call with the RayDesc::TMax value and then is updated during the trace query as intersections are reported (in the any hit), and accepted.
In the intersection shader, it represents the distance to the closest intersection found so far. It will be updated after () to the THit value provided if the hit was accepted.
In the any hit shader, it represents the distance to the current intersection being reported.
In the closest hit shader, it represents the distance to the closest intersection accepted.
In the miss shader, it is equal to TMax passed to the TraceRay call.
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: