HLSL: allow multi-dimensional arrays
All the underpinnings are there; this just parses multiple array dimensions and passes them through to the existing mechanisms. Also, minor comment fixes, and add a new test for multi-dim arrays.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
|
||||
// implicit sized array
|
||||
// array size from initializer
|
||||
static float g_array [ ] = { 1, 2, 3, 4, 5 };
|
||||
|
||||
// Unused implicit sized array
|
||||
// Unused: array size from initializer
|
||||
static float g_array_unused [ ] = { 1, 2, 3, 4, 5, 6, 7 };
|
||||
|
||||
// Test implicit size arrayed structs
|
||||
// Test initializer sizing for arrayed structs
|
||||
static struct mystruct {
|
||||
int i;
|
||||
float f;
|
||||
@@ -24,7 +24,7 @@ struct PS_OUTPUT { float4 color : SV_Target0; };
|
||||
|
||||
void main(out PS_OUTPUT ps_output)
|
||||
{
|
||||
// implicit sized local array
|
||||
// local array sized from initializers
|
||||
float l_array[] = { 1, 2, 3 };
|
||||
|
||||
ps_output.color = g_array[0] + g_array[4] + l_array[1] + g_mystruct[0].f + g_array[idx];
|
||||
|
||||
Reference in New Issue
Block a user