st/mesa/glsl: set SamplersUsed directly in gl_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 8 Nov 2016 23:00:09 +0000 (10:00 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 6 Jan 2017 00:21:42 +0000 (11:21 +1100)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/link_uniforms.cpp
src/mesa/drivers/dri/i965/brw_link.cpp
src/mesa/main/mtypes.h
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_nir.cpp

index f2fc7161f103b8a6ee47cc3522fe673aabb6d489..8604dba4b0798c115ec06066f695941a259cf84b 100644 (file)
@@ -1244,7 +1244,8 @@ link_assign_uniform_storage(struct gl_context *ctx,
          parcel.set_and_process(var);
       }
 
-      prog->_LinkedShaders[i]->active_samplers = parcel.shader_samplers_used;
+      prog->_LinkedShaders[i]->Program->SamplersUsed =
+         parcel.shader_samplers_used;
       prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers;
 
       STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->SamplerTargets) ==
index efb2ac33ca711fa0b3210d0c7a4e53445974057e..d2f2dd6f8704d078aa3069a72da948b28b386812 100644 (file)
@@ -213,7 +213,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
 
       _mesa_copy_linked_program_data(shProg, shader);
 
-      prog->SamplersUsed = shader->active_samplers;
       prog->ShadowSamplers = shader->shadow_samplers;
       _mesa_update_shader_textures_used(shProg, prog);
 
index d05c25205ce79acd548f3097bf7f7c9e2db6da2a..6ab5cdeec4e72a41b95ae4e6861cd8eb0aecf25a 100644 (file)
@@ -2356,7 +2356,6 @@ struct gl_linked_shader
     * \note Each of these fields is only set post-linking.
     */
    /*@{*/
-   GLbitfield active_samplers; /**< Bitfield of which samplers are used */
    GLbitfield shadow_samplers; /**< Samplers used for shadow sampling. */
    /*@}*/
 
@@ -2396,7 +2395,7 @@ struct gl_linked_shader
 static inline GLbitfield gl_external_samplers(struct gl_linked_shader *shader)
 {
    GLbitfield external_samplers = 0;
-   GLbitfield mask = shader->active_samplers;
+   GLbitfield mask = shader->Program->SamplersUsed;
 
    while (mask) {
       int idx = u_bit_scan(&mask);
index 0089e80faa37d5c6e611e2646a9157d4b50b6e27..59aef12b1e3934b37e3833070292358177b96440 100644 (file)
@@ -2917,7 +2917,6 @@ get_mesa_program(struct gl_context *ctx,
 
    do_set_program_inouts(shader->ir, prog, shader->Stage);
 
-   prog->SamplersUsed = shader->active_samplers;
    prog->ShadowSamplers = shader->shadow_samplers;
    prog->ExternalSamplersUsed = gl_external_samplers(shader);
    _mesa_update_shader_textures_used(shader_program, prog);
index cbc7e5a693d35097ba5571b1985164faceffa0d5..d5309e49fab448a7f33ae2d39c2916729b9facd9 100644 (file)
@@ -412,7 +412,6 @@ st_nir_get_mesa_program(struct gl_context *ctx,
       _mesa_log("\n\n");
    }
 
-   prog->SamplersUsed = shader->active_samplers;
    prog->ShadowSamplers = shader->shadow_samplers;
    prog->ExternalSamplersUsed = gl_external_samplers(shader);
    _mesa_update_shader_textures_used(shader_program, prog);