GLSL
GLSL copied to clipboard
Add GL_EXT_relaxed_block_layout
This extension is written to support VK_KHR_relaxed_block_layout Vulkan extension. Currently there is only VK_EXT_scalar_block_layout support - GL_EXT_scalar_block_layout. To correct this historical injustice, I present this extension.
If GLSL Working Group approves this extension, then I will create a PR in glslang (link to fully working fork with the extension implementation).
The example of usage GL_EXT_relaxed_block_layout:
#version 460 core
#extension GL_EXT_relaxed_block_layout : require
struct S {
int i; // Struct member offset: 0
vec3 j; // Struct member offset: 4
};
layout(binding = 0, std430, relaxed) buffer SSBO {
int a; // Offset: 0
S s; // Offset: 16 (the base alignment of structure equals to 16)
int b; // Offset: 32 (the size of structure equals to 16)
};
void main() {...}