Skip to content

Commit 155f57a

Browse files
committed
Merge branch 'i7945' of github.com:s-perron/DirectXShaderCompiler into devshFixes
2 parents 0bd2f04 + 09edb1a commit 155f57a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tools/clang/lib/SPIRV/SpirvEmitter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6899,6 +6899,7 @@ SpirvInstruction *SpirvEmitter::doUnaryOperator(const UnaryOperator *expr) {
68996899
}
69006900

69016901
spv::Op SpirvEmitter::translateOp(BinaryOperator::Opcode op, QualType type) {
6902+
type = type.getDesugaredType(astContext);
69026903
const bool isSintType = isSintOrVecMatOfSintType(type);
69036904
const bool isUintType = isUintOrVecMatOfUintType(type);
69046905
const bool isFloatType = isFloatOrVecMatOfFloatType(type);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %dxc -spirv -T lib_6_8 %s -fcgl | FileCheck %s
2+
3+
enum LuminairePlanesSymmetry : uint
4+
{
5+
ISOTROPIC = 0u,
6+
NO_LATERAL_SYMMET
7+
};
8+
9+
using symmetry_t = LuminairePlanesSymmetry;
10+
const symmetry_t symmetry;
11+
12+
[numthreads(1,1,1)]
13+
[shader("compute")]
14+
void main(uint3 id : SV_DispatchThreadID)
15+
{
16+
// CHECK: [[AC:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %_Globals %int_0
17+
// CHECK: [[LHS:%[0-9]+]] = OpLoad %int [[AC]]
18+
// CHECK: [[RHS:%[0-9]+]] = OpLoad %int %ISOTROPIC
19+
// CHECK: OpIEqual %bool [[LHS]] [[RHS]]
20+
const uint i0 = (symmetry == symmetry_t::ISOTROPIC) ? 0u : 1u;
21+
}

0 commit comments

Comments
 (0)