From d45814c925dd6c479cfd383b9b59458fc4359cf7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 7 Dec 2011 03:13:50 -0800 Subject: [PATCH] i965/vs: Add texture related data to brw_vs_prog_key. Now that this is all factored out, it's trivial to do. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt Reviewed-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_vs.c | 8 ++++++++ src/mesa/drivers/dri/i965/brw_vs.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 81d5f884a5a..6eec9730755 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 8701116dd84..8814251a84c 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; }; -- 2.30.2