From ae632afe4fd860f016d2e5b360d66dc4e72ce72a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 9 Nov 2016 13:35:11 +1100 Subject: st/mesa/glsl: set num_images directly in shader_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change also removes the now duplicate NumImages field. Reviewed-by: Nicolai Hähnle --- src/mesa/main/mtypes.h | 7 ------- src/mesa/main/shaderapi.c | 1 - src/mesa/state_tracker/st_atom_image.c | 12 ++++++------ src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 ++-- 4 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 691323d8f3c..793a527cb45 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2382,13 +2382,6 @@ struct gl_linked_shader struct exec_list *fragdata_arrays; struct glsl_symbol_table *symbols; - /** - * Number of image uniforms defined in the shader. It specifies - * the number of valid elements in the \c ImageUnits and \c - * ImageAccess arrays. - */ - GLuint NumImages; - struct gl_shader_info info; }; diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 7771b7ce7da..e67dc52c156 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2175,7 +2175,6 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src, struct gl_program *dst = dst_sh->Program; - dst->info.num_images = dst_sh->NumImages; dst->info.separate_shader = src->SeparateShader; switch (dst_sh->Stage) { diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c index b30006a143c..2fb37f5b0c6 100644 --- a/src/mesa/state_tracker/st_atom_image.c +++ b/src/mesa/state_tracker/st_atom_image.c @@ -57,7 +57,7 @@ st_bind_images(struct st_context *st, struct gl_linked_shader *shader, c = &st->ctx->Const.Program[shader->Stage]; - for (i = 0; i < shader->NumImages; i++) { + for (i = 0; i < shader->Program->info.num_images; i++) { struct gl_image_unit *u = &st->ctx->ImageUnits[shader->Program->sh.ImageUnits[i]]; struct st_texture_object *stObj = st_texture_object(u->TexObj); @@ -118,14 +118,14 @@ st_bind_images(struct st_context *st, struct gl_linked_shader *shader, } } } - cso_set_shader_images(st->cso_context, shader_type, 0, shader->NumImages, - images); + cso_set_shader_images(st->cso_context, shader_type, 0, + shader->Program->info.num_images, images); /* clear out any stale shader images */ - if (shader->NumImages < c->MaxImageUniforms) + if (shader->Program->info.num_images < c->MaxImageUniforms) cso_set_shader_images( st->cso_context, shader_type, - shader->NumImages, - c->MaxImageUniforms - shader->NumImages, + shader->Program->info.num_images, + c->MaxImageUniforms - shader->Program->info.num_images, NULL); } diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 12a53ecb73d..5de125897f8 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6370,7 +6370,7 @@ st_translate_program( if (program->use_shared_memory) t->shared_memory = ureg_DECL_memory(ureg, TGSI_MEMORY_TYPE_SHARED); - for (i = 0; i < program->shader->NumImages; i++) { + for (i = 0; i < program->shader->Program->info.num_images; i++) { if (program->images_used & (1 << i)) { t->images[i] = ureg_DECL_image(ureg, i, program->image_targets[i], @@ -6639,7 +6639,7 @@ set_affected_state_flags(uint64_t *states, if (prog->info.num_textures) *states |= new_sampler_views | new_samplers; - if (shader->NumImages) + if (prog->info.num_images) *states |= new_images; if (prog->info.num_ubos) -- cgit v1.2.3