summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-11-03 20:41:08 +1000
committerDave Airlie <[email protected]>2012-11-09 09:24:41 +1000
commite0e7e29554b7a4a723315eef3df5fb9bad28a70a (patch)
treea76e6c8db2fc06211a64bb066759a0019320f6b4 /src/mesa/main/texobj.c
parent5a5a80e02161f6ec9e36b25699183e0a6d3ad3eb (diff)
mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)
This adds the mesa core + texture + fbo support for the texture cube map array extension. v2: add comment to _mesa_num_tex_faces related to cube map arrays (Brian) drop wrong comment cut-n-paste (Brian) fix / 6 maximum check issue (Kenneth) coalsece some array case statements (Kenneth) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 8525ff9fd41..c083c72e2aa 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -108,6 +108,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
target == GL_TEXTURE_1D_ARRAY_EXT ||
target == GL_TEXTURE_2D_ARRAY_EXT ||
target == GL_TEXTURE_EXTERNAL_OES ||
+ target == GL_TEXTURE_CUBE_MAP_ARRAY ||
target == GL_TEXTURE_BUFFER);
memset(obj, 0, sizeof(*obj));
@@ -316,6 +317,7 @@ valid_texture_object(const struct gl_texture_object *tex)
case GL_TEXTURE_2D_ARRAY_EXT:
case GL_TEXTURE_BUFFER:
case GL_TEXTURE_EXTERNAL_OES:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
return GL_TRUE;
case 0x99:
_mesa_problem(NULL, "invalid reference to a deleted texture object");
@@ -515,6 +517,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
maxLevels = ctx->Const.Max3DTextureLevels;
break;
case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
maxLog2 = MAX2(baseImage->WidthLog2,
baseImage->HeightLog2);
maxLevels = ctx->Const.MaxCubeTextureLevels;
@@ -599,7 +602,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
if (height > 1 && t->Target != GL_TEXTURE_1D_ARRAY) {
height /= 2;
}
- if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY) {
+ if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY && t->Target != GL_TEXTURE_CUBE_MAP_ARRAY) {
depth /= 2;
}
@@ -768,6 +771,10 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
dims = 0;
target = GL_TEXTURE_BUFFER;
break;
+ case TEXTURE_CUBE_ARRAY_INDEX:
+ dims = 3;
+ target = GL_TEXTURE_CUBE_MAP_ARRAY;
+ break;
case TEXTURE_EXTERNAL_INDEX:
dims = 2;
target = GL_TEXTURE_EXTERNAL_OES;
@@ -1155,6 +1162,8 @@ target_enum_to_index(struct gl_context *ctx, GLenum target)
case GL_TEXTURE_EXTERNAL_OES:
return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external
? TEXTURE_EXTERNAL_INDEX : -1;
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
+ return TEXTURE_CUBE_ARRAY_INDEX;
default:
return -1;
}