From 584bb3676381a0b0200a197ee91ea39aab27e62c Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Sun, 8 Sep 2024 22:51:41 +0200 Subject: [PATCH] GL3Plus: GLSLShader - need padding when using UBOs --- RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp b/RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp index 2046c11377b..8f80a8c86d7 100644 --- a/RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp +++ b/RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp @@ -524,8 +524,8 @@ namespace Ogre { // increment physical buffer location convertGLUniformtoOgreType(values[1], def); - // GL doesn't pad - def.elementSize = GpuConstantDefinition::getElementSize(def.constType, false); + bool doPadding = block > -1; + def.elementSize = GpuConstantDefinition::getElementSize(def.constType, doPadding); // also allow index based referencing GpuLogicalIndexUse use;