i965/gen8+: Enable GL_OES_viewport_array
authorAnuj Phogat <anuj.phogat@gmail.com>
Tue, 27 Sep 2016 19:28:39 +0000 (12:28 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 4 Oct 2016 20:20:34 +0000 (13:20 -0700)
This patch causes 2 regressions in khronos' gles cts tests
on various intel platforms.
Failing tests:
ES3-CTS.functional.state_query.integers.viewport_getinteger
ES3-CTS.functional.state_query.integers.viewport_getfloat

Here is an explanation of what's causing the failures:

CTS tests are not clamping the x, y location of the viewport's
bottom-left corner as recommended by ARB_viewport_array and
OES_viewport_array:
"The location of the viewport's bottom-left corner, given by (x,y), are
 clamped to be within the implementation-dependent viewport bounds range.
 The viewport bounds range [min, max] tuple may be determined by
 calling GetFloatv with the symbolic constant VIEWPORT_BOUNDS_RANGE_OES"

Khronos CTS merge request to fix the test case:
https://gitlab.khronos.org/opengl/cts/merge_requests/399

V2: Initialize the relevant variables for GL_OES_viewport_array on gen8+

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_extensions.c

index b0eec16..db63d92 100644 (file)
@@ -776,8 +776,9 @@ brw_initialize_context_constants(struct brw_context *brw)
       ctx->Const.MaxViewportHeight = 32768;
    }
 
-   /* ARB_viewport_array */
-   if (brw->gen >= 6 && ctx->API == API_OPENGL_CORE) {
+   /* ARB_viewport_array, OES_viewport_array */
+   if ((brw->gen >= 6 && ctx->API == API_OPENGL_CORE) ||
+       (brw->gen >= 8  && ctx->API == API_OPENGLES2)) {
       ctx->Const.MaxViewports = GEN6_NUM_VIEWPORTS;
       ctx->Const.ViewportSubpixelBits = 0;
 
index 93eb966..53bd7cc 100644 (file)
@@ -404,6 +404,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_ES3_2_compatibility = true;
       ctx->Extensions.OES_geometry_shader = true;
       ctx->Extensions.OES_texture_cube_map_array = true;
+      ctx->Extensions.OES_viewport_array = true;
    }
 
    if (brw->gen >= 9) {