diff options
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/attrib.c | 13 | ||||
-rw-r--r-- | mesalib/src/mesa/main/extensions.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/fbobject.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/get.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/get_hash_params.py | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/queryobj.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shared.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/teximage.c | 76 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texobj.c | 11 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texobj.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texparam.c | 5 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texstate.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texstorage.c | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texstore.c | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/varray.c | 16 |
16 files changed, 128 insertions, 24 deletions
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index 05db35b8e..0997e5407 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -684,7 +684,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT, !!(unit->Enabled & TEXTURE_2D_ARRAY_BIT)); } - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode); @@ -762,7 +761,10 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) !ctx->Extensions.MESA_texture_array) { continue; } - else if (obj->Target == GL_TEXTURE_BUFFER) + else if (obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY && + !ctx->Extensions.ARB_texture_cube_map_array) { + continue; + } else if (obj->Target == GL_TEXTURE_BUFFER) continue; else if (obj->Target == GL_TEXTURE_EXTERNAL_OES) continue; @@ -1147,8 +1149,11 @@ _mesa_PopAttrib(void) if (ctx->Extensions.NV_point_sprite) _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, ctx->Point.SpriteRMode); - _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, - (GLfloat)ctx->Point.SpriteOrigin); + + if ((ctx->API == API_OPENGL && ctx->Version >= 20) + || ctx->API == API_OPENGL_CORE) + _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, + (GLfloat)ctx->Point.SpriteOrigin); } } break; diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index f8688cdb9..d5a7886c9 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -129,6 +129,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_compression", o(dummy_true), GLL, 2000 }, { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 }, { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GLL, 1999 }, + { "GL_ARB_texture_cube_map_array", o(ARB_texture_cube_map_array), GLL, 2009 }, { "GL_ARB_texture_env_add", o(dummy_true), GLL, 1999 }, { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), GLL, 2001 }, { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), GLL, 2001 }, diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 0758d5557..0618b7fab 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2025,7 +2025,8 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, */ err = (texObj->Target != GL_TEXTURE_3D) && (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && - (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); + (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT) && + (texObj->Target != GL_TEXTURE_CUBE_MAP_ARRAY); } else { /* Make sure textarget is consistent with the texture's type */ @@ -2058,7 +2059,8 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, } } else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) || - (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) { + (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT) || + (texObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY)) { if (zoffset < 0 || zoffset >= (GLint) ctx->Const.MaxArrayTextureLayers) { _mesa_error(ctx, GL_INVALID_VALUE, diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index afae08932..39709b808 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -335,6 +335,7 @@ EXTRA_EXT(ARB_blend_func_extended); EXTRA_EXT(ARB_uniform_buffer_object); EXTRA_EXT(ARB_timer_query); EXTRA_EXT(ARB_map_buffer_alignment); +EXTRA_EXT(ARB_texture_cube_map_array); static const int extra_NV_primitive_restart[] = { @@ -667,6 +668,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_TEXTURE_BINDING_CUBE_MAP_ARB: case GL_TEXTURE_BINDING_RECTANGLE_NV: case GL_TEXTURE_BINDING_EXTERNAL_OES: + case GL_TEXTURE_BINDING_CUBE_MAP_ARRAY: unit = ctx->Texture.CurrentUnit; v->value_int = ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name; diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 376df09ee..ac9c79cea 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -688,6 +688,9 @@ descriptor=[ # GL_ARB_map_buffer_alignment [ "MIN_MAP_BUFFER_ALIGNMENT", "CONTEXT_INT(Const.MinMapBufferAlignment), extra_ARB_map_buffer_alignment" ], + +# GL_ARB_texture_cube_map_array + [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ], ]} ] diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index c8f2ca325..b99e71044 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1146,6 +1146,7 @@ struct gl_stencil_attrib */ typedef enum { + TEXTURE_CUBE_ARRAY_INDEX, TEXTURE_BUFFER_INDEX, TEXTURE_2D_ARRAY_INDEX, TEXTURE_1D_ARRAY_INDEX, @@ -1164,6 +1165,7 @@ typedef enum * Used for Texture.Unit[]._ReallyEnabled flags. */ /*@{*/ +#define TEXTURE_CUBE_ARRAY_BIT (1 << TEXTURE_CUBE_ARRAY_INDEX) #define TEXTURE_BUFFER_BIT (1 << TEXTURE_BUFFER_INDEX) #define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) #define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) @@ -2973,6 +2975,7 @@ struct gl_extensions GLboolean ARB_texture_buffer_object; GLboolean ARB_texture_compression_rgtc; GLboolean ARB_texture_cube_map; + GLboolean ARB_texture_cube_map_array; GLboolean ARB_texture_env_combine; GLboolean ARB_texture_env_crossbar; GLboolean ARB_texture_env_dot3; diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index 8c5e1b822..a22425ab0 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -216,7 +216,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) FLUSH_VERTICES(ctx, 0); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glDeleeteQueries(%d)\n", n); + _mesa_debug(ctx, "glDeleteQueries(%d)\n", n); if (n < 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)"); diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index 2d2f7bd1d..ba82628f3 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -90,6 +90,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx) for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { /* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */ static const GLenum targets[] = { + GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BUFFER, GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_1D_ARRAY_EXT, diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index b88931743..0f28009b0 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -649,7 +649,7 @@ _mesa_is_proxy_texture(GLenum target) * NUM_TEXTURE_TARGETS should match number of terms below, except there's no * proxy for GL_TEXTURE_BUFFER and GL_TEXTURE_EXTERNAL_OES. */ - assert(NUM_TEXTURE_TARGETS == 7 + 2); + assert(NUM_TEXTURE_TARGETS == 8 + 2); return (target == GL_PROXY_TEXTURE_1D || target == GL_PROXY_TEXTURE_2D || @@ -657,7 +657,8 @@ _mesa_is_proxy_texture(GLenum target) target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || target == GL_PROXY_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || - target == GL_PROXY_TEXTURE_2D_ARRAY_EXT); + target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || + target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY); } @@ -695,6 +696,9 @@ _mesa_get_proxy_target(GLenum target) case GL_TEXTURE_2D_ARRAY_EXT: case GL_PROXY_TEXTURE_2D_ARRAY_EXT: return GL_PROXY_TEXTURE_2D_ARRAY_EXT; + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return GL_PROXY_TEXTURE_CUBE_MAP_ARRAY; default: _mesa_problem(NULL, "unexpected target in _mesa_get_proxy_target()"); return 0; @@ -745,6 +749,12 @@ _mesa_select_tex_object(struct gl_context *ctx, case GL_PROXY_TEXTURE_CUBE_MAP_ARB: return ctx->Extensions.ARB_texture_cube_map ? ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX] : NULL; + case GL_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array + ? texUnit->CurrentTex[TEXTURE_CUBE_ARRAY_INDEX] : NULL; + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array + ? ctx->Texture.ProxyTex[TEXTURE_CUBE_ARRAY_INDEX] : NULL; case GL_TEXTURE_RECTANGLE_NV: return ctx->Extensions.NV_texture_rectangle ? texUnit->CurrentTex[TEXTURE_RECT_INDEX] : NULL; @@ -891,6 +901,11 @@ get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level) return NULL; texIndex = TEXTURE_2D_ARRAY_INDEX; break; + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + if (level >= ctx->Const.MaxCubeTextureLevels) + return NULL; + texIndex = TEXTURE_CUBE_ARRAY_INDEX; + break; default: return NULL; } @@ -953,6 +968,10 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target) return (ctx->Extensions.MESA_texture_array || ctx->Extensions.EXT_texture_array) ? ctx->Const.MaxTextureLevels : 0; + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array + ? ctx->Const.MaxCubeTextureLevels : 0; case GL_TEXTURE_BUFFER: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_buffer_object @@ -995,6 +1014,8 @@ _mesa_get_texture_dimensions(GLenum target) case GL_PROXY_TEXTURE_3D: case GL_TEXTURE_2D_ARRAY: case GL_PROXY_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: return 3; case GL_TEXTURE_BUFFER: /* fall-through */ @@ -1174,6 +1195,8 @@ _mesa_init_teximage_fields(struct gl_context *ctx, break; case GL_TEXTURE_2D_ARRAY: case GL_PROXY_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */ img->HeightLog2 = _mesa_logbase2(img->Height2); img->Depth2 = depth; /* no border */ @@ -1341,6 +1364,24 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target, } return GL_TRUE; + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1); + if (width < 2 * border || width > 2 * border + maxSize) + return GL_FALSE; + if (height < 2 * border || height > 2 * border + maxSize) + return GL_FALSE; + if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers) + return GL_FALSE; + if (level >= ctx->Const.MaxCubeTextureLevels) + return GL_FALSE; + if (!ctx->Extensions.ARB_texture_non_power_of_two) { + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; + } + return GL_TRUE; default: _mesa_problem(ctx, "Invalid target in _mesa_legal_texture_dimensions()"); return GL_FALSE; @@ -1549,6 +1590,9 @@ target_can_be_compressed(const struct gl_context *ctx, GLenum target, case GL_TEXTURE_2D_ARRAY_EXT: return (ctx->Extensions.MESA_texture_array || ctx->Extensions.EXT_texture_array); + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array; default: return GL_FALSE; } @@ -1614,6 +1658,9 @@ legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target) return _mesa_is_desktop_gl(ctx) && (ctx->Extensions.MESA_texture_array || ctx->Extensions.EXT_texture_array); + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array; default: return GL_FALSE; } @@ -1666,6 +1713,9 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) && (ctx->Extensions.MESA_texture_array || ctx->Extensions.EXT_texture_array)) || _mesa_is_gles3(ctx); + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array; default: return GL_FALSE; } @@ -1782,6 +1832,7 @@ texture_error_check( struct gl_context *ctx, * Formats and types that require additional extensions (e.g., GL_FLOAT * requires GL_OES_texture_float) are filtered elsewhere. */ + if (_mesa_is_gles(ctx) && !_mesa_is_gles3(ctx)) { if (format != internalFormat) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -1810,6 +1861,20 @@ texture_error_check( struct gl_context *ctx, return GL_TRUE; } + if ((target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY || + target == GL_TEXTURE_CUBE_MAP_ARRAY) && width != height) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTexImage3D(cube array width != height)"); + return GL_TRUE; + } + + if ((target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY || + target == GL_TEXTURE_CUBE_MAP_ARRAY) && (depth % 6)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTexImage3D(cube array depth not multiple of 6)"); + return GL_TRUE; + } + /* Check internalFormat */ if (_mesa_base_tex_format(ctx, internalFormat) < 0) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1886,7 +1951,10 @@ texture_error_check( struct gl_context *ctx, target != GL_TEXTURE_RECTANGLE_ARB && target != GL_PROXY_TEXTURE_RECTANGLE_ARB && !((_mesa_is_cube_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP) && - (ctx->Version >= 30 || ctx->Extensions.EXT_gpu_shader4))) { + (ctx->Version >= 30 || ctx->Extensions.EXT_gpu_shader4)) && + !((target == GL_TEXTURE_CUBE_MAP_ARRAY || + target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY) && + ctx->Extensions.ARB_texture_cube_map_array)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage%dD(bad target for depth texture)", dimensions); @@ -2684,7 +2752,7 @@ strip_texture_border(GLenum target, *height = *height - 2; /* reduce the height by two border pixels */ } - if (*depth >= 3 && target != GL_TEXTURE_2D_ARRAY) { + if (*depth >= 3 && target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) { unpackNew->SkipImages++; /* skip the border */ *depth = *depth - 2; /* reduce the depth by two border pixels */ } diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index 8525ff9fd..c083c72e2 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/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; } diff --git a/mesalib/src/mesa/main/texobj.h b/mesalib/src/mesa/main/texobj.h index f22c58cad..f86b4ebcd 100644 --- a/mesalib/src/mesa/main/texobj.h +++ b/mesalib/src/mesa/main/texobj.h @@ -81,6 +81,8 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, /** * Return number of faces for a texture target. This will be 6 for * cube maps (and cube map arrays) and 1 otherwise. + * NOTE: this function is not used for cube map arrays which operate + * more like 2D arrays than cube maps. */ static inline GLuint _mesa_num_tex_faces(GLenum target) diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index f73e2b5f0..8ce054618 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -170,6 +170,11 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) return texUnit->CurrentTex[TEXTURE_EXTERNAL_INDEX]; } break; + case GL_TEXTURE_CUBE_MAP_ARRAY: + if (ctx->Extensions.ARB_texture_cube_map_array) { + return texUnit->CurrentTex[TEXTURE_CUBE_ARRAY_INDEX]; + } + break; default: ; } diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index 0e5ba44ed..1f765086b 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -706,6 +706,7 @@ alloc_proxy_textures( struct gl_context *ctx ) * values! */ static const GLenum targets[] = { + GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BUFFER, GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_1D_ARRAY_EXT, diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c index 968f6f904..9e0b54317 100644 --- a/mesalib/src/mesa/main/texstorage.c +++ b/mesalib/src/mesa/main/texstorage.c @@ -87,6 +87,9 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) case GL_PROXY_TEXTURE_2D_ARRAY: return (ctx->Extensions.MESA_texture_array || ctx->Extensions.EXT_texture_array); + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + return ctx->Extensions.ARB_texture_cube_map_array; default: return GL_FALSE; } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index e6914553c..1c088106f 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -4273,6 +4273,7 @@ store_texsubimage(struct gl_context *ctx, dims = 1; break; case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_3D: dims = 3; break; @@ -4324,6 +4325,12 @@ store_texsubimage(struct gl_context *ctx, srcImageStride = _mesa_image_image_stride(packing, width, height, format, type); break; + case GL_TEXTURE_CUBE_MAP_ARRAY: + numSlices = depth; + sliceOffset = zoffset; + srcImageStride = _mesa_image_image_stride(packing, width, height, + format, type); + break; default: _mesa_warning(ctx, "Unexpected target 0x%x in store_texsubimage()", target); return; diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 522f5a704..3974787b4 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -701,14 +701,10 @@ _mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) { - const GLfloat *v = + const GLint *v = (const GLint *) get_current_attrib(ctx, index, "glGetVertexAttribIiv"); if (v != NULL) { - /* XXX we don't have true integer-valued vertex attribs yet */ - params[0] = (GLint) v[0]; - params[1] = (GLint) v[1]; - params[2] = (GLint) v[2]; - params[3] = (GLint) v[3]; + COPY_4V(params, v); } } else { @@ -726,14 +722,10 @@ _mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) { - const GLfloat *v = + const GLuint *v = (const GLuint *) get_current_attrib(ctx, index, "glGetVertexAttribIuiv"); if (v != NULL) { - /* XXX we don't have true integer-valued vertex attribs yet */ - params[0] = (GLuint) v[0]; - params[1] = (GLuint) v[1]; - params[2] = (GLuint) v[2]; - params[3] = (GLuint) v[3]; + COPY_4V(params, v); } } else { |