Files
filament/third_party/glslang/Test/hlsl.array.implicit-size.frag
Romain Guy 9f2592ed9d Update SPIRV libraries (#99)
* Update SPIRV libraries

- Update `spirv-cross`
- Update `spirv-tools`
- Update `glslang`

`spirv-tools` contains a fix for an issue we reported (unnecessary promotions to highp in certain expressions).

* Add SPIRV-Tools dependency to matinfo
2018-08-15 12:59:17 -07:00

33 lines
783 B
GLSL

// array size from initializer
static float g_array [ ] = { 1, 2, 3, 4, 5 };
// Unused: array size from initializer
static float g_array_unused [ ] = { 1, 2, 3, 4, 5, 6, 7 };
// Test initializer sizing for arrayed structs
static struct mystruct {
int i;
float f;
} g_mystruct[] = {
{ 1, 2.0 },
{ 3, 4.0 },
};
struct PS_OUTPUT { float4 color : SV_Target0; };
// INVALID: implicit size requires an initializer expression.
// uniform float bad[];
// INVALID: function parameters cannot be implicitly sized
// void BadFunction(int a[]) { }
void main(out PS_OUTPUT ps_output)
{
// local array sized from initializers
float l_array[] = { 1, 2, 3 };
int idx;
ps_output.color = g_array[0] + g_array[4] + l_array[1] + g_mystruct[0].f + g_array[idx];
}