ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
ctx->Const.Max3DTextureLevels = 9;
ctx->Const.MaxCubeTextureLevels = 12;
+ /* minimum maximum. Users are likely to run into memory problems
+ * even at this size, since 64 * 2048 * 2048 * 4 = 1GB and we can't
+ * address that much.
+ */
+ ctx->Const.MaxArrayTextureLayers = 64;
ctx->Const.MaxTextureRectSize = (1<<12);
ctx->Const.MaxTextureMaxAnisotropy = 16.0;
break;
}
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_1D_ARRAY:
+ brw_miptree_layout_texture_array(intel, mt, mt->depth0);
+ break;
+
default:
i945_miptree_layout_2d(mt, 1);
break;
nr_texcoords = 1;
break;
case TEXTURE_2D_INDEX:
+ case TEXTURE_1D_ARRAY_INDEX:
case TEXTURE_RECT_INDEX:
emit = WRITEMASK_XY;
nr_texcoords = 2;
break;
case TEXTURE_3D_INDEX:
+ case TEXTURE_2D_ARRAY_INDEX:
case TEXTURE_CUBE_INDEX:
emit = WRITEMASK_XYZ;
nr_texcoords = 3;
case TEXTURE_1D_INDEX:
return WRITEMASK_X;
case TEXTURE_2D_INDEX:
+ case TEXTURE_1D_ARRAY_INDEX:
return WRITEMASK_XY;
case TEXTURE_3D_INDEX:
+ case TEXTURE_2D_ARRAY_INDEX:
return WRITEMASK_XYZ;
case TEXTURE_CUBE_INDEX:
return WRITEMASK_XYZ;
{
switch (target) {
case GL_TEXTURE_1D:
+ case GL_TEXTURE_1D_ARRAY_EXT:
return BRW_SURFACE_1D;
case GL_TEXTURE_RECTANGLE_NV:
return BRW_SURFACE_2D;
case GL_TEXTURE_2D:
+ case GL_TEXTURE_2D_ARRAY_EXT:
return BRW_SURFACE_2D;
case GL_TEXTURE_3D:
ctx->Extensions.ARB_texture_rg = true;
ctx->Extensions.EXT_draw_buffers2 = true;
ctx->Extensions.EXT_framebuffer_sRGB = true;
+ ctx->Extensions.EXT_texture_array = true;
ctx->Extensions.EXT_texture_snorm = true;
ctx->Extensions.EXT_texture_sRGB = true;
ctx->Extensions.EXT_texture_sRGB_decode = true;
ctx->Extensions.EXT_texture_swizzle = true;
ctx->Extensions.EXT_vertex_array_bgra = true;
ctx->Extensions.ATI_envmap_bumpmap = true;
+ ctx->Extensions.MESA_texture_array = true;
ctx->Extensions.NV_conditional_render = true;
}
GLuint level, GLuint face, GLuint depth,
GLuint *x, GLuint *y)
{
- if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) {
+ switch (mt->target) {
+ case GL_TEXTURE_CUBE_MAP_ARB:
*x = mt->level[level].x_offset[face];
*y = mt->level[level].y_offset[face];
- } else if (mt->target == GL_TEXTURE_3D) {
+ break;
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ assert(depth < mt->level[level].nr_images);
*x = mt->level[level].x_offset[depth];
*y = mt->level[level].y_offset[depth];
- } else {
+ break;
+ default:
*x = mt->level[level].x_offset[0];
*y = mt->level[level].y_offset[0];
+ break;
}
}
GLuint y = 0;
GLuint width = mt->width0;
GLuint height = mt->height0;
+ GLuint depth = mt->depth0; /* number of array layers. */
mt->total_width = mt->width0;
intel_get_texture_alignment_unit(mt->format, &align_w, &align_h);
GLuint img_height;
intel_miptree_set_level_info(mt, level, nr_images, x, y, width,
- height, 1);
+ height, depth);
img_height = ALIGN(height, align_h);
if (mt->compressed)
mt = intel_image->mt;
- if (mt->target == GL_TEXTURE_3D) {
+ if (mt->target == GL_TEXTURE_3D ||
+ mt->target == GL_TEXTURE_2D_ARRAY ||
+ mt->target == GL_TEXTURE_1D_ARRAY) {
int i;
+ if (mt->target == GL_TEXTURE_2D_ARRAY ||
+ mt->target == GL_TEXTURE_1D_ARRAY) {
+ /* Mesa only allocates one entry for these, but we really do have an
+ * offset per depth.
+ */
+ free(intel_image->base.Base.ImageOffsets);
+ intel_image->base.Base.ImageOffsets = malloc(mt->level[level].depth *
+ sizeof(GLuint));
+ }
+
/* ImageOffsets[] is only used for swrast's fetch_texel_3d, so we can't
* share code with the normal path.
*/