[Mesa-dev] [PATCH] mesa: add GL_OES_sample_shading support
Ilia Mirkin
imirkin at alum.mit.edu
Tue Feb 16 19:41:46 UTC 2016
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
The dEQP tests expect this to enable per-sample interpolation, so I had to undo
some of the changes in st/mesa from earlier to get it to pass.
docs/GL3.txt | 2 +-
src/mapi/glapi/gen/es_EXT.xml | 6 ++++++
src/mesa/main/enable.c | 4 ++--
src/mesa/main/extensions_table.h | 1 +
src/mesa/main/multisample.c | 3 ++-
src/mesa/main/tests/dispatch_sanity.cpp | 3 +++
6 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/docs/GL3.txt b/docs/GL3.txt
index ae439f6..2e528d4 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -247,7 +247,7 @@ GLES3.2, GLSL ES 3.2
GL_OES_geometry_shader started (Marta)
GL_OES_gpu_shader5 not started (based on parts of GL_ARB_gpu_shader5, which is done for some drivers)
GL_OES_primitive_bounding box not started
- GL_OES_sample_shading not started (based on parts of GL_ARB_sample_shading, which is done for some drivers)
+ GL_OES_sample_shading DONE (nvc0, r600, radeonsi)
GL_OES_sample_variables DONE (nvc0, r600, radeonsi)
GL_OES_shader_image_atomic not started (based on parts of GL_ARB_shader_image_load_store, which is done for some drivers)
GL_OES_shader_io_blocks not started (based on parts of GLSL 1.50, which is done)
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 93284be..35c286d 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -798,6 +798,12 @@
</function>
</category>
+<category name="GL_OES_sample_shading" number="169">
+ <function name="MinSampleShadingOES" alias="MinSampleShading" es2="3.0">
+ <param name="value" type="GLfloat"/>
+ </function>
+</category>
+
<!-- 174. GL_OES_texture_storage_multisample_2d_array -->
<category name="GL_OES_texture_storage_multisample_2d_array" number="174">
<enum name="TEXTURE_2D_MULTISAMPLE_ARRAY_OES" value="0x9102"/>
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 3985457..566b29b 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -805,7 +805,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
/* GL_ARB_sample_shading */
case GL_SAMPLE_SHADING:
- if (!_mesa_is_desktop_gl(ctx))
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
goto invalid_enum_error;
CHECK_EXTENSION(ARB_sample_shading, cap);
if (ctx->Multisample.SampleShading == state)
@@ -1604,7 +1604,7 @@ _mesa_IsEnabled( GLenum cap )
/* ARB_sample_shading */
case GL_SAMPLE_SHADING:
- if (!_mesa_is_desktop_gl(ctx))
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
goto invalid_enum_error;
CHECK_EXTENSION(ARB_sample_shading);
return ctx->Multisample.SampleShading;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 196a0c6..5cf4ba5 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -326,6 +326,7 @@ EXT(OES_point_sprite , ARB_point_sprite
EXT(OES_query_matrix , dummy_true , x , x , ES1, x , 2003)
EXT(OES_read_format , dummy_true , GLL, GLC, ES1, x , 2003)
EXT(OES_rgb8_rgba8 , dummy_true , x , x , ES1, ES2, 2005)
+EXT(OES_sample_shading , OES_sample_variables , x , x , x , 30, 2014)
EXT(OES_sample_variables , OES_sample_variables , x , x , x , 30, 2014)
EXT(OES_single_precision , dummy_true , x , x , ES1, x , 2003)
EXT(OES_standard_derivatives , OES_standard_derivatives , x , x , x , ES2, 2005)
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index e7783ea..6b644461 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -127,7 +127,8 @@ _mesa_MinSampleShading(GLclampf value)
{
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_sample_shading || !_mesa_is_desktop_gl(ctx)) {
+ if (!_mesa_has_ARB_sample_shading(ctx) &&
+ !_mesa_has_OES_sample_shading(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glMinSampleShading");
return;
}
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 3d0fce6..c323766 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2449,6 +2449,9 @@ const struct function gles3_functions_possible[] = {
/* GL_OES_copy_image */
{ "glCopyImageSubDataOES", 30, -1 },
+ /* GL_OES_sample_shading */
+ { "glMinSampleShadingOES", 30, -1 },
+
{ NULL, 0, -1 }
};
--
2.4.10
More information about the mesa-dev
mailing list