O'Reilly logo

OpenGL® Programming Guide: The Official Guide to Learning OpenGL®, Version 4.5 with SPIR-V, Ninth Edition by Dave Shreiner, Graham Sellers, John Kessenich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix H. Buffer Object Layouts

This appendix describes ways to deterministically lay out buffers that are shared among multiple readers or writers. It has the following major sections:

• “Using Standard Layout Qualifiers

• “The std140 Layout Rules

• “The std430 Layout Rules

Using Standard Layout Qualifiers

When you group a number of variables in a uniform buffer or shader storage buffer, and you want to read or write their values outside a shader, you need to know the offset of each one. You can query these offsets, but for large collections of uniforms, this process requires many queries and is cumbersome. As an alternative, the standard layout qualifiers request that the GLSL shader compiler organize the variables according to a set ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required