mesa: add GL_OES_sample_shading support
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 16 Feb 2016 19:29:38 +0000 (14:29 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 31 Mar 2016 02:57:17 +0000 (22:57 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mapi/glapi/gen/es_EXT.xml
src/mesa/main/enable.c
src/mesa/main/extensions_table.h
src/mesa/main/multisample.c
src/mesa/main/tests/dispatch_sanity.cpp

index 8f8f997b20dc438dd0a7d4926c10c905d07bc999..8e51c058321920347bf87c5131b45c3acbc324f5 100644 (file)
     </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"/>
index b90a60ba03fdf17ee22290ff063ae1358dd952f8..d2830770ec20db4d6de2ba7db77a3a98ee6d2a54 100644 (file)
@@ -807,7 +807,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)
@@ -1606,7 +1606,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;
index 700ef24ab22da3bd7a4f6bc7185033f0b5c0eb64..c1bcfc53d1013b4e24361167eb5a2c5f8adba4fb 100644 (file)
@@ -330,6 +330,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_shader_image_atomic                 , ARB_shader_image_load_store            ,  x ,  x ,  x ,  31, 2015)
 EXT(OES_single_precision                    , dummy_true                             ,  x ,  x , ES1,  x , 2003)
index 77773a20883878d0d07b67c9450dc29b0da91929..5453e38632e3b73f0c90aa3be60d0ebcb77c0a36 100644 (file)
@@ -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;
    }
index 309e574ac3287c82e674db8ec2d73201d7ab72ce..06e7ec1a195e56a69bce93ee9e6617af62f9a431 100644 (file)
@@ -2454,6 +2454,9 @@ const struct function gles3_functions_possible[] = {
    { "glTexBufferOES", 31, -1 },
    { "glTexBufferRangeOES", 31, -1 },
 
+   /* GL_OES_sample_shading */
+   { "glMinSampleShadingOES", 30, -1 },
+
    { NULL, 0, -1 }
 };