Files
Larry Gritz 2fa42516b9 Allow shader params with empty brace inits: (#967)
Allow shader params with empty brace inits:

    type myarray[] = {},
    mystruct S = {}

Un-lengthed arrays, if they aren't connected or given a concrete
instance value, still default to length 1 (we don't allow 0-length
arrays, that's a whole other can of worms), but this is now treated as
equivalent to `= { default_value }` (0 for int or float, "" for string).

And it works for structs, too, just means to initialize all the elements
to is obvious (0, "") default values.

It's syntactic sugar, but it removes some clutter for people who want to
have shader parameters that are arrays of undetermined length (and thus
are probably expected to have a runtime-assigned instance value or be
conntected to an output of an earlier layer within the shader group),
removes the requirement for spelling out an initializing value that
won't be used anyway.
2019-05-24 09:37:55 -07:00
..