summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/viewport.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-31 21:43:06 +0200
committerSamuel Pitoiset <[email protected]>2017-08-01 09:50:14 +0200
commitaf45b8159cf5b9c15000e4221af6dc4cb85bd05e (patch)
treeaf835ac84cbea81067b1ed2455f046cc42869223 /src/mesa/main/viewport.c
parent5281e4ed3b2ee25627517c23708bb02857ec5992 (diff)
mesa: fix bad cast conversions in viewport()
Fixes: ddc32537d6 ("mesa: clamp viewport values only once when using glViewport()") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101981 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101989 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa/main/viewport.c')
-rw-r--r--src/mesa/main/viewport.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 3dce320d1d0..fc384909e63 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -94,9 +94,10 @@ static void
viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width,
GLsizei height)
{
+ struct gl_viewport_inputs input = { x, y, width, height };
+
/* Clamp the viewport to the implementation dependent values. */
- clamp_viewport(ctx, (GLfloat *)&x, (GLfloat *)&y,
- (GLfloat *)&width, (GLfloat *)&height);
+ clamp_viewport(ctx, &input.X, &input.Y, &input.Width, &input.Height);
/* The GL_ARB_viewport_array spec says:
*
@@ -110,7 +111,7 @@ viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width,
* signal the driver once at the end.
*/
for (unsigned i = 0; i < ctx->Const.MaxViewports; i++)
- set_viewport_no_notify(ctx, i, x, y, width, height);
+ set_viewport_no_notify(ctx, i, input.X, input.Y, input.Width, input.Height);
if (ctx->Driver.Viewport)
ctx->Driver.Viewport(ctx);