summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-02-15 19:09:15 -0500
committerIlia Mirkin <[email protected]>2016-02-22 10:38:56 -0500
commitb6654831c36f9780e6bcd23bb211470ec0db7de2 (patch)
treebb5faeae0fefcd8ca0b67a258bd2f8ed97dca08a /src/mesa/main
parentaf8ad495415e9d71fd6255114d4ea5e0ab6a1e2a (diff)
mesa: add GL_OES_texture_border_clamp support
Only minor differences to the existing ARB_texture_border_clamp support. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/extensions_table.h1
-rw-r--r--src/mesa/main/samplerobj.c6
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp10
-rw-r--r--src/mesa/main/texparam.c11
4 files changed, 22 insertions, 6 deletions
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 0c90f010cc9..2cd9d7586d6 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -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)
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index fe15508696e..ca366d967ab 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -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;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index e6412962251..24e3d189091 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -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 }
};
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 260b3c32887..20770a77e15 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -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;
{