Mesa (i965g-restart): i965g: hook vertex state emit up to PIPE_NEW_VERTEX_BUFFER

Keith Whitwell keithw at kemper.freedesktop.org
Mon Dec 21 08:59:46 PST 2009


Module: Mesa
Branch: i965g-restart
Commit: 061411b2611634960f0ba36e42916c67918bb53d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=061411b2611634960f0ba36e42916c67918bb53d

Author: Keith Whitwell <keithw at vmware.com>
Date:   Mon Dec 21 16:57:37 2009 +0000

i965g: hook vertex state emit up to PIPE_NEW_VERTEX_BUFFER

---

 src/gallium/drivers/i965/brw_context.h     |    2 +-
 src/gallium/drivers/i965/brw_draw.c        |    7 ++++++-
 src/gallium/drivers/i965/brw_draw_upload.c |    5 +++--
 src/gallium/drivers/i965/brw_state_debug.c |    1 -
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h
index b7330f0..143e068 100644
--- a/src/gallium/drivers/i965/brw_context.h
+++ b/src/gallium/drivers/i965/brw_context.h
@@ -257,7 +257,7 @@ struct brw_sampler {
 #define BRW_NEW_WM_SURFACES		0x1000
 #define BRW_NEW_xxx                     0x2000 /* was FENCE */
 #define BRW_NEW_INDICES			0x4000
-#define BRW_NEW_VERTICES		0x8000
+
 /**
  * Used for any batch entry with a relocated pointer that will be used
  * by any 3D rendering.  Need to re-emit these fresh in each
diff --git a/src/gallium/drivers/i965/brw_draw.c b/src/gallium/drivers/i965/brw_draw.c
index 45d5ade..4498773 100644
--- a/src/gallium/drivers/i965/brw_draw.c
+++ b/src/gallium/drivers/i965/brw_draw.c
@@ -92,6 +92,10 @@ static int brw_emit_prim(struct brw_context *brw,
    struct brw_3d_primitive prim_packet;
    int ret;
 
+   if (BRW_DEBUG & DEBUG_PRIMS)
+      debug_printf("%s start %d count %d indexed %d hw_prim %d\n",
+                   __FUNCTION__, start, count, indexed, hw_prim); 
+
    prim_packet.header.opcode = CMD_3D_PRIM;
    prim_packet.header.length = sizeof(prim_packet)/4 - 2;
    prim_packet.header.pad = 0;
@@ -187,7 +191,8 @@ brw_draw_range_elements(struct pipe_context *pipe,
    hw_prim = brw_set_prim(brw, mode);
 
    if (BRW_DEBUG & DEBUG_PRIMS)
-      debug_printf("PRIM: %s %d %d\n", u_prim_name(mode), start, count);
+      debug_printf("PRIM: %s start %d count %d index_buffer %p\n",
+                   u_prim_name(mode), start, count, (void *)index_buffer);
 
    /* Potentially trigger upload of new index buffer.
     *
diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c
index f50ce30..a27da5f 100644
--- a/src/gallium/drivers/i965/brw_draw_upload.c
+++ b/src/gallium/drivers/i965/brw_draw_upload.c
@@ -405,8 +405,9 @@ static int brw_emit_vertices( struct brw_context *brw )
 
 const struct brw_tracked_state brw_vertices = {
    .dirty = {
-      .mesa = PIPE_NEW_INDEX_RANGE,
-      .brw = BRW_NEW_BATCH | BRW_NEW_VERTICES,
+      .mesa = (PIPE_NEW_INDEX_RANGE |
+               PIPE_NEW_VERTEX_BUFFER),
+      .brw = BRW_NEW_BATCH,
       .cache = 0,
    },
    .prepare = brw_prepare_vertices,
diff --git a/src/gallium/drivers/i965/brw_state_debug.c b/src/gallium/drivers/i965/brw_state_debug.c
index 050f747..049c278 100644
--- a/src/gallium/drivers/i965/brw_state_debug.c
+++ b/src/gallium/drivers/i965/brw_state_debug.c
@@ -80,7 +80,6 @@ static struct dirty_bit_map brw_bits[] = {
    DEFINE_BIT(BRW_NEW_WM_SURFACES),
    DEFINE_BIT(BRW_NEW_xxx),
    DEFINE_BIT(BRW_NEW_INDICES),
-   DEFINE_BIT(BRW_NEW_VERTICES),
    {0, 0, 0}
 };
 



More information about the mesa-commit mailing list