Mesa (master): i965 gs: Move vue_map to brw_gs_compile.

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Dec 20 23:41:21 UTC 2011


Module: Mesa
Branch: master
Commit: 1413f955ebe213037a9d893e0b7391cac4ba3a57
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1413f955ebe213037a9d893e0b7391cac4ba3a57

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Dec  7 07:14:56 2011 -0800

i965 gs: Move vue_map to brw_gs_compile.

This patch stores the geometry shader VUE map from a local variable in
compile_gs_prog() to a field in the brw_gs_compile struct, so that it
will be available while compiling the geometry shader.  This is
necessary in order to support transform feedback on Gen6, because the
Gen6 geometry shader code that supports transform feedback needs to be
able to inspect the VUE map in order to find the correct vertex data
to output.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_gs.c |    5 ++---
 src/mesa/drivers/dri/i965/brw_gs.h |    2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 69ffa19..f5d5898 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -57,9 +57,8 @@ static void compile_gs_prog( struct brw_context *brw,
    
    c.key = *key;
    /* The geometry shader needs to access the entire VUE. */
-   struct brw_vue_map vue_map;
-   brw_compute_vue_map(&vue_map, intel, c.key.userclip_active, c.key.attrs);
-   c.nr_regs = (vue_map.num_slots + 1)/2;
+   brw_compute_vue_map(&c.vue_map, intel, c.key.userclip_active, c.key.attrs);
+   c.nr_regs = (c.vue_map.num_slots + 1)/2;
 
    mem_ctx = NULL;
    
diff --git a/src/mesa/drivers/dri/i965/brw_gs.h b/src/mesa/drivers/dri/i965/brw_gs.h
index abcb0b2..ecab3ef 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.h
+++ b/src/mesa/drivers/dri/i965/brw_gs.h
@@ -66,6 +66,8 @@ struct brw_gs_compile {
 
    /* Number of registers used to store vertex data */
    GLuint nr_regs;
+
+   struct brw_vue_map vue_map;
 };
 
 #define ATTR_SIZE  (4*4)




More information about the mesa-commit mailing list