File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -994,6 +994,8 @@ SpirvInstruction *SpirvBuilder::createEmulatedBitFieldExtract(
994994 rightShift->setResultType (baseType);
995995 }
996996
997+ rightShift->setRValue (true );
998+
997999 return rightShift;
9981000}
9991001
Original file line number Diff line number Diff line change 1+ // RUN: %dxc -T cs_6_2 -E main -spirv -fcgl -enable-16bit-types %s | FileCheck %s
2+
3+ struct S1
4+ {
5+ uint16_t a : 8 ;
6+ };
7+
8+ S1 foo ()
9+ {
10+ return (S1)0 ;
11+ }
12+
13+ [numthreads (1 , 1 , 1 )]
14+ void main () {
15+ uint16_t test = foo ().a;
16+ // CHECK: [[ptr:%[0-9]+]] = OpAccessChain %_ptr_Function_ushort %temp_var_S1 %int_0
17+ // CHECK: [[raw:%[0-9]+]] = OpLoad %ushort [[ptr]]
18+ // CHECK: [[tmp:%[0-9]+]] = OpShiftLeftLogical %ushort [[raw]] %uint_8
19+ // CHECK: [[out:%[0-9]+]] = OpShiftRightLogical %ushort [[tmp]] %uint_8
20+ // CHECK-NOT: OpLoad %ushort [[out]]
21+ // CHECK: OpStore %test [[out]]
22+ }
You can’t perform that action at this time.
0 commit comments