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>
}
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;
+ }
}
/**
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))