summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2015-02-18 18:27:45 +0000
committerNeil Roberts <[email protected]>2015-03-02 11:57:37 +0000
commit0f1e86afd65952df00b82e55c4b7371645cf6fbc (patch)
tree3e1a470b4d645c2970a592d58ee84e2b66aec330 /src/mesa
parentaef8a4897937c0c06c7b01e39de23117a6e81d3e (diff)
i965/skl: Lay out 3D textures the same as array textures
On Gen9+ the 3D textures use the same mipmap layout as 2D array textures. Reviewed-by: Ben Widawsky <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex_layout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 66d1b4f0256..6923a8f4f1d 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -227,6 +227,9 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt)
width = minify(width, 1);
height = minify(height, 1);
+
+ if (mt->target == GL_TEXTURE_3D)
+ depth = minify(depth, 1);
}
}
@@ -266,7 +269,7 @@ brw_miptree_layout_texture_array(struct brw_context *brw,
if (mt->compressed)
img_height /= mt->align_h;
- for (int q = 0; q < mt->physical_depth0; q++) {
+ for (int q = 0; q < mt->level[level].depth; q++) {
if (mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
intel_miptree_set_image_offset(mt, level, q, 0, q * img_height);
} else {
@@ -371,7 +374,10 @@ brw_miptree_layout(struct brw_context *brw, struct intel_mipmap_tree *mt)
break;
case GL_TEXTURE_3D:
- brw_miptree_layout_texture_3d(brw, mt);
+ if (brw->gen >= 9)
+ brw_miptree_layout_texture_array(brw, mt);
+ else
+ brw_miptree_layout_texture_3d(brw, mt);
break;
case GL_TEXTURE_1D_ARRAY: