summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-06-29 21:53:06 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-08-25 19:22:10 -0700
commit1bf9b2a6008552f5fdb8908c24c446fd7261efdd (patch)
tree42a1df93a23368b5b33c4a8b8251c689e5493ce9
parentc2b10cabed6468b998a9c4d0ada7953d93311029 (diff)
downloadexternal_mesa3d-1bf9b2a6008552f5fdb8908c24c446fd7261efdd.zip
external_mesa3d-1bf9b2a6008552f5fdb8908c24c446fd7261efdd.tar.gz
external_mesa3d-1bf9b2a6008552f5fdb8908c24c446fd7261efdd.tar.bz2
mesa: Implement GL_KHR_blend_equation_advanced_coherent.
This adds the extension enable (so drivers can advertise it) and the extra boolean state flag, GL_BLEND_ADVANCED_COHERENT_KHR, which can be set to request coherent blending. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--src/mesa/main/blend.c2
-rw-r--r--src/mesa/main/enable.c12
-rw-r--r--src/mesa/main/extensions_table.h1
-rw-r--r--src/mesa/main/get.c1
-rw-r--r--src/mesa/main/get_hash_params.py3
-rw-r--r--src/mesa/main/mtypes.h4
6 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index de6d3c4..ad79ee0 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -1039,6 +1039,8 @@ void _mesa_init_color( struct gl_context * ctx )
* if EGL_KHR_gl_colorspace has been used to request sRGB.
*/
ctx->Color.sRGBEnabled = _mesa_is_gles(ctx);
+
+ ctx->Color.BlendCoherent = true;
}
/*@}*/
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 1468a45..d1ab81e 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1017,6 +1017,14 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
ctx->Multisample.SampleMask = state;
break;
+ case GL_BLEND_ADVANCED_COHERENT_KHR:
+ CHECK_EXTENSION(KHR_blend_equation_advanced_coherent, cap);
+ if (ctx->Color.BlendCoherent == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.BlendCoherent = state;
+ break;
+
default:
goto invalid_enum_error;
}
@@ -1619,6 +1627,10 @@ _mesa_IsEnabled( GLenum cap )
CHECK_EXTENSION(ARB_sample_shading);
return ctx->Multisample.SampleShading;
+ case GL_BLEND_ADVANCED_COHERENT_KHR:
+ CHECK_EXTENSION(KHR_blend_equation_advanced_coherent);
+ return ctx->Color.BlendCoherent;
+
default:
goto invalid_enum_error;
}
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index e8c825b..c6fdd2c 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -283,6 +283,7 @@ EXT(INGR_blend_func_separate , EXT_blend_func_separate
EXT(INTEL_performance_query , INTEL_performance_query , GLL, GLC, x , ES2, 2013)
EXT(KHR_blend_equation_advanced , KHR_blend_equation_advanced , GLL, GLC, x , ES2, 2014)
+EXT(KHR_blend_equation_advanced_coherent , KHR_blend_equation_advanced_coherent , GLL, GLC, x , ES2, 2014)
EXT(KHR_context_flush_control , dummy_true , GLL, GLC, x , ES2, 2014)
EXT(KHR_debug , dummy_true , GLL, GLC, 11, ES2, 2012)
EXT(KHR_robust_buffer_access_behavior , ARB_robust_buffer_access_behavior , GLL, GLC, x , ES2, 2014)
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index b017827..97dfb0c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -465,6 +465,7 @@ EXTRA_EXT(ATI_meminfo);
EXTRA_EXT(NVX_gpu_memory_info);
EXTRA_EXT(ARB_cull_distance);
EXTRA_EXT(EXT_window_rectangles);
+EXTRA_EXT(KHR_blend_equation_advanced_coherent);
static const int
extra_ARB_color_buffer_float_or_glcore[] = {
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 89d164d..3414743 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -338,6 +338,9 @@ descriptor=[
# blend_func_extended
[ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
+
+# GL_KHR_blend_equation_advanced_coherent
+ [ "BLEND_ADVANCED_COHERENT_KHR", "CONTEXT_BOOL(Color.BlendCoherent), extra_KHR_blend_equation_advanced_coherent" ],
]},
# GLES3 is not a typo.
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3e12555..7637160 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -461,6 +461,9 @@ struct gl_colorbuffer_attrib
* requires all draw buffers to match, so we only need a single value.
*/
enum gl_advanced_blend_mode _AdvancedBlendMode;
+
+ /** Coherency requested via glEnable(GL_BLEND_ADVANCED_COHERENT_KHR)? */
+ bool BlendCoherent;
/*@}*/
/**
@@ -3957,6 +3960,7 @@ struct gl_extensions
GLboolean GREMEDY_string_marker;
GLboolean INTEL_performance_query;
GLboolean KHR_blend_equation_advanced;
+ GLboolean KHR_blend_equation_advanced_coherent;
GLboolean KHR_robustness;
GLboolean KHR_texture_compression_astc_hdr;
GLboolean KHR_texture_compression_astc_ldr;