Quick answer: GLSL uniform blocks reading wrong data on AMD GPUs? AMD drivers don’t reliably auto-assign unique binding points — declare layout(binding = N) explicitly.
A renderer with multiple UBOs works on NVIDIA, mixes data on AMD. The driver assigned two UBOs to the same binding.
Explicit Binding Index
layout(std140, binding = 0) uniform Camera { ... };
layout(std140, binding = 1) uniform Light { ... };Each UBO declares a binding number. Driver respects it. No overlap possible.
Bind Buffer to Index
Match in C++: glBindBufferBase(GL_UNIFORM_BUFFER, 0, cameraBuffer);. Binding index must align with the shader’s layout declaration.
STD140 Layout
Use std140 for cross-vendor consistent layout. Tighter std430 can have AMD-specific alignment quirks; safer to default std140.
Validate on Multi-Vendor
Test on AMD, NVIDIA, Intel GPUs every release. UBO bugs surface only on specific drivers.
Verifying
Shader reads correct UBO data on every GPU. No mixed-data renderings or vendor-specific bugs.
“Auto-binding varies across drivers. Declare layout(binding = N) explicitly.”
Maintain a small ‘UBO layout’ registry in your codebase — one place defines binding 0 = camera, 1 = light, etc., consistent across all shaders.