summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-11 17:29:53 +0200
committerSamuel Pitoiset <[email protected]>2017-06-14 10:04:36 +0200
commit70f2573103298b0bc6857a3d5d372ca9c1cede97 (patch)
treec14947a39785ff98657c19f870f96f7bd5318ce8 /src/mesa/main/uniforms.c
parent9eaad42c58590498a692677d1932a5a83c7b2a05 (diff)
mesa: update textures for bindless samplers bound to texture units
This is analogous to the existing SamplerUnits and SamplerTargets, but it loops over bindless samplers bound to texture units. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 6706f794d7e..91c3bf66f8d 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -105,18 +105,33 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
gl_shader_stage prog_stage =
_mesa_program_enum_to_shader_stage(prog->Target);
struct gl_linked_shader *shader = shProg->_LinkedShaders[prog_stage];
+ GLuint s;
assert(shader);
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
while (mask) {
- const int s = u_bit_scan(&mask);
+ s = u_bit_scan(&mask);
update_single_shader_texture_used(shProg, prog,
prog->SamplerUnits[s],
prog->sh.SamplerTargets[s]);
}
+
+ if (unlikely(prog->sh.HasBoundBindlessSampler)) {
+ /* Loop over bindless samplers bound to texture units.
+ */
+ for (s = 0; s < prog->sh.NumBindlessSamplers; s++) {
+ struct gl_bindless_sampler *sampler = &prog->sh.BindlessSamplers[s];
+
+ if (!sampler->bound)
+ continue;
+
+ update_single_shader_texture_used(shProg, prog, sampler->unit,
+ sampler->target);
+ }
+ }
}
/**