summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-07-18 22:00:30 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-07-20 08:19:22 -0700
commite19b7f7f1b5d6a1d325c0129d6d6b9da6234330a (patch)
tree101b5b42868c84a5a7901b6298ba60a5337e5b4d /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parentd4d505d0b04b9bce7c346fe0710df9921861edd6 (diff)
downloadexternal_mesa3d-e19b7f7f1b5d6a1d325c0129d6d6b9da6234330a.zip
external_mesa3d-e19b7f7f1b5d6a1d325c0129d6d6b9da6234330a.tar.gz
external_mesa3d-e19b7f7f1b5d6a1d325c0129d6d6b9da6234330a.tar.bz2
i965/miptree: Set logical_depth0 == 6 for cube maps
This matches what we do for cube maps where logical_depth0 is in number of face-layers rather than number of cubes. This does mean that we will temporarily be setting the surface bounds too loose for cube map textures but we are already setting them too loose for cube arrays and we will be fixing that in the next commit anyway. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Chris Forbes <chrisforbes@google.com> Cc: "12.0 11.2 11.1" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 10158fe..1e03f7e 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -499,10 +499,8 @@ intel_miptree_create_layout(struct brw_context *brw,
}
}
- if (target == GL_TEXTURE_CUBE_MAP) {
- assert(depth0 == 1);
- depth0 = 6;
- }
+ if (target == GL_TEXTURE_CUBE_MAP)
+ assert(depth0 == 6);
mt->physical_width0 = width0;
mt->physical_height0 = height0;
@@ -1036,6 +1034,15 @@ intel_get_image_dims(struct gl_texture_image *image,
*height = 1;
*depth = image->Height;
break;
+ case GL_TEXTURE_CUBE_MAP:
+ /* For Cube maps, the mesa/main api layer gives us a depth of 1 even
+ * though we really have 6 slices.
+ */
+ assert(image->Depth == 1);
+ *width = image->Width;
+ *height = image->Height;
+ *depth = 6;
+ break;
default:
*width = image->Width;
*height = image->Height;