From 4807a83da0e0f5e3272e85504ee3b2213ef1910a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 4 Nov 2016 11:40:10 +1100 Subject: mesa/glsl: set num_textures per stage directly in shader_info Reviewed-by: Eric Anholt --- src/compiler/glsl/glsl_to_nir.cpp | 1 - src/compiler/glsl/link_uniforms.cpp | 2 +- src/compiler/glsl/linker.cpp | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/compiler/glsl') diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index cf3511e10b9..6cf4f501ee8 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -149,7 +149,6 @@ glsl_to_nir(const struct gl_shader_program *shader_prog, shader->info->name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name); if (shader_prog->Label) shader->info->label = ralloc_strdup(shader, shader_prog->Label); - shader->info->num_textures = util_last_bit(sh->Program->SamplersUsed); shader->info->clip_distance_array_size = sh->Program->ClipDistanceArraySize; shader->info->cull_distance_array_size = sh->Program->CullDistanceArraySize; shader->info->has_transform_feedback_varyings = diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index caee147aa1d..f2fc7161f10 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -1315,7 +1315,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog, uniform_size.process(var); } - sh->num_samplers = uniform_size.num_shader_samplers; + sh->Program->info.num_textures = uniform_size.num_shader_samplers; sh->NumImages = uniform_size.num_shader_images; sh->num_uniform_components = uniform_size.num_shader_uniform_components; sh->num_combined_uniform_components = sh->num_uniform_components; diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 327b7be8006..d4a484fdea0 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -3067,7 +3067,8 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) if (sh == NULL) continue; - if (sh->num_samplers > ctx->Const.Program[i].MaxTextureImageUnits) { + if (sh->Program->info.num_textures > + ctx->Const.Program[i].MaxTextureImageUnits) { linker_error(prog, "Too many %s shader texture samplers\n", _mesa_shader_stage_to_string(i)); } -- cgit v1.2.3