i965 gs: Move vue_map to brw_gs_compile.
authorPaul Berry <stereotype441@gmail.com>
Wed, 7 Dec 2011 15:14:56 +0000 (07:14 -0800)
committerPaul Berry <stereotype441@gmail.com>
Tue, 20 Dec 2011 22:32:16 +0000 (14:32 -0800)
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@whitecape.org>
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_gs.h

index 69ffa19c40c1be1375ee206049cc46d7b2f263ae..f5d5898e04bd24d5eb1f1de92cb89c4ff646f000 100644 (file)
@@ -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;
    
index abcb0b2db5979cd6dfb402e6ca2566beabf80dfe..ecab3ef37fad4e78f63b2f997570e3f85de3fe1b 100644 (file)
@@ -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)