glslang/Test/hlsl.reflection.vert
John Kessenich 2572b19e94 HLSL: Turn on reflection, with basic test file, to catch regressions.
This is not a claim that reflection is working right, only a way to
see it is occurring and catch any regression.
2016-09-19 23:12:48 -06:00

166 lines
2.9 KiB
GLSL

cbuffer nameless {
float3 anonMember1;
float3x2 m23;
int scalarAfterm23;
float4 anonDeadMember2;
float4 anonMember3;
int scalarBeforeArray;
float floatArray[5];
int scalarAfterArray;
float2x2 m22[9];
};
cbuffer c_nameless {
float3 c_anonMember1;
float3x2 c_m23;
int c_scalarAfterm23;
float4 c_anonDeadMember2;
float4 c_anonMember3;
};
cbuffer named {
float3 deadMember1;
int scalar;
float4 member2;
float4 member3;
float2 memfloat2;
float memf1;
bool memf2;
int memf3;
float2 memfloat2a;
float2x2 m22[7];
} ablock;
cbuffer namelessdead {
int a;
};
cbuffer namedDead {
int b;
} bblock;
struct N1 {
float a;
};
struct N2 {
float b;
float c;
float d;
};
struct N3 {
N1 n1;
N2 n2;
};
cbuffer nested {
N3 foo;
} nest;
struct TS {
int a;
int dead;
};
uniform TS s;
uniform float uf1;
uniform float uf2;
uniform float ufDead3;
uniform float ufDead4;
uniform float2x2 dm22[10];
struct deep1 {
float2 va[3];
bool b;
};
struct deep2 {
int i;
deep1 d1[4];
};
struct deep3 {
float4 iv4;
deep2 d2;
int3 v3;
};
uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2];
const bool control = true;
void deadFunction()
{
float3 v3 = ablock.deadMember1;
float4 v = anonDeadMember2;
float f = ufDead4;
}
void liveFunction2()
{
float3 v = anonMember1;
float f = uf1;
}
tbuffer abl {
float foo;
} arrBl;
tbuffer abl2 {
float foo;
} arrBl2;
void flizv(in float attributeFloat, in float2 attributeFloat2, in float3 attributeFloat3, in float4 attributeFloat4, in float4x4 attributeMat4)
{
liveFunction2();
if (! control)
deadFunction();
float f;
int i;
if (control) {
liveFunction2();
f = anonMember3.z;
f = s.a;
f = ablock.scalar;
f = m23[1].y + scalarAfterm23;
f = c_m23[1].y + c_scalarAfterm23;
f += scalarBeforeArray;
f += floatArray[2];
f += floatArray[4];
f += scalarAfterArray;
f += ablock.memfloat2.x;
f += ablock.memf1;
f += float(ablock.memf2);
f += ablock.memf3;
f += ablock.memfloat2a.y;
f += ablock.m22[i][1][0];
f += dm22[3][0][1];
f += m22[2][1].y;
f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d;
f += deepA[i].d2.d1[2].va[1].x;
f += deepB[1].d2.d1[i].va[1].x;
f += deepB[i].d2.d1[i].va[1].x;
deep3 d = deepC[1];
deep3 da[2] = deepD;
} else
f = ufDead3;
f += arrBl.foo + arrBl.foo;
f += arrBl2.foo;
f += attributeFloat;
f += attributeFloat2.x;
f += attributeFloat3.x;
f += attributeFloat4.x;
f += attributeMat4[0][1];
}