diff options
author | Timothy Arceri <[email protected]> | 2016-11-04 17:05:22 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-01-06 11:21:42 +1100 |
commit | 53a509723ff10ae1494e611de3823f17b7e9f225 (patch) | |
tree | 807c5bffbfa4027f9c178787709187812c4570bc /src/mesa/main/uniform_query.cpp | |
parent | 7cc61cf706e857e27ea3ce9578b9c480bfbc94a1 (diff) |
mesa/glsl: set sampler units directly in gl_program
Now that we create gl_program earlier there is no need to mess about
copying things to gl_linked_shader then to gl_program.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index ffb20ca2ac1..047d21a85cf 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -866,8 +866,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, bool changed = false; for (int j = 0; j < count; j++) { unsigned unit = uni->opaque[i].index + offset + j; - if (sh->SamplerUnits[unit] != ((unsigned *) values)[j]) { - sh->SamplerUnits[unit] = ((unsigned *) values)[j]; + if (sh->Program->SamplerUnits[unit] != ((unsigned *) values)[j]) { + sh->Program->SamplerUnits[unit] = ((unsigned *) values)[j]; changed = true; } } @@ -879,8 +879,6 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, } struct gl_program *const prog = sh->Program; - assert(sizeof(prog->SamplerUnits) == sizeof(sh->SamplerUnits)); - _mesa_update_shader_textures_used(shProg, prog); if (ctx->Driver.SamplerUniformChange) ctx->Driver.SamplerUniformChange(ctx, prog->Target, prog); @@ -1108,7 +1106,7 @@ _mesa_sampler_uniforms_pipeline_are_valid(struct gl_pipeline_object *pipeline) mask = shader->Program->SamplersUsed; while (mask) { const int s = u_bit_scan(&mask); - GLuint unit = shader->SamplerUnits[s]; + GLuint unit = shader->Program->SamplerUnits[s]; GLuint tgt = shader->SamplerTargets[s]; /* FIXME: Samplers are initialized to 0 and Mesa doesn't do a |