summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_viewport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_atom_viewport.c')
-rw-r--r--src/mesa/state_tracker/st_atom_viewport.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c
index 27ec2eb033..0b6c34ca2c 100644
--- a/src/mesa/state_tracker/st_atom_viewport.c
+++ b/src/mesa/state_tracker/st_atom_viewport.c
@@ -27,7 +27,6 @@
#include "main/context.h"
-#include "main/colormac.h"
#include "st_context.h"
#include "st_atom.h"
#include "pipe/p_context.h"
@@ -62,9 +61,9 @@ update_viewport( struct st_context *st )
GLfloat x = (GLfloat)ctx->Viewport.X;
GLfloat y = (GLfloat)ctx->Viewport.Y;
GLfloat z = ctx->Viewport.Near;
- GLfloat half_width = (GLfloat)ctx->Viewport.Width / 2.0f;
- GLfloat half_height = (GLfloat)ctx->Viewport.Height / 2.0f;
- GLfloat half_depth = (GLfloat)(ctx->Viewport.Far - ctx->Viewport.Near) / 2.0f;
+ GLfloat half_width = (GLfloat)ctx->Viewport.Width * 0.5f;
+ GLfloat half_height = (GLfloat)ctx->Viewport.Height * 0.5f;
+ GLfloat half_depth = (GLfloat)(ctx->Viewport.Far - ctx->Viewport.Near) * 0.5f;
st->state.viewport.scale[0] = half_width;
st->state.viewport.scale[1] = half_height * yScale;