浏览代码

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 <samuel.pitoiset@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
tags/17.3-branchpoint
Samuel Pitoiset 8 年前
父节点
当前提交
af45b8159c
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      src/mesa/main/viewport.c

+ 4
- 3
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);

正在加载...
取消
保存