mesa: fix bindless uniform samplers update
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 16 Jul 2021 16:43:32 +0000 (18:43 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 20 Jul 2021 08:06:44 +0000 (08:06 +0000)
According to the comment below some extra magic is needed
for bindless samplers, so don't do an early return in this
case.

Fixes: 736f1f70ab8 ("mesa: skip redundant uniform updates for glUniform")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4806
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11930>

src/mesa/main/uniform_query.cpp

index b5b5f1a..206f6a8 100644 (file)
@@ -1340,7 +1340,10 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
          ctx_flushed = true;
       }
    }
-   if (!ctx_flushed)
+   /* Return early if possible. Bindless samplers need to be processed
+    * because of the !sampler->bound codepath below.
+    */
+   if (!ctx_flushed && !(uni->type->is_sampler() && uni->is_bindless))
       return; /* no change in uniform values */
 
    /* If the uniform is a sampler, do the extra magic necessary to propagate