mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
st/mesa: avoid vertex texture and sampler updates for 0 case
If we had no vertex textures or samplers previously and we have none now, don't bother doing the enables dance. I was profiling nexuiz on noop and noticed these two functions in the profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03% for texture and samplers. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
33f4461ec9
commit
833a33bf6e
2 changed files with 5 additions and 0 deletions
|
|
@ -201,6 +201,8 @@ update_vertex_samplers(struct st_context *st)
|
|||
struct gl_vertex_program *vprog = ctx->VertexProgram._Current;
|
||||
GLuint su;
|
||||
|
||||
if (st->state.num_vertex_samplers == 0 && vprog->Base.SamplersUsed == 0)
|
||||
return;
|
||||
st->state.num_vertex_samplers = 0;
|
||||
|
||||
/* loop over sampler units (aka tex image units) */
|
||||
|
|
|
|||
|
|
@ -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) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue