March 2013
Intermediate to advanced
984 pages
26h 18m
English
Shader variables shared with the application or between stages can be, and sometimes must be, organized into blocks of variables. Uniform variables can be organized into uniform blocks, input and output variables into in and out blocks, and shader storage buffers into buffer blocks.
These all have a similar form. First, we’ll use uniform to demonstrate.
uniform b { // "uniform" or "in" or "out" or "buffer" vec4 v1; // list of variables bool v2; // ...}; // access members as "v1" and "v2"
Or:
uniform b { // "uniform" or "in" or "out" or "buffer" vec4 v1; // list of variables bool v2; // ...} name; // access ...