summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniform_query.cpp
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 17:22:09 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commitcaf39d6df9de145060d7def72c20ca45e41b1e9c (patch)
tree2a9c4393040bb19a23e192abf8d9e0a9b183a38d /src/mesa/main/uniform_query.cpp
parentb7ba745032900643af7bcfdc773a783b73e2735a (diff)
mesa: don't flag _NEW_PROGRAM_CONSTANTS for GLSL programs for st/mesa
v2: also update _mesa_uniform_handle for bindless textures Reviewed-by: Nicolai Hähnle <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Timothy Arceri <[email protected]> (v1) Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r--src/mesa/main/uniform_query.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 37c130ac310..5eb0efc3268 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1002,6 +1002,23 @@ validate_uniform(GLint location, GLsizei count, const GLvoid *values,
return uni;
}
+void
+_mesa_flush_vertices_for_uniforms(struct gl_context *ctx,
+ const struct gl_uniform_storage *uni)
+{
+ uint64_t new_driver_state = 0;
+ unsigned mask = uni->active_shader_mask;
+
+ while (mask) {
+ unsigned index = u_bit_scan(&mask);
+
+ assert(index < MESA_SHADER_STAGES);
+ new_driver_state |= ctx->DriverFlags.NewShaderConstants[index];
+ }
+
+ FLUSH_VERTICES(ctx, new_driver_state ? 0 : _NEW_PROGRAM_CONSTANTS);
+ ctx->NewDriverState |= new_driver_state;
+}
/**
* Called via glUniform*() functions.
@@ -1056,7 +1073,7 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
count = MIN2(count, (int) (uni->array_elements - offset));
}
- FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
+ _mesa_flush_vertices_for_uniforms(ctx, uni);
/* Store the data in the "actual type" backing storage for the uniform.
*/
@@ -1272,7 +1289,7 @@ _mesa_uniform_matrix(GLint location, GLsizei count,
count = MIN2(count, (int) (uni->array_elements - offset));
}
- FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
+ _mesa_flush_vertices_for_uniforms(ctx, uni);
/* Store the data in the "actual type" backing storage for the uniform.
*/
@@ -1426,7 +1443,7 @@ _mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values,
count = MIN2(count, (int) (uni->array_elements - offset));
}
- FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
+ _mesa_flush_vertices_for_uniforms(ctx, uni);
/* Store the data in the "actual type" backing storage for the uniform.
*/