summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-09 10:00:09 +1100
committerTimothy Arceri <[email protected]>2017-01-06 11:21:42 +1100
commit937523971f42f37b40badb962e575ecd8258b2d5 (patch)
treef48bafe2f5916336dfcdb63a1bc8ba34cb277003
parent53a509723ff10ae1494e611de3823f17b7e9f225 (diff)
st/mesa/glsl: set SamplersUsed directly in gl_program
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/compiler/glsl/link_uniforms.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp1
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/program/ir_to_mesa.cpp1
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp1
5 files changed, 3 insertions, 6 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index f2fc7161f10..8604dba4b07 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -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) ==
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index efb2ac33ca7..d2f2dd6f870 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -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);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d05c25205ce..6ab5cdeec4e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -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);
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 0089e80faa3..59aef12b1e3 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -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);
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index cbc7e5a693d..d5309e49fab 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -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);