From 3069b5380459fadccd7aa2949017b191b4eb3ecf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 20 May 2018 00:15:31 +0200 Subject: [PATCH] - disable shader storage blocks if none get reported for vertex shaders. --- src/gl_load/gl_interface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gl_load/gl_interface.cpp b/src/gl_load/gl_interface.cpp index ee47ce5a00..6e07259f5f 100644 --- a/src/gl_load/gl_interface.cpp +++ b/src/gl_load/gl_interface.cpp @@ -238,7 +238,12 @@ void gl_LoadExtensions() // Intel's GLSL compiler is a bit broken with extensions, so unlock the feature only if not on Intel or having GL 4.3. if (strstr(gl.vendorstring, "Intel") == NULL || gl_version >= 4.3f) { - gl.flags |= RFL_SHADER_STORAGE_BUFFER; + // Mesa implements shader storage only for fragment shaders. + // Just disable the feature there. The light buffer may just use a uniform buffer without any adverse effects. + int v; + glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &v); + if (v > 0) + gl.flags |= RFL_SHADER_STORAGE_BUFFER; } } gl.flags |= RFL_BUFFER_STORAGE;