diff options
author | Marek Olšák <marek.olsak@amd.com> | 2020-09-27 11:19:46 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-12-01 11:52:10 +0000 |
commit | 0a2117bc9e01bc821a6f766c516665d2aa5b47d8 (patch) | |
tree | 3898e0f40d58f9ce0c826663b90b0bdc238a9195 /src/mesa/main/uniform_query.cpp | |
parent | 9281dfca3fff6cc725ebf02e6cd517cb473e3f1d (diff) |
mesa: call FLUSH_VERTICES before changing sampler uniforms
Fixes: 9545139ce5f "mesa: skip FLUSH_VERTICES() if no samplers were changed"
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 9be7e048a76..2949e47e154 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -1203,6 +1203,10 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values, /* Mark this bindless sampler as bound to a texture unit. */ if (sampler->unit != value || !sampler->bound) { + if (!flushed) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT | _NEW_PROGRAM); + flushed = true; + } sampler->unit = value; changed = true; } @@ -1210,6 +1214,10 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values, sh->Program->sh.HasBoundBindlessSampler = true; } else { if (sh->Program->SamplerUnits[unit] != value) { + if (!flushed) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT | _NEW_PROGRAM); + flushed = true; + } sh->Program->SamplerUnits[unit] = value; changed = true; } @@ -1217,11 +1225,6 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values, } if (changed) { - if (!flushed) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT | _NEW_PROGRAM); - flushed = true; - } - struct gl_program *const prog = sh->Program; _mesa_update_shader_textures_used(shProg, prog); if (ctx->Driver.SamplerUniformChange) |