HLSL: Fix issue #658: Don't adopt initializer constness from declaration.
This also makes it match how GLSL handles the same thing.
This commit is contained in:
@@ -18,6 +18,25 @@ void Test1()
|
||||
|
||||
struct mystruct2 { float a; float b; float c; };
|
||||
mystruct2 test5 = { {8,}, {9,}, {10}, };
|
||||
const mystruct2 constTest5 = { {8,}, {9,}, {10}, };
|
||||
constTest5.c;
|
||||
|
||||
const float step = 1.f;
|
||||
float n = 0;
|
||||
const float3 a[8] = {
|
||||
normalize(float3(1, 1, 1)) * (n += step),
|
||||
normalize(float3(-1, -1, -1)) * (n += step),
|
||||
normalize(float3(-1, -1, 1)) * (n += step),
|
||||
normalize(float3(-1, 1, -1)) * (n += step),
|
||||
normalize(float3(-1, 1, 1)) * (n += step),
|
||||
normalize(float3(1, -1, -1)) * (n += step),
|
||||
normalize(float3(1, -1, 1)) * (n += step),
|
||||
normalize(float3(1, 1, -1)) * (n += step) };
|
||||
|
||||
const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) };
|
||||
const struct two { float3 a;
|
||||
float3 b; } twoNonConst = { normalize(float3(-1, 1, 1)) * (n += step),
|
||||
normalize(float3(-1, 1, 1)) * (n += step) };
|
||||
}
|
||||
|
||||
struct PS_OUTPUT { float4 color : SV_Target0; };
|
||||
|
||||
Reference in New Issue
Block a user