WIP: HLSL: support global const initializers from non-constant rvalues
authorLoopDawg <sk_opengl@khasekhemwy.net>
Mon, 10 Jul 2017 21:43:40 +0000 (15:43 -0600)
committerLoopDawg <sk_opengl@khasekhemwy.net>
Tue, 11 Jul 2017 19:41:39 +0000 (13:41 -0600)
commit0fca0bafaf39aeeefd3af4742b727acf9b602958
tree5cef0b2fcae9100a61a917d9c183152e94d86f96
parent652db16ff114747c216ec631767dfd27e3d3c838
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.
Test/baseResults/hlsl.global-const-init.frag.out [new file with mode: 0644]
Test/hlsl.global-const-init.frag [new file with mode: 0644]
gtests/Hlsl.FromFile.cpp
hlsl/hlslGrammar.cpp
hlsl/hlslParseHelper.cpp