Skip to content

Commit 0e71241

Browse files
committed
Add support for OpUndef
Treat OpUndef identically to OpConstantNull for now. Change-Id: I721f2bf5e053d6a8d6f563272b1d44b6636a157c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27529 Tested-by: Chris Forbes <[email protected]> Presubmit-Ready: Chris Forbes <[email protected]> Reviewed-by: Ben Clayton <[email protected]>
1 parent 7cdf79c commit 0e71241

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Pipeline/SpirvShader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ namespace sw
215215
CreateConstant(insn).constantValue[0] = ~0u; // represent boolean true as all bits set
216216
break;
217217
case spv::OpConstantNull:
218+
case spv::OpUndef:
218219
{
220+
// TODO: consider a real LLVM-level undef. For now, zero is a perfectly good value.
219221
// OpConstantNull forms a constant of arbitrary type, all zeros.
220222
auto &object = CreateConstant(insn);
221223
auto &objectTy = getType(object.type);
@@ -1062,6 +1064,7 @@ namespace sw
10621064
case spv::OpConstantTrue:
10631065
case spv::OpConstantFalse:
10641066
case spv::OpConstantComposite:
1067+
case spv::OpUndef:
10651068
case spv::OpExtension:
10661069
case spv::OpCapability:
10671070
case spv::OpEntryPoint:

0 commit comments

Comments
 (0)