i965: Allow viewport array extensions with allow_higher_compat_version
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 13 Oct 2020 01:13:19 +0000 (18:13 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 15 Oct 2020 16:02:19 +0000 (09:02 -0700)
Also fix the obtuse comment.  I had to dig back through the commit logs
to find the real issue.  GL_ARB_viewport_array requires geometry
shaders, and in i965 the only way to have that is with a 3.2+ Core
profile context... or use allow_higher_compat_version.

This increases the maximum Compatibility profile version from 4.0 to 4.6
(on supported hardware) when the allow_higher_compat_version option is
used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7118>

src/mesa/drivers/dri/i965/intel_extensions.c

index ce2989f..e93e727 100644 (file)
@@ -220,10 +220,12 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.EXT_disjoint_timer_query =
          ctx->Extensions.ARB_timer_query;
 
-      /* Only enable this in core profile because other parts of Mesa behave
-       * slightly differently when the extension is enabled.
+      /* Only enable this in core profile because geometry shaders are
+       * required, and Mesa only supports geometry shaders in OpenGL 3.2 and
+       * later.  In this driver, that currently means Core profile.
        */
-      if (ctx->API == API_OPENGL_CORE) {
+      if (ctx->API == API_OPENGL_CORE ||
+          ctx->Const.AllowHigherCompatVersion) {
          ctx->Extensions.ARB_shader_viewport_layer_array = true;
          ctx->Extensions.ARB_viewport_array = true;
          ctx->Extensions.AMD_vertex_shader_viewport_index = true;