summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-09-27 11:19:46 -0400
committerDylan Baker <dylan.c.baker@intel.com>2020-12-01 11:25:33 -0800
commit127a1b124464797ef284c836059c262c976f89c2 (patch)
tree18a343347e653f397a9011d2aada4f019a364c83
parent17f0681ff990eba00a046af1b208c1a748d06b41 (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> (cherry picked from commit 0a2117bc9e01bc821a6f766c516665d2aa5b47d8)
-rw-r--r--.pick_status.json2
-rw-r--r--src/mesa/main/uniform_query.cpp13
2 files changed, 9 insertions, 6 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 2c1f0d394c3..3c388938263 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -580,7 +580,7 @@
"description": "mesa: call FLUSH_VERTICES before changing sampler uniforms",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "9545139ce5f10180547568a3da94af9e291253fd"
},
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 2b1fc8668f4..0ac9d180dca 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1181,6 +1181,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;
}
@@ -1188,6 +1192,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;
}
@@ -1195,11 +1203,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)