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.
This commit is contained in:
@@ -137,6 +137,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.getdimensions.rw.dx10.frag", "main"},
|
||||
{"hlsl.getdimensions.dx10.vert", "main"},
|
||||
{"hlsl.getsampleposition.dx10.frag", "main"},
|
||||
{"hlsl.global-const-init.frag", "main"},
|
||||
{"hlsl.domain.1.tese", "main"},
|
||||
{"hlsl.domain.2.tese", "main"},
|
||||
{"hlsl.domain.3.tese", "main"},
|
||||
|
||||
Reference in New Issue
Block a user