diff options
author | Samuel Pitoiset <[email protected]> | 2017-05-11 17:29:53 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-14 10:04:36 +0200 |
commit | 70f2573103298b0bc6857a3d5d372ca9c1cede97 (patch) | |
tree | c14947a39785ff98657c19f870f96f7bd5318ce8 /src/mesa/main/texstate.c | |
parent | 9eaad42c58590498a692677d1932a5a83c7b2a05 (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/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 59b96481663..b3411a87ef9 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -704,6 +704,7 @@ update_program_texture_state(struct gl_context *ctx, struct gl_program **prog, for (i = 0; i < MESA_SHADER_STAGES; i++) { GLbitfield mask; + GLuint s; if (!prog[i]) continue; @@ -711,12 +712,27 @@ update_program_texture_state(struct gl_context *ctx, struct gl_program **prog, mask = prog[i]->SamplersUsed; while (mask) { - const int s = u_bit_scan(&mask); + s = u_bit_scan(&mask); update_single_program_texture_state(ctx, prog[i], prog[i]->SamplerUnits[s], enabled_texture_units); } + + if (unlikely(prog[i]->sh.HasBoundBindlessSampler)) { + /* Loop over bindless samplers bound to texture units. + */ + for (s = 0; s < prog[i]->sh.NumBindlessSamplers; s++) { + struct gl_bindless_sampler *sampler = + &prog[i]->sh.BindlessSamplers[s]; + + if (!sampler->bound) + continue; + + update_single_program_texture_state(ctx, prog[i], sampler->unit, + enabled_texture_units); + } + } } if (prog[MESA_SHADER_FRAGMENT]) { |