[Mesa-dev] [PATCH] mesa: skip FLUSH_VERTICES() if no samplers were changed

Timothy Arceri tarceri at itsqueeze.com
Thu Jun 22 22:56:40 UTC 2017


---
 src/mesa/main/uniform_query.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 1570770..9683fa8 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1071,21 +1071,26 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
     *     element that exceeds the highest array element index used, as
     *     reported by GetActiveUniform, will be ignored by the GL."
     *
     * Clamp 'count' to a valid value.  Note that for non-arrays a count > 1
     * will have already generated an error.
     */
    if (uni->array_elements != 0) {
       count = MIN2(count, (int) (uni->array_elements - offset));
    }
 
-   _mesa_flush_vertices_for_uniforms(ctx, uni);
+   /* We check samplers for changes and flush if needed in the sampler
+    * handling code further down, so just skip them here.
+    */
+   if (!uni->type->is_sampler()) {
+       _mesa_flush_vertices_for_uniforms(ctx, uni);
+   }
 
    /* Store the data in the "actual type" backing storage for the uniform.
     */
    if (!uni->type->is_boolean() && !uni->is_bindless) {
       memcpy(&uni->storage[size_mul * components * offset], values,
              sizeof(uni->storage[0]) * components * count * size_mul);
    } else if (uni->is_bindless) {
       const union gl_constant_value *src =
          (const union gl_constant_value *) values;
       GLuint64 *dst = (GLuint64 *)&uni->storage[components * offset].i;
-- 
2.9.4



More information about the mesa-dev mailing list