[Mesa-dev] [PATCH] st/mesa: avoid vertex texture update for 0 case
Dave Airlie
airlied at gmail.com
Tue Feb 7 08:17:06 PST 2012
From: Dave Airlie <airlied at redhat.com>
If we had no vertex textures previously and we have none now,
don't bother doing the enables dance.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/mesa/state_tracker/st_atom_texture.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 88e6128..1b82283 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -260,6 +260,9 @@ update_vertex_textures(struct st_context *st)
struct gl_vertex_program *vprog = ctx->VertexProgram._Current;
GLuint su;
+ if (!vprog->Base.SamplersUsed && st->state.num_vertex_textures == 0)
+ return;
+
st->state.num_vertex_textures = 0;
/* loop over sampler units (aka tex image units) */
--
1.7.6.5
More information about the mesa-dev
mailing list