[Mesa-dev] [PATCH 2/3] mesa/main: Remove enabled_units from ff cache key.
Gustaw Smolarczyk
wielkiegie at gmail.com
Mon Mar 27 17:24:14 UTC 2017
Its only usage is easily replaced by nr_enabled_units. As for cache key
part, unit[i].enabled should be enough.
Signed-off-by: Gustaw Smolarczyk <wielkiegie at gmail.com>
---
src/mesa/main/ff_fragment_shader.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 8af7d1cfb7..75189733ba 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -101,7 +101,6 @@ struct mode_opt {
struct state_key {
GLuint nr_enabled_units:8;
- GLuint enabled_units:8;
GLuint separate_specular:1;
GLuint fog_mode:2; /**< FOG_x */
GLuint inputs_available:12;
@@ -421,7 +420,6 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
format = _mesa_texture_base_format(texObj);
key->unit[i].enabled = 1;
- key->enabled_units |= (1<<i);
key->nr_enabled_units = i + 1;
inputs_referenced |= VARYING_BIT_TEX(i);
@@ -1136,7 +1134,7 @@ emit_instructions(texenv_fragment_program *p)
struct state_key *key = p->state;
GLuint unit;
- if (key->enabled_units) {
+ if (key->nr_enabled_units) {
/* First pass - to support texture_env_crossbar, first identify
* all referenced texture sources and emit texld instructions
* for each:
--
2.12.1
More information about the mesa-dev
mailing list