diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_state.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index f31b271500f..f9aecba2327 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -34,6 +34,7 @@ #include "main/dd.h" #include "main/state.h" #include "main/stencil.h" +#include "main/viewport.h" #include "tnl/tnl.h" #include "tnl/t_context.h" @@ -401,26 +402,17 @@ void intelCalcViewport(struct gl_context * ctx) { struct intel_context *intel = intel_context(ctx); + double scale[3], translate[3]; + + _mesa_get_viewport_xform(ctx, 0, scale, translate); if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) { - _math_matrix_viewport(&intel->ViewportMatrix, - ctx->ViewportArray[0].X, - ctx->DrawBuffer->Height - ctx->ViewportArray[0].Y, - ctx->ViewportArray[0].Width, - -ctx->ViewportArray[0].Height, - ctx->ViewportArray[0].Near, - ctx->ViewportArray[0].Far, - 1.0); - } else { - _math_matrix_viewport(&intel->ViewportMatrix, - ctx->ViewportArray[0].X, - ctx->ViewportArray[0].Y, - ctx->ViewportArray[0].Width, - ctx->ViewportArray[0].Height, - ctx->ViewportArray[0].Near, - ctx->ViewportArray[0].Far, - 1.0); + scale[1] = -scale[1]; + translate[1] = ctx->DrawBuffer->Height - translate[1]; } + + _math_matrix_viewport(&intel->ViewportMatrix, + scale, translate, 1.0); } |