mesa: add GL_OES_texture_border_clamp support
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 16 Feb 2016 00:09:15 +0000 (19:09 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 22 Feb 2016 15:38:56 +0000 (10:38 -0500)
Only minor differences to the existing ARB_texture_border_clamp support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
docs/GL3.txt
docs/relnotes/11.3.0.html
src/mapi/glapi/gen/es_EXT.xml
src/mesa/main/extensions_table.h
src/mesa/main/samplerobj.c
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/texparam.c

index 73974de42a991c3dff559fe6543bd7497da4851a..76f40e44c22846c1c667366129982537b07cf9d7 100644 (file)
@@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2
   GL_OES_shader_io_blocks                              not started (based on parts of GLSL 1.50, which is done)
   GL_OES_shader_multisample_interpolation              not started (based on parts of GL_ARB_gpu_shader5, which is done)
   GL_OES_tessellation_shader                           not started (based on GL_ARB_tessellation_shader, which is done for some drivers)
-  GL_OES_texture_border_clamp                          not started (based on GL_ARB_texture_border_clamp, which is done)
+  GL_OES_texture_border_clamp                          DONE (all drivers)
   GL_OES_texture_buffer                                not started (based on GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and GL_ARB_texture_buffer_object_rgb32 that are all done)
   GL_OES_texture_cube_map_array                        not started (based on GL_ARB_texture_cube_map_array, which is done for all drivers)
   GL_OES_texture_stencil8                              DONE (all drivers that support GL_ARB_texture_stencil8)
index 56c1542a867dbaf838fb6fe86f6eb5eb17453fd8..eee4373e359d6279150d4355de02b956bf9fce2d 100644 (file)
@@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers.
 </p>
 
 <ul>
+<li>GL_OES_texture_border_clamp and GL_EXT_texture_border_clamp on all drivers that support GL_ARB_texture_border_clamp</li>
 </ul>
 
 <h2>Bug fixes</h2>
index 86df980304bec013ec5af5962976ea797569b035..fb0ef05f853732db3ecb38194398b439b4fd7484 100644 (file)
         <param name="texture" type="GLuint"/>
         <param name="level" type="GLint"/>
     </function>
-  </category>
+</category>
+
+<category name="GL_OES_texture_border_clamp" number="215">
+
+    <enum name="TEXTURE_BORDER_COLOR_OES" value ="0x1004"/>
+    <enum name="CLAMP_TO_BORDER_OES"      value="0x812D"/>
+
+    <function name="TexParameterIivOES" es2="3.0" alias="TexParameterIiv">
+        <param name="target" type="GLenum"/>
+        <param name="pname"  type="GLenum"/>
+        <param name="params" type="const GLint *"/>
+    </function>
+
+    <function name="TexParameterIuivOES" es2="3.0" alias="TexParameterIuiv">
+        <param name="target" type="GLenum"/>
+        <param name="pname"  type="GLenum"/>
+        <param name="params" type="const GLuint *"/>
+    </function>
+
+    <function name="GetTexParameterIivOES" es2="3.0" alias="GetTexParameterIiv">
+        <param name="target" type="GLenum"/>
+        <param name="pname"  type="GLenum"/>
+        <param name="params" type="GLint *"/>
+    </function>
+
+    <function name="GetTexParameterIuivOES" es2="3.0" alias="GetTexParameterIuiv">
+        <param name="target" type="GLenum"/>
+        <param name="pname"  type="GLenum"/>
+        <param name="params" type="GLuint *"/>
+    </function>
+
+    <function name="SamplerParameterIivOES" es2="3.0" alias="SamplerParameterIiv">
+      <param name="sampler" type="GLuint"/>
+      <param name="pname" type="GLenum"/>
+      <param name="params" type="const GLint *"/>
+    </function>
+
+    <function name="SamplerParameterIuivOES" es2="3.0" alias="SamplerParameterIuiv">
+      <param name="sampler" type="GLuint"/>
+      <param name="pname" type="GLenum"/>
+      <param name="params" type="const GLuint *"/>
+    </function>
+
+    <function name="GetSamplerParameterIivOES" es2="3.0" alias="GetSamplerParameterIiv">
+      <param name="sampler" type="GLuint"/>
+      <param name="pname" type="GLenum"/>
+      <param name="params" type="GLint *"/>
+    </function>
+
+    <function name="GetSamplerParameterIuivOES" es2="3.0" alias="GetSamplerParameterIuiv">
+      <param name="sampler" type="GLuint"/>
+      <param name="pname" type="GLenum"/>
+      <param name="params" type="GLfloat *"/>
+    </function>
+
+</category>
+
 </OpenGLAPI>
index 0c90f010cc987e2b9a56d05a00c6a7358c092545..2cd9d7586d683e83836e3acb1ca88c3278ac2530 100644 (file)
@@ -333,6 +333,7 @@ EXT(OES_stencil8                            , dummy_true
 EXT(OES_stencil_wrap                        , dummy_true                             ,  x ,  x , ES1,  x , 2002)
 EXT(OES_surfaceless_context                 , dummy_true                             ,  x ,  x , ES1, ES2, 2012)
 EXT(OES_texture_3D                          , dummy_true                             ,  x ,  x ,  x , ES2, 2005)
+EXT(OES_texture_border_clamp                , ARB_texture_border_clamp               ,  x ,  x ,  x , ES2, 2014)
 EXT(OES_texture_cube_map                    , ARB_texture_cube_map                   ,  x ,  x , ES1,  x , 2007)
 EXT(OES_texture_env_crossbar                , ARB_texture_env_crossbar               ,  x ,  x , ES1,  x , 2005)
 EXT(OES_texture_float                       , OES_texture_float                      ,  x ,  x ,  x , ES2, 2005)
index fe15508696edf268120dad5f6a55efed5402fa4d..ca366d967ab1a06e0c5fd435cafe9c8e3487d65f 100644 (file)
@@ -1518,7 +1518,8 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params)
 
    sampObj = _mesa_lookup_samplerobj(ctx, sampler);
    if (!sampObj) {
-      _mesa_error(ctx, GL_INVALID_VALUE,
+      _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+                        GL_INVALID_OPERATION : GL_INVALID_VALUE),
                   "glGetSamplerParameterIiv(sampler %u)",
                   sampler);
       return;
@@ -1593,7 +1594,8 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params)
 
    sampObj = _mesa_lookup_samplerobj(ctx, sampler);
    if (!sampObj) {
-      _mesa_error(ctx, GL_INVALID_VALUE,
+      _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+                        GL_INVALID_OPERATION : GL_INVALID_VALUE),
                   "glGetSamplerParameterIuiv(sampler %u)",
                   sampler);
       return;
index e64129622513e1c0354bfb334b4760f2426a9bc7..24e3d18909156aeb3e7fb1b01d4d494ef30013b5 100644 (file)
@@ -2436,6 +2436,16 @@ const struct function gles3_functions_possible[] = {
    { "glGetFragDataIndexEXT", 30, -1 },
    { "glBindFragDataLocationEXT", 30, -1 },
 
+   /* GL_OES_texture_border_clamp */
+   { "glTexParameterIivOES", 30, -1 },
+   { "glTexParameterIuivOES", 30, -1 },
+   { "glGetTexParameterIivOES", 30, -1 },
+   { "glGetTexParameterIuivOES", 30, -1 },
+   { "glSamplerParameterIivOES", 30, -1 },
+   { "glSamplerParameterIuivOES", 30, -1 },
+   { "glGetSamplerParameterIivOES", 30, -1 },
+   { "glGetSamplerParameterIuivOES", 30, -1 },
+
    { NULL, 0, -1 }
 };
 
index 260b3c3288772d1a03f618d51e0e5f1f6d745406..20770a77e15c4af9680a477312929463526f0e6e 100644 (file)
@@ -72,7 +72,7 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
       break;
 
    case GL_CLAMP_TO_BORDER:
-      supported = is_desktop_gl && e->ARB_texture_border_clamp
+      supported = ctx->API != API_OPENGLES && e->ARB_texture_border_clamp
          && (target != GL_TEXTURE_EXTERNAL_OES);
       break;
 
@@ -717,7 +717,8 @@ set_tex_parameterf(struct gl_context *ctx,
       break;
 
    case GL_TEXTURE_BORDER_COLOR:
-      if (!_mesa_is_desktop_gl(ctx))
+      if (ctx->API == API_OPENGLES ||
+          !ctx->Extensions.ARB_texture_border_clamp)
          goto invalid_pname;
 
       if (!target_allows_setting_sampler_parameters(texObj->Target))
@@ -1735,7 +1736,8 @@ get_tex_parameterfv(struct gl_context *ctx,
          *params = ENUM_TO_FLOAT(obj->Sampler.WrapR);
          break;
       case GL_TEXTURE_BORDER_COLOR:
-         if (!_mesa_is_desktop_gl(ctx))
+         if (ctx->API == API_OPENGLES ||
+             !ctx->Extensions.ARB_texture_border_clamp)
             goto invalid_pname;
 
          if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
@@ -1969,7 +1971,8 @@ get_tex_parameteriv(struct gl_context *ctx,
          *params = (GLint) obj->Sampler.WrapR;
          break;
       case GL_TEXTURE_BORDER_COLOR:
-         if (!_mesa_is_desktop_gl(ctx))
+         if (ctx->API == API_OPENGLES ||
+             !ctx->Extensions.ARB_texture_border_clamp)
             goto invalid_pname;
 
          {