summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2013-11-13 13:15:19 -0700
committerIan Romanick <ian.d.romanick@intel.com>2014-01-20 11:32:05 -0800
commit7837f425e7242bfc12f3d6d57d343609071ea6aa (patch)
tree32421cddb1a87367822b746af4ee42071db35c7c /src
parentd3ee8ba3469a6c143f5817e35a5200e9c836de32 (diff)
i965: Enable ARB_viewport_array
v2 (idr): Only enable the extension on GEN7+ w/core profile because it requires geometry shaders. v3 (idr): Add some casting to fix setting of ViewportBounds.Min. Negating an unsigned value, then casting to float doesn't do what you might think it does. Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c11
-rw-r--r--src/mesa/drivers/dri/i965/intel_extensions.c6
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 173f95a6adf..d6c41e610cc 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -474,6 +474,17 @@ brw_initialize_context_constants(struct brw_context *brw)
}
ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4 = true;
+
+ /* ARB_viewport_array */
+ if (brw->gen >= 7 && ctx->API == API_OPENGL_CORE) {
+ ctx->Const.MaxViewports = GEN7_NUM_VIEWPORTS;
+ ctx->Const.ViewportSubpixelBits = 0;
+
+ /* Cast to float before negating becuase MaxViewportWidth is unsigned.
+ */
+ ctx->Const.ViewportBounds.Min = -(float)ctx->Const.MaxViewportWidth;
+ ctx->Const.ViewportBounds.Max = ctx->Const.MaxViewportWidth;
+ }
}
/**
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index f3dc82336d8..ab73434437f 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -294,6 +294,12 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_transform_feedback_instanced = true;
ctx->Extensions.ARB_draw_indirect = true;
}
+
+ /* Only enable this in core profile because other parts of Mesa behave
+ * slightly differently when the extension is enabled.
+ */
+ if (ctx->API == API_OPENGL_CORE)
+ ctx->Extensions.ARB_viewport_array = true;
}
if (brw->gen == 5 || can_write_oacontrol(brw))