-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
8 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ a array length 3 | |
b array length 2 | ||
[0] = (9 9 9) | ||
[1] = (1 2.3 4) | ||
c array length 1 | ||
[0] = (0 0 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters