Add conversion folding when the source is a constant.
This change adds unary conversion folding when the source is a constant. This fixes an ISV issue whereby: ``` const float16_t f = float16_t(42.0); ``` Wouldn't compile because the conversion operator would always produce an EvqTemporary when it could have produced an EvqConst. I've also added a test case that proves out that all basic-type to basic-type conversions work.
Showing
- Test/baseResults/constantUnaryConversion.comp.out 645 additions, 0 deletionsTest/baseResults/constantUnaryConversion.comp.out
- Test/baseResults/spv.16bitstorage-int.frag.out 9 additions, 8 deletionsTest/baseResults/spv.16bitstorage-int.frag.out
- Test/baseResults/spv.16bitstorage-uint.frag.out 6 additions, 6 deletionsTest/baseResults/spv.16bitstorage-uint.frag.out
- Test/baseResults/spv.16bitstorage.frag.out 7 additions, 8 deletionsTest/baseResults/spv.16bitstorage.frag.out
- Test/baseResults/spv.8bitstorage-int.frag.out 9 additions, 8 deletionsTest/baseResults/spv.8bitstorage-int.frag.out
- Test/baseResults/spv.8bitstorage-uint.frag.out 6 additions, 6 deletionsTest/baseResults/spv.8bitstorage-uint.frag.out
- Test/constantUnaryConversion.comp 48 additions, 0 deletionsTest/constantUnaryConversion.comp
- glslang/MachineIndependent/Constant.cpp 273 additions, 0 deletionsglslang/MachineIndependent/Constant.cpp
- glslang/MachineIndependent/Intermediate.cpp 7 additions, 3 deletionsglslang/MachineIndependent/Intermediate.cpp
- glslang/MachineIndependent/localintermediate.h 1 addition, 1 deletionglslang/MachineIndependent/localintermediate.h
- gtests/AST.FromFile.cpp 1 addition, 0 deletionsgtests/AST.FromFile.cpp
Loading
Please register or sign in to comment