summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-02-15 23:57:06 -0500
committerIlia Mirkin <[email protected]>2016-02-19 12:37:22 -0500
commita03d6f2aa3bb589ca61c3cc13c4189a973b3a2c1 (patch)
tree17e8263a4ea3767013e4cf2a02713de49dfc255f /src/mesa/main
parent2b938a390c15a06be8cf706083890c822979508f (diff)
mesa: add GL_OES_texture_stencil8 support
It's basically the same thing as GL_ARB_texture_stencil8 except that glCopyTexImage isn't supported, so add STENCIL_INDEX to the list of invalid GLES formats for glCopyTexImage. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/extensions_table.h1
-rw-r--r--src/mesa/main/glformats.c8
-rw-r--r--src/mesa/main/teximage.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index d1e3a99fdc0..0c90f010cc9 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -341,6 +341,7 @@ EXT(OES_texture_half_float , OES_texture_half_float
EXT(OES_texture_half_float_linear , OES_texture_half_float_linear , x , x , x , ES2, 2005)
EXT(OES_texture_mirrored_repeat , dummy_true , x , x , ES1, x , 2005)
EXT(OES_texture_npot , ARB_texture_non_power_of_two , x , x , ES1, ES2, 2005)
+EXT(OES_texture_stencil8 , ARB_texture_stencil8 , x , x , x , 30, 2014)
EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample , x , x , ES1, 31, 2014)
EXT(OES_vertex_array_object , dummy_true , x , x , ES1, ES2, 2010)
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index f5284447b6e..987cd0db45c 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3153,6 +3153,14 @@ _mesa_es3_error_check_format_and_type(const struct gl_context *ctx,
}
break;
+ case GL_STENCIL_INDEX:
+ if (!_mesa_has_OES_texture_stencil8(ctx) ||
+ type != GL_UNSIGNED_BYTE ||
+ internalFormat != GL_STENCIL_INDEX8) {
+ return GL_INVALID_OPERATION;
+ }
+ break;
+
case GL_ALPHA:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 57765d7638b..8a4c6286cbe 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2285,8 +2285,10 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
}
if (baseFormat == GL_DEPTH_COMPONENT ||
baseFormat == GL_DEPTH_STENCIL ||
+ baseFormat == GL_STENCIL_INDEX ||
rb_base_format == GL_DEPTH_COMPONENT ||
rb_base_format == GL_DEPTH_STENCIL ||
+ rb_base_format == GL_STENCIL_INDEX ||
((baseFormat == GL_LUMINANCE_ALPHA ||
baseFormat == GL_ALPHA) &&
rb_base_format != GL_RGBA) ||