summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-12-28 11:26:06 -0800
committerPaul Berry <[email protected]>2013-01-02 10:28:39 -0800
commit7c0323296e445b4612516e2389e2b4c616faec27 (patch)
treece4267c1b79e7f9dd8898e9ea5832a4950c52e9a /src/mesa/main/teximage.c
parent261ee4d907cc2e06a578e1597f6a55f1997ab52c (diff)
mesa: Implement compressed 2D array textures.
This patch adds functionality to Mesa to upload compressed 2-dimensional array textures, using the glCompressedTexImage3D and glCompressedTexSubImage3D calls. Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES 3.0/ext_texture_array-compressed_gles3 *". Also partially fixes GLES3 conformance test "CoverageES30.test". Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 7a0d944fd96..33f81a25c4d 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3507,7 +3507,8 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims,
GLint expectedSize;
GLboolean targetOK;
- if (dims == 2) {
+ switch (dims) {
+ case 2:
switch (target) {
case GL_TEXTURE_2D:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
@@ -3520,12 +3521,17 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims,
break;
default:
targetOK = GL_FALSE;
+ break;
}
- }
- else {
- assert(dims == 1 || dims == 3);
- /* no 1D or 3D compressed textures at this time */
+ break;
+ case 3:
+ targetOK = (target == GL_TEXTURE_2D_ARRAY);
+ break;
+ default:
+ assert(dims == 1);
+ /* no 1D compressed textures at this time */
targetOK = GL_FALSE;
+ break;
}
if (!targetOK) {