aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <[email protected]>2013-11-13 14:02:12 -0700
committerIan Romanick <[email protected]>2014-01-20 11:29:42 -0800
commita9c73fb778a41b422a811c67b4aba806d4dfb7c8 (patch)
tree1ee48d66f17021d2c33030a0e1d93caa10b89e87 /src/mesa/state_tracker
parent1f59e963b40a260d3087f83799de0a6fb0941d07 (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/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c2
-rw-r--r--src/mesa/state_tracker/st_atom_scissor.c14
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c2
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c10
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c2
5 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index ca227dcfafc..a4f3ffee324 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -223,7 +223,7 @@ static void update_raster_state( struct st_context *st )
raster->multisample = ctx->Multisample._Enabled;
/* _NEW_SCISSOR */
- raster->scissor = ctx->Scissor.Enabled;
+ raster->scissor = ctx->Scissor.EnableFlags;
/* _NEW_FRAG_CLAMP */
raster->clamp_fragment_color = !st->clamp_frag_color_in_shader &&
diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
index 539c423ebc8..a1f72da47e0 100644
--- a/src/mesa/state_tracker/st_atom_scissor.c
+++ b/src/mesa/state_tracker/st_atom_scissor.c
@@ -53,15 +53,15 @@ update_scissor( struct st_context *st )
scissor.maxx = fb->Width;
scissor.maxy = fb->Height;
- if (ctx->Scissor.Enabled) {
+ if (ctx->Scissor.EnableFlags & 1) {
/* need to be careful here with xmax or ymax < 0 */
- GLint xmax = MAX2(0, ctx->Scissor.X + ctx->Scissor.Width);
- GLint ymax = MAX2(0, ctx->Scissor.Y + ctx->Scissor.Height);
+ GLint xmax = MAX2(0, ctx->Scissor.ScissorArray[0].X + ctx->Scissor.ScissorArray[0].Width);
+ GLint ymax = MAX2(0, ctx->Scissor.ScissorArray[0].Y + ctx->Scissor.ScissorArray[0].Height);
- if (ctx->Scissor.X > (GLint)scissor.minx)
- scissor.minx = ctx->Scissor.X;
- if (ctx->Scissor.Y > (GLint)scissor.miny)
- scissor.miny = ctx->Scissor.Y;
+ if (ctx->Scissor.ScissorArray[0].X > (GLint)scissor.minx)
+ scissor.minx = ctx->Scissor.ScissorArray[0].X;
+ if (ctx->Scissor.ScissorArray[0].Y > (GLint)scissor.miny)
+ scissor.miny = ctx->Scissor.ScissorArray[0].Y;
if (xmax < (GLint) scissor.maxx)
scissor.maxx = xmax;
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 487a46164d7..874ff77b50c 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -457,7 +457,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
cso_save_aux_vertex_buffer_slot(cso);
/* rasterizer state: just scissor */
- st->bitmap.rasterizer.scissor = ctx->Scissor.Enabled;
+ st->bitmap.rasterizer.scissor = ctx->Scissor.EnableFlags & 1;
cso_set_rasterizer(cso, &st->bitmap.rasterizer);
/* fragment shader state: TEX lookup program */
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 28f9c83d5d3..97cc5a232ca 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -364,11 +364,11 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers)
static INLINE GLboolean
is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
{
- return ctx->Scissor.Enabled &&
- (ctx->Scissor.X > 0 ||
- ctx->Scissor.Y > 0 ||
- (unsigned) ctx->Scissor.Width < rb->Width ||
- (unsigned) ctx->Scissor.Height < rb->Height);
+ return (ctx->Scissor.EnableFlags & 1) &&
+ (ctx->Scissor.ScissorArray[0].X > 0 ||
+ ctx->Scissor.ScissorArray[0].Y > 0 ||
+ (unsigned) ctx->Scissor.ScissorArray[0].Width < rb->Width ||
+ (unsigned) ctx->Scissor.ScissorArray[0].Height < rb->Height);
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 72cc9fa549b..4e79511d606 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -713,7 +713,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
rasterizer.half_pixel_center = 1;
rasterizer.bottom_edge_rule = 1;
rasterizer.depth_clip = !ctx->Transform.DepthClamp;
- rasterizer.scissor = ctx->Scissor.Enabled;
+ rasterizer.scissor = ctx->Scissor.EnableFlags;
cso_set_rasterizer(cso, &rasterizer);
}