March 2013
Intermediate to advanced
984 pages
26h 18m
English
GLSL buffer blocks, or from the application’s perspective shader storage buffer objects, operate quite similarly to uniform blocks. Two critical differences give these blocks great power, however. First, the shader can write to them, modifying their content as seen from other shader invocations or the application. Second, their size can be established just before rendering, rather than at compile or link time. For example:
buffer BufferObject { // create a read-writeable buffer int mode; // preamble members vec4 points[]; // last member can be unsized array};
If the array above is not provided a size in the shader, then its size can be established by the application before rendering, ...