summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 01:46:34 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit581d77315bdb2338e97133a05fa8c354352f5fd8 (patch)
tree4b92a067c861b25dad5174bf68b9a8185ca21f79 /src/mesa/main/blend.h
parentb677e96078889140ad1549cb7b94b0a33c10f7ba (diff)
mesa: don't flag _NEW_COLOR for st/mesa if possible
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/blend.h')
-rw-r--r--src/mesa/main/blend.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index 54b9ce6e1b1..675e50d3886 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -34,7 +34,9 @@
#include "glheader.h"
+#include "context.h"
#include "formats.h"
+#include "extensions.h"
struct gl_context;
struct gl_framebuffer;
@@ -136,4 +138,22 @@ _mesa_get_render_format(const struct gl_context *ctx, mesa_format format);
extern void
_mesa_init_color( struct gl_context * ctx );
+
+static inline void
+_mesa_flush_vertices_for_blend_state(struct gl_context *ctx)
+{
+ /* The advanced blend mode needs _NEW_COLOR to update the state constant,
+ * so we have to set it. This is inefficient.
+ * This should only be done for states that affect the state constant.
+ * It shouldn't be done for other blend states.
+ */
+ if (_mesa_has_KHR_blend_equation_advanced(ctx) ||
+ !ctx->DriverFlags.NewBlend) {
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ } else {
+ FLUSH_VERTICES(ctx, 0);
+ }
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
+}
+
#endif