From 5100d0b9959bb8a233cb09557356e5daaf4c7fc2 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Sat, 4 Apr 2020 16:19:56 +0200 Subject: [PATCH] UBO: GL_INVALID_ENUM on Mesa --- .../src/main/java/com/jme3/renderer/opengl/GLRenderer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java index 717d0d97e..69a915829 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java @@ -524,7 +524,9 @@ public final class GLRenderer implements Renderer { if (hasExtension("GL_ARB_uniform_buffer_object")) { caps.add(Caps.UniformBufferObject); limits.put(Limits.UniformBufferObjectMaxBlockSize, getInteger(GL3.GL_MAX_UNIFORM_BLOCK_SIZE)); - limits.put(Limits.UniformBufferObjectMaxGeometryBlocks, getInteger(GL3.GL_MAX_GEOMETRY_UNIFORM_BLOCKS)); + if (hasExtension("GL_ARB_geometry_shader_4") || caps.contains(Caps.OpenGL32)) { + limits.put(Limits.UniformBufferObjectMaxGeometryBlocks, getInteger(GL3.GL_MAX_GEOMETRY_UNIFORM_BLOCKS)); + } limits.put(Limits.UniformBufferObjectMaxFragmentBlocks, getInteger(GL3.GL_MAX_FRAGMENT_UNIFORM_BLOCKS)); limits.put(Limits.UniformBufferObjectMaxVertexBlocks, getInteger(GL3.GL_MAX_VERTEX_UNIFORM_BLOCKS)); }