Open
Listed in
Description
- Implement
IgnoreHit
clang builtin,LinkIgnoreHit
clang builtin withhlsl_intrinsics.h
Add sema checks forIgnoreHit
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forIgnoreHit
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/IgnoreHit.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/IgnoreHit-errors.hlsl
Create theint_dx_IgnoreHit
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_IgnoreHit
to155
inDXIL.td
Create theIgnoreHit.ll
andIgnoreHit_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_IgnoreHit
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theIgnoreHit
lowering and map it toint_spv_IgnoreHit
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/IgnoreHit.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
155 | IgnoreHit | 6.3 | ('anyhit',) |
SPIR-V
OpIgnoreIntersectionKHR:
Description:
Reserved.
Capability:
RayTracingKHR
Word Count | Opcode | Results | Operands |
---|---|---|---|
1 | 4448 |
Test Case(s)
Example 1
//dxc IgnoreHit_test.hlsl -T lib_6_8 -enable-16bit-types -O0
struct [raypayload] RayPayload
{
float4 color : write(caller) : read(anyhit);
float distance : write(caller) : read(anyhit);
};
struct Attributes {
float3 barycentrics;
uint primitiveIndex;
};
[shader("anyhit")]
export void fn(inout RayPayload payload, in Attributes attributes) {
return IgnoreHit();
}
SPIRV Example(s):
Example 2
//dxc IgnoreHit_spirv_test.hlsl -T lib_6_8 -E fn -enable-16bit-types -spirv -fspv-target-env=universal1.5 -fcgl -O0
struct [raypayload] RayPayload
{
float4 color : write(caller) : read(anyhit);
float distance : write(caller) : read(anyhit);
};
struct Attributes {
float3 barycentrics;
uint primitiveIndex;
};
[shader("anyhit")]
void fn(inout RayPayload payload, in Attributes attributes) {
return IgnoreHit();
}
HLSL:
Called from an any hit shader to reject the hit and end the shader. The hit search continues on without committing the distance and attributes for the current hit. The ReportHit call in the intersection shader, if there is one, will return false. Any modifications made to the ray payload up to this point in the any hit shader are preserved.
Syntax
void IgnoreHit();
Return Value
void
Remarks
This function can be called from the following raytracing shader types:
See also
Metadata
Metadata
Assignees
Type
Projects
Status
No status
Milestone
Relationships
Development
No branches or pull requests
Activity