[Mesa-dev] [PATCH 08/10] i965/vs: Add texture related data to brw_vs_prog_key.

Kenneth Graunke kenneth at whitecape.org
Mon Dec 19 11:09:10 PST 2011


Now that this is all factored out, it's trivial to do.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
 src/mesa/drivers/dri/i965/brw_vs.c |    8 ++++++++
 src/mesa/drivers/dri/i965/brw_vs.h |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)

Unchanged from v1.

diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 81d5f88..6eec973 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -279,8 +279,10 @@ static void brw_upload_vs_prog(struct brw_context *brw)
    struct intel_context *intel = &brw->intel;
    struct gl_context *ctx = &intel->ctx;
    struct brw_vs_prog_key key;
+   /* BRW_NEW_VERTEX_PROGRAM */
    struct brw_vertex_program *vp = 
       (struct brw_vertex_program *)brw->vertex_program;
+   struct gl_program *prog = (struct gl_program *) brw->vertex_program;
    int i;
 
    memset(&key, 0, sizeof(key));
@@ -316,6 +318,12 @@ static void brw_upload_vs_prog(struct brw_context *brw)
       }
    }
 
+   /* _NEW_TEXTURE */
+   for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
+      if (prog->TexturesUsed[i])
+	 brw_populate_sampler_prog_key_data(ctx, &key.tex, i);
+   }
+
    /* BRW_NEW_VERTICES */
    for (i = 0; i < VERT_ATTRIB_MAX; i++) {
       if (vp->program.Base.InputsRead & BITFIELD64_BIT(i) &&
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
index 8701116..8814251 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.h
+++ b/src/mesa/drivers/dri/i965/brw_vs.h
@@ -36,6 +36,7 @@
 
 #include "brw_context.h"
 #include "brw_eu.h"
+#include "brw_program.h"
 #include "program/program.h"
 
 
@@ -76,6 +77,8 @@ struct brw_vs_prog_key {
    GLuint copy_edgeflag:1;
    GLuint point_coord_replace:8;
    GLuint clamp_vertex_color:1;
+
+   struct brw_sampler_prog_key_data tex;
 };
 
 
-- 
1.7.7.3



More information about the mesa-dev mailing list