summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2014-09-21 18:09:21 +0200
committerMathias Fröhlich <[email protected]>2014-10-24 19:21:20 +0200
commit6340e609a354770e04192b9b44e91fb06aab0159 (patch)
treea23faaf3f456f4775efd556e2701ad07021ff1b4 /src/mesa/main/state.c
parent8c7ac377b7a859705479a0b421d1dacc53ca240a (diff)
mesa: Refactor viewport transform computation.
This is for preparation of ARB_clip_control. v3: Add comments. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Froehlich <[email protected]>
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 80287c47062..3dbbfaac76c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -51,6 +51,7 @@
#include "texobj.h"
#include "texstate.h"
#include "varray.h"
+#include "viewport.h"
#include "blend.h"
@@ -281,11 +282,11 @@ update_viewport_matrix(struct gl_context *ctx)
* NOTE: RasterPos uses this.
*/
for (i = 0; i < ctx->Const.MaxViewports; i++) {
+ double scale[3], translate[3];
+
+ _mesa_get_viewport_xform(ctx, i, scale, translate);
_math_matrix_viewport(&ctx->ViewportArray[i]._WindowMap,
- ctx->ViewportArray[i].X, ctx->ViewportArray[i].Y,
- ctx->ViewportArray[i].Width, ctx->ViewportArray[i].Height,
- ctx->ViewportArray[i].Near, ctx->ViewportArray[i].Far,
- depthMax);
+ scale, translate, depthMax);
}
}