GLSL Std140 and Std430 Layout Calculator

by Jack Jamison



Instructions

Write your declarations on the left, get your output on the right. For the most part, you can paste in GLSL code.

You can define structs and uniform blocks with the syntax "#uniform name" or "#struct name".

About

This tool was made because tons of resources online about GLSL alignment are wrong, such as this one.

For detailed rules, read the OpenGL spec, pages 146-147
Source code