summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_misc_state.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-10-23 08:43:26 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-10-23 08:43:26 +0000
commit759facb4d87843f6368fad9c5f20a5b1b3d95055 (patch)
tree434ca5e820db551267789c3de8c9a3a155c9e021 /src/mesa/drivers/dri/i965/brw_misc_state.c
parentb9786cfaae3bd58d8e487846cfa9c251e1246abd (diff)
Emit cliprects in the userspace driver as required, rather than
passing them to the kernel. This works because all drawing commands in the 965 driver are emitted with the lock held and the batchbuffer is always flushed prior to releasing the lock. This allows multiple cliprects to be dealt with, without replaying entire batchbuffers and redundantly re-emitting state.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_misc_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 29296c17e9..6a6c4503c7 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -74,7 +74,6 @@ const struct brw_tracked_state brw_blend_constant_color = {
/***********************************************************************
* Drawing rectangle -- Need for AUB file only.
*/
-
static void upload_drawing_rect(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
@@ -83,13 +82,12 @@ static void upload_drawing_rect(struct brw_context *brw)
int x1, y1;
int x2, y2;
- if (!brw->intel.aub_file)
+ /* If there is a single cliprect, set it here. Otherwise iterate
+ * over them in brw_draw_prim().
+ */
+ if (brw->intel.numClipRects > 1)
return;
- /* Basically calculate a single cliprect for the whole window.
- * Don't bother iterating over cliprects at the moment.
- */
-
x1 = dPriv->x;
y1 = dPriv->y;
x2 = dPriv->x + dPriv->w;
@@ -110,7 +108,10 @@ static void upload_drawing_rect(struct brw_context *brw)
bdr.xorg = dPriv->x;
bdr.yorg = dPriv->y;
- BRW_CACHED_BATCH_STRUCT(brw, &bdr);
+ /* Can't use BRW_CACHED_BATCH_STRUCT because this is also emitted
+ * uncached in brw_draw.c:
+ */
+ BRW_BATCH_STRUCT(brw, &bdr);
}
const struct brw_tracked_state brw_drawing_rect = {