Skip to content

Commit 8cc4eed

Browse files
committed
Gracefully end codegen when reflect used in a non-Vulkan env
1 parent 7ddd5b2 commit 8cc4eed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,8 +3030,10 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
30303030
return selectExtInst(ResVReg, ResType, I, CL::fract, GL::Fract);
30313031
case Intrinsic::spv_normalize:
30323032
return selectExtInst(ResVReg, ResType, I, CL::normalize, GL::Normalize);
3033-
case Intrinsic::spv_reflect: // There is no CL equivalent of Reflect
3034-
return selectExtInst(ResVReg, ResType, I, GL::Reflect);
3033+
case Intrinsic::spv_reflect:
3034+
if (STI.isVulkanEnv()) // There is no CL equivalent of Reflect
3035+
return selectExtInst(ResVReg, ResType, I, GL::Reflect);
3036+
break;
30353037
case Intrinsic::spv_rsqrt:
30363038
return selectExtInst(ResVReg, ResType, I, CL::rsqrt, GL::InverseSqrt);
30373039
case Intrinsic::spv_sign:

0 commit comments

Comments
 (0)