WIP: HLSL: support global const initializers from non-constant rvalues
Semantic test left over from other source languages is removed, since this is permitted by HLSL. Also, to support the functionality, a targeted test is performed for this case and it is turned into a EvqGlobal qualifier to create an AST initialization segment when needed. Constness is now propagated up aggregate chains during initializer construction. This handles hierarchical cases such as the distinction between: static const float2 a[2] = { { 1, 2 }, { 3, 4} }; vs static const float2 a[2] = { { 1, 2 }, { cbuffer_member, 4} }; The first of which can use a first class constant initalization, and the second cannot.
Showing
- Test/baseResults/hlsl.global-const-init.frag.out 178 additions, 0 deletionsTest/baseResults/hlsl.global-const-init.frag.out
- Test/hlsl.global-const-init.frag 14 additions, 0 deletionsTest/hlsl.global-const-init.frag
- gtests/Hlsl.FromFile.cpp 1 addition, 0 deletionsgtests/Hlsl.FromFile.cpp
- hlsl/hlslGrammar.cpp 11 additions, 0 deletionshlsl/hlslGrammar.cpp
- hlsl/hlslParseHelper.cpp 15 additions, 5 deletionshlsl/hlslParseHelper.cpp
Loading
Please register or sign in to comment