Implement the HitKind
HLSL Function
#99195
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.
HitKind
clang builtin,HitKind
clang builtin withhlsl_intrinsics.h
HitKind
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
HitKind
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/HitKind.hlsl
clang/test/SemaHLSL/BuiltIns/HitKind-errors.hlsl
int_dx_HitKind
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_HitKind
to143
inDXIL.td
HitKind.ll
andHitKind_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_HitKind
intrinsic inIntrinsicsSPIRV.td
HitKind
lowering and map it toint_spv_HitKind
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/HitKind.ll
DirectX
SPIR-V
HitKindKHR
Short Description
HitKindKHR - Kind of hit that triggered an any-hit or closest hit ray
shader
Description
HitKindKHR
A variable decorated with the
HitKindKHR
decoration will describethe intersection that triggered the execution of the current shader. The
values are determined by the intersection shader. For user-defined
intersection shaders this is the value that was passed to the “Hit Kind”
operand of
OpReportIntersectionKHR
. For triangle intersectioncandidates, this will be one of
HitKindFrontFacingTriangleKHR
orHitKindBackFacingTriangleKHR
.Valid Usage
VUID-HitKindKHR-HitKindKHR-04242
The
HitKindKHR
decoration must be used only within theAnyHitKHR
orClosestHitKHR
Execution
Model
VUID-HitKindKHR-HitKindKHR-04243
The variable decorated with
HitKindKHR
must be declared usingthe
Input
Storage
Class
VUID-HitKindKHR-HitKindKHR-04244
The variable decorated with
HitKindKHR
must be declared as ascalar 32-bit integer value
Test Case(s)
Example 1
SPIRV Example(s):
Example 2
HLSL:
Returns the value passed as the HitKind parameter to ReportHit.
Syntax
Remarks
If the intersection was reported by fixed-function triangle intersection, HitKind will be one of HIT_KIND_TRIANGLE_FRONT_FACE (254) or HIT_KIND_TRIANGLE_BACK_FACE (255).
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: