New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPIR-V]Support KHR_Ray_tracing terminate Ops #3295
Conversation
❌ Build DirectXShaderCompiler 1.0.3961 failed (commit c8425bb51e by @jiaolu) |
Add OpIgnoreIntersectionKHR/OpTerminateRayKHR related microsoft#3285
730d15f
to
50760b2
Compare
@jiaolu @MarijnS95 @jaebaek Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ehsannas! Unfortunately this still seems to run into failed to optimize SPIR-V: OpLabel inside basic block
SourceLocation loc) | ||
: SpirvTerminator(IK_RayTracingTerminate, opcode, loc) { | ||
assert(opcode == spv::Op::OpTerminateRayKHR || | ||
spv::Op::OpIgnoreIntersectionKHR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spv::Op::OpIgnoreIntersectionKHR); | |
opcode == spv::Op::OpIgnoreIntersectionKHR); |
Praise clang for catching this one:
../tools/clang/lib/SPIRV/SpirvInstruction.cpp:994:47: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
assert(opcode == spv::Op::OpTerminateRayKHR ||
^
../tools/clang/lib/SPIRV/SpirvInstruction.cpp:995:10: error: value of type 'spv::Op' is not contextually convertible to 'bool'
spv::Op::OpIgnoreIntersectionKHR);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch. Sad that MSVC didn't catch this. Also not sure why Appveyor bot is passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know why appveyor is passing... MSVC doesn't catch the build warning and the FileCheck tests run without optimizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we need to update SPIRV-Tools to recognize these instructions as terminator as well :) Will do so soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another explanation would be Clang version. There are a few new warnings on Clang 11 but Appveyor is still at 10.0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should land this PR, and we will separately make fixes to SPIRV-Tools for recognizing these instructions as termination instructions.
Look good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang 11 build is green now, thanks!
Add OpIgnoreIntersectionKHR/OpTerminateRayKHR related
#3285