# Khronos Authors - Interface Block (GLSL) (Highlights)

## Metadata
**Review**:: [readwise.io](https://readwise.io/bookreview/40469386)
**Source**:: #from/readwise #from/reader
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[Khronos Authors]]
**Full Title**:: Interface Block (GLSL)
**Category**:: #articles #readwise/articles
**Category Icon**:: 📰
**URL**:: [www.khronos.org](https://www.khronos.org/opengl/wiki/Interface_Block_(GLSL)#Uniform_blocks)
**Host**:: [[www.khronos.org]]
**Highlighted**:: [[2024-05-13]]
**Created**:: [[2024-05-19]]
## Highlights
- So arrays will only match their C/C++ definitions if the type is a multiple of 16 bytes ([View Highlight](https://read.readwise.io/read/01hxrrfyapmq10c8n1cs1390ye)) ^719110356
- **std430**: This layout works like std140, except with a few optimizations in the alignment and strides for arrays and structs of scalars and vector elements (except for vec3 elements, which remain unchanged from std140). Specifically, they are no longer rounded up to a multiple of 16 bytes. So an array of `float`s will match with a C++ array of `float`s. ([View Highlight](https://read.readwise.io/read/01hxrrgjbq9dsfxeqxb62zkmw1)) ^719110509
- Uniform and shader storage blocks have a different set of indices. Uniform block binding indices refer to blocks bound to indices in the GL_UNIFORM_BUFFER indexed target with [glBindBufferRange](https://www.khronos.org/opengl/wiki/GLAPI/glBindBufferRange). Shader storage block binding indices refer to blocks bound to indices in the GL_SHADER_STORAGE_BUFFER target. ([View Highlight](https://read.readwise.io/read/01hxqwww69xpr1qn80fpcdytp6)) ^718966132
- For arrays of blocks, the binding syntax sequentially allocates indices. ([View Highlight](https://read.readwise.io/read/01hxqwx2wh289npsmx6c2bchd9)) ^718966229
<!-- New highlights added November 8, 2024 at 1:50 PM -->
- Note that this layout can *only* be used with shader storage blocks, not uniform blocks. ([View Highlight](https://read.readwise.io/read/01ja5e64qrq5km3fwhd6ah1n1z)) ^798459061