diff options
author | Courtney Goeltzenleuchter <[email protected]> | 2013-11-13 14:02:12 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-01-20 11:29:42 -0800 |
commit | a9c73fb778a41b422a811c67b4aba806d4dfb7c8 (patch) | |
tree | 1ee48d66f17021d2c33030a0e1d93caa10b89e87 /src/mesa/main/framebuffer.c | |
parent | 1f59e963b40a260d3087f83799de0a6fb0941d07 (diff) |
mesa: Update gl_scissor_attrib to support ARB_viewport_array
Update Mesa and drivers to access updated gl_scissor_attrib.
Now have an enable bitfield and array of gl_scissor_rects.
Drivers have been updated to the new scissor enable state
attribute (gl_context.scissor.EnableFlags) but still treat it
as a single boolean which is okay as mesa will only use
bit 0 when communicating with a driver that does not support
ARB_viewport_array.
v2 (idr): Rebase fixes.
v3 (idr): Small code formatting fix suggsted by Ken.
Signed-off-by: Courtney Goeltzenleuchter <[email protected]>
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r-- | src/mesa/main/framebuffer.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 2fad4588066..f14f7a4877e 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -380,18 +380,19 @@ _mesa_update_draw_buffer_bounds(struct gl_context *ctx) buffer->_Xmax = buffer->Width; buffer->_Ymax = buffer->Height; - if (ctx->Scissor.Enabled) { - if (ctx->Scissor.X > buffer->_Xmin) { - buffer->_Xmin = ctx->Scissor.X; + /* Default to the first scissor as that's always valid */ + if (ctx->Scissor.EnableFlags & 1) { + if (ctx->Scissor.ScissorArray[0].X > buffer->_Xmin) { + buffer->_Xmin = ctx->Scissor.ScissorArray[0].X; } - if (ctx->Scissor.Y > buffer->_Ymin) { - buffer->_Ymin = ctx->Scissor.Y; + if (ctx->Scissor.ScissorArray[0].Y > buffer->_Ymin) { + buffer->_Ymin = ctx->Scissor.ScissorArray[0].Y; } - if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) { - buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width; + if (ctx->Scissor.ScissorArray[0].X + ctx->Scissor.ScissorArray[0].Width < buffer->_Xmax) { + buffer->_Xmax = ctx->Scissor.ScissorArray[0].X + ctx->Scissor.ScissorArray[0].Width; } - if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) { - buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height; + if (ctx->Scissor.ScissorArray[0].Y + ctx->Scissor.ScissorArray[0].Height < buffer->_Ymax) { + buffer->_Ymax = ctx->Scissor.ScissorArray[0].Y + ctx->Scissor.ScissorArray[0].Height; } /* finally, check for empty region */ if (buffer->_Xmin > buffer->_Xmax) { |