i965/icl: Disable binding table prefetching
[mesa.git] / src / mesa / main / getstring.c
index 4c805ca4d5120af7d7c5712bd317827a19b49de0..3d5ae0b694b4cac8faf9477d3a28095137e9245e 100644 (file)
@@ -32,6 +32,7 @@
 #include "extensions.h"
 #include "mtypes.h"
 #include "macros.h"
+#include "version.h"
 
 /**
  * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
@@ -143,6 +144,8 @@ _mesa_GetString( GLenum name )
             _mesa_error(ctx, GL_INVALID_ENUM, "glGetString(GL_EXTENSIONS)");
             return (const GLubyte *) 0;
          }
+         if (!ctx->Extensions.String)
+            ctx->Extensions.String = _mesa_make_extension_string(ctx);
          return (const GLubyte *) ctx->Extensions.String;
       case GL_SHADING_LANGUAGE_VERSION:
          if (ctx->API == API_OPENGLES)
@@ -184,6 +187,25 @@ _mesa_GetStringi(GLenum name, GLuint index)
          return (const GLubyte *) 0;
       }
       return _mesa_get_enabled_extension(ctx, index);
+   case GL_SHADING_LANGUAGE_VERSION:
+      {
+         char *version;
+         int num;
+         if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 43) {
+            _mesa_error(ctx, GL_INVALID_ENUM,
+                        "glGetStringi(GL_SHADING_LANGUAGE_VERSION): "
+                        "supported only in GL4.3 and later");
+            return (const GLubyte *) 0;
+         }
+         num = _mesa_get_shading_language_version(ctx, index, &version);
+         if (index >= num) {
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glGetStringi(GL_SHADING_LANGUAGE_VERSION, index=%d)",
+                        index);
+            return (const GLubyte *) 0;
+         }
+         return (const GLubyte *) version;
+      }
    default:
       _mesa_error(ctx, GL_INVALID_ENUM, "glGetStringi");
       return (const GLubyte *) 0;