intel: Store miptree alignment units in the miptree
[mesa.git] / src / mesa / drivers / dri / intel / intel_mipmap_tree.c
1 /**************************************************************************
2 *
3 * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #include "intel_batchbuffer.h"
29 #include "intel_context.h"
30 #include "intel_mipmap_tree.h"
31 #include "intel_regions.h"
32 #include "intel_resolve_map.h"
33 #include "intel_span.h"
34 #include "intel_tex_layout.h"
35 #include "intel_tex.h"
36 #include "intel_blit.h"
37
38 #include "main/enums.h"
39 #include "main/formats.h"
40 #include "main/image.h"
41 #include "main/teximage.h"
42
43 #define FILE_DEBUG_FLAG DEBUG_MIPTREE
44
45 static GLenum
46 target_to_target(GLenum target)
47 {
48 switch (target) {
49 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
50 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
51 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
52 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
53 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
54 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
55 return GL_TEXTURE_CUBE_MAP_ARB;
56 default:
57 return target;
58 }
59 }
60
61 static struct intel_mipmap_tree *
62 intel_miptree_create_internal(struct intel_context *intel,
63 GLenum target,
64 gl_format format,
65 GLuint first_level,
66 GLuint last_level,
67 GLuint width0,
68 GLuint height0,
69 GLuint depth0)
70 {
71 struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
72 int compress_byte = 0;
73
74 DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
75 _mesa_lookup_enum_by_nr(target),
76 _mesa_get_format_name(format),
77 first_level, last_level, mt);
78
79 if (_mesa_is_format_compressed(format))
80 compress_byte = intel_compressed_num_bytes(format);
81
82 mt->target = target_to_target(target);
83 mt->format = format;
84 mt->first_level = first_level;
85 mt->last_level = last_level;
86 mt->width0 = width0;
87 mt->height0 = height0;
88 mt->cpp = compress_byte ? compress_byte : _mesa_get_format_bytes(mt->format);
89 mt->compressed = compress_byte ? 1 : 0;
90 mt->refcount = 1;
91
92 intel_get_texture_alignment_unit(format, &mt->align_w, &mt->align_h);
93
94 if (target == GL_TEXTURE_CUBE_MAP) {
95 assert(depth0 == 1);
96 mt->depth0 = 6;
97 } else {
98 mt->depth0 = depth0;
99 }
100
101 if (format == MESA_FORMAT_S8) {
102 /* The stencil buffer has quirky pitch requirements. From Vol 2a,
103 * 11.5.6.2.1 3DSTATE_STENCIL_BUFFER, field "Surface Pitch":
104 * The pitch must be set to 2x the value computed based on width, as
105 * the stencil buffer is stored with two rows interleaved.
106 */
107 assert(intel->has_separate_stencil);
108 mt->cpp = 2;
109 }
110
111 #ifdef I915
112 (void) intel;
113 if (intel->is_945)
114 i945_miptree_layout(mt);
115 else
116 i915_miptree_layout(mt);
117 #else
118 brw_miptree_layout(intel, mt);
119 #endif
120
121 if (intel->must_use_separate_stencil &&
122 _mesa_is_depthstencil_format(_mesa_get_format_base_format(format))) {
123 mt->stencil_mt = intel_miptree_create(intel,
124 mt->target,
125 MESA_FORMAT_S8,
126 mt->first_level,
127 mt->last_level,
128 mt->width0,
129 mt->height0,
130 mt->depth0,
131 true);
132 if (!mt->stencil_mt) {
133 intel_miptree_release(&mt);
134 return NULL;
135 }
136 }
137
138 return mt;
139 }
140
141
142 struct intel_mipmap_tree *
143 intel_miptree_create(struct intel_context *intel,
144 GLenum target,
145 gl_format format,
146 GLuint first_level,
147 GLuint last_level,
148 GLuint width0,
149 GLuint height0,
150 GLuint depth0,
151 bool expect_accelerated_upload)
152 {
153 struct intel_mipmap_tree *mt;
154 uint32_t tiling = I915_TILING_NONE;
155 GLenum base_format = _mesa_get_format_base_format(format);
156
157 if (intel->use_texture_tiling && !_mesa_is_format_compressed(format)) {
158 if (intel->gen >= 4 &&
159 (base_format == GL_DEPTH_COMPONENT ||
160 base_format == GL_DEPTH_STENCIL_EXT))
161 tiling = I915_TILING_Y;
162 else if (format == MESA_FORMAT_S8)
163 tiling = I915_TILING_NONE;
164 else if (width0 >= 64)
165 tiling = I915_TILING_X;
166 }
167
168 mt = intel_miptree_create_internal(intel, target, format,
169 first_level, last_level, width0,
170 height0, depth0);
171 /*
172 * pitch == 0 || height == 0 indicates the null texture
173 */
174 if (!mt || !mt->total_width || !mt->total_height) {
175 free(mt);
176 return NULL;
177 }
178
179 mt->region = intel_region_alloc(intel->intelScreen,
180 tiling,
181 mt->cpp,
182 mt->total_width,
183 mt->total_height,
184 expect_accelerated_upload);
185
186 if (!mt->region) {
187 free(mt);
188 return NULL;
189 }
190
191 return mt;
192 }
193
194
195 struct intel_mipmap_tree *
196 intel_miptree_create_for_region(struct intel_context *intel,
197 GLenum target,
198 gl_format format,
199 struct intel_region *region)
200 {
201 struct intel_mipmap_tree *mt;
202
203 mt = intel_miptree_create_internal(intel, target, format,
204 0, 0,
205 region->width, region->height, 1);
206 if (!mt)
207 return mt;
208
209 intel_region_reference(&mt->region, region);
210
211 return mt;
212 }
213
214 struct intel_mipmap_tree*
215 intel_miptree_create_for_renderbuffer(struct intel_context *intel,
216 gl_format format,
217 uint32_t tiling,
218 uint32_t cpp,
219 uint32_t width,
220 uint32_t height)
221 {
222 struct intel_region *region;
223 struct intel_mipmap_tree *mt;
224
225 region = intel_region_alloc(intel->intelScreen,
226 tiling, cpp, width, height, true);
227 if (!region)
228 return NULL;
229
230 mt = intel_miptree_create_for_region(intel, GL_TEXTURE_2D, format, region);
231 intel_region_release(&region);
232 return mt;
233 }
234
235 void
236 intel_miptree_reference(struct intel_mipmap_tree **dst,
237 struct intel_mipmap_tree *src)
238 {
239 if (*dst == src)
240 return;
241
242 intel_miptree_release(dst);
243
244 if (src) {
245 src->refcount++;
246 DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
247 }
248
249 *dst = src;
250 }
251
252
253 void
254 intel_miptree_release(struct intel_mipmap_tree **mt)
255 {
256 if (!*mt)
257 return;
258
259 DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1);
260 if (--(*mt)->refcount <= 0) {
261 GLuint i;
262
263 DBG("%s deleting %p\n", __FUNCTION__, *mt);
264
265 intel_region_release(&((*mt)->region));
266 intel_miptree_release(&(*mt)->stencil_mt);
267 intel_miptree_release(&(*mt)->hiz_mt);
268 intel_resolve_map_clear(&(*mt)->hiz_map);
269
270 for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
271 free((*mt)->level[i].slice);
272 }
273
274 free(*mt);
275 }
276 *mt = NULL;
277 }
278
279 void
280 intel_miptree_get_dimensions_for_image(struct gl_texture_image *image,
281 int *width, int *height, int *depth)
282 {
283 switch (image->TexObject->Target) {
284 case GL_TEXTURE_1D_ARRAY:
285 *width = image->Width;
286 *height = 1;
287 *depth = image->Height;
288 break;
289 default:
290 *width = image->Width;
291 *height = image->Height;
292 *depth = image->Depth;
293 break;
294 }
295 }
296
297 /**
298 * Can the image be pulled into a unified mipmap tree? This mirrors
299 * the completeness test in a lot of ways.
300 *
301 * Not sure whether I want to pass gl_texture_image here.
302 */
303 bool
304 intel_miptree_match_image(struct intel_mipmap_tree *mt,
305 struct gl_texture_image *image)
306 {
307 struct intel_texture_image *intelImage = intel_texture_image(image);
308 GLuint level = intelImage->base.Base.Level;
309 int width, height, depth;
310
311 if (image->TexFormat != mt->format)
312 return false;
313
314 intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
315
316 /* Test image dimensions against the base level image adjusted for
317 * minification. This will also catch images not present in the
318 * tree, changed targets, etc.
319 */
320 if (width != mt->level[level].width ||
321 height != mt->level[level].height ||
322 depth != mt->level[level].depth)
323 return false;
324
325 return true;
326 }
327
328
329 void
330 intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
331 GLuint level,
332 GLuint x, GLuint y,
333 GLuint w, GLuint h, GLuint d)
334 {
335 mt->level[level].width = w;
336 mt->level[level].height = h;
337 mt->level[level].depth = d;
338 mt->level[level].level_x = x;
339 mt->level[level].level_y = y;
340
341 DBG("%s level %d size: %d,%d,%d offset %d,%d\n", __FUNCTION__,
342 level, w, h, d, x, y);
343
344 assert(mt->level[level].slice == NULL);
345
346 mt->level[level].slice = malloc(d * sizeof(*mt->level[0].slice));
347 mt->level[level].slice[0].x_offset = mt->level[level].level_x;
348 mt->level[level].slice[0].y_offset = mt->level[level].level_y;
349 }
350
351
352 void
353 intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
354 GLuint level, GLuint img,
355 GLuint x, GLuint y)
356 {
357 if (img == 0 && level == 0)
358 assert(x == 0 && y == 0);
359
360 assert(img < mt->level[level].depth);
361
362 mt->level[level].slice[img].x_offset = mt->level[level].level_x + x;
363 mt->level[level].slice[img].y_offset = mt->level[level].level_y + y;
364
365 DBG("%s level %d img %d pos %d,%d\n",
366 __FUNCTION__, level, img,
367 mt->level[level].slice[img].x_offset,
368 mt->level[level].slice[img].y_offset);
369 }
370
371
372 /**
373 * For cube map textures, either the \c face parameter can be used, of course,
374 * or the cube face can be interpreted as a depth layer and the \c layer
375 * parameter used.
376 */
377 void
378 intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
379 GLuint level, GLuint face, GLuint layer,
380 GLuint *x, GLuint *y)
381 {
382 int slice;
383
384 if (face > 0) {
385 assert(mt->target == GL_TEXTURE_CUBE_MAP);
386 assert(face < 6);
387 assert(layer == 0);
388 slice = face;
389 } else {
390 /* This branch may be taken even if the texture target is a cube map. In
391 * that case, the caller chose to interpret each cube face as a layer.
392 */
393 assert(face == 0);
394 slice = layer;
395 }
396
397 *x = mt->level[level].slice[slice].x_offset;
398 *y = mt->level[level].slice[slice].y_offset;
399 }
400
401 static void
402 intel_miptree_copy_slice(struct intel_context *intel,
403 struct intel_mipmap_tree *dst_mt,
404 struct intel_mipmap_tree *src_mt,
405 int level,
406 int face,
407 int depth)
408
409 {
410 gl_format format = src_mt->format;
411 uint32_t width = src_mt->level[level].width;
412 uint32_t height = src_mt->level[level].height;
413
414 assert(depth < src_mt->level[level].depth);
415
416 if (dst_mt->compressed) {
417 height = ALIGN(height, dst_mt->align_h) / dst_mt->align_h;
418 width = ALIGN(width, dst_mt->align_w);
419 }
420
421 uint32_t dst_x, dst_y, src_x, src_y;
422 intel_miptree_get_image_offset(dst_mt, level, face, depth,
423 &dst_x, &dst_y);
424 intel_miptree_get_image_offset(src_mt, level, face, depth,
425 &src_x, &src_y);
426
427 DBG("validate blit mt %p %d,%d/%d -> mt %p %d,%d/%d (%dx%d)\n",
428 src_mt, src_x, src_y, src_mt->region->pitch * src_mt->region->cpp,
429 dst_mt, dst_x, dst_y, dst_mt->region->pitch * dst_mt->region->cpp,
430 width, height);
431
432 if (!intelEmitCopyBlit(intel,
433 dst_mt->region->cpp,
434 src_mt->region->pitch, src_mt->region->bo,
435 0, src_mt->region->tiling,
436 dst_mt->region->pitch, dst_mt->region->bo,
437 0, dst_mt->region->tiling,
438 src_x, src_y,
439 dst_x, dst_y,
440 width, height,
441 GL_COPY)) {
442
443 fallback_debug("miptree validate blit for %s failed\n",
444 _mesa_get_format_name(format));
445 void *dst = intel_region_map(intel, dst_mt->region, GL_MAP_WRITE_BIT);
446 void *src = intel_region_map(intel, src_mt->region, GL_MAP_READ_BIT);
447
448 _mesa_copy_rect(dst,
449 dst_mt->cpp,
450 dst_mt->region->pitch,
451 dst_x, dst_y,
452 width, height,
453 src, src_mt->region->pitch,
454 src_x, src_y);
455
456 intel_region_unmap(intel, dst_mt->region);
457 intel_region_unmap(intel, src_mt->region);
458 }
459
460 if (src_mt->stencil_mt) {
461 intel_miptree_copy_slice(intel,
462 dst_mt->stencil_mt, src_mt->stencil_mt,
463 level, face, depth);
464 }
465 }
466
467 /**
468 * Copies the image's current data to the given miptree, and associates that
469 * miptree with the image.
470 */
471 void
472 intel_miptree_copy_teximage(struct intel_context *intel,
473 struct intel_texture_image *intelImage,
474 struct intel_mipmap_tree *dst_mt)
475 {
476 struct intel_mipmap_tree *src_mt = intelImage->mt;
477 int level = intelImage->base.Base.Level;
478 int face = intelImage->base.Base.Face;
479 GLuint depth = intelImage->base.Base.Depth;
480
481 for (int slice = 0; slice < depth; slice++) {
482 intel_miptree_copy_slice(intel, dst_mt, src_mt, level, face, slice);
483 }
484
485 intel_miptree_reference(&intelImage->mt, dst_mt);
486 }
487
488 /**
489 * \param scatter Scatter if true. Gather if false.
490 *
491 * \see intel_miptree_s8z24_scatter()
492 * \see intel_miptree_s8z24_gather()
493 */
494 static void
495 intel_miptree_s8z24_scattergather(struct intel_context *intel,
496 struct intel_mipmap_tree *mt,
497 uint32_t level,
498 uint32_t layer,
499 bool scatter)
500 {
501 /* Check function inputs. */
502 assert(level >= mt->first_level);
503 assert(level <= mt->last_level);
504 assert(layer < mt->level[level].depth);
505
506 /* Label everything and its bit layout, just to make the code easier to
507 * read.
508 */
509 struct intel_mipmap_tree *s8_mt = mt->stencil_mt;
510 struct intel_mipmap_level *s8_level = &s8_mt->level[level];
511 struct intel_mipmap_slice *s8_slice = &s8_mt->level[level].slice[layer];
512
513 struct intel_mipmap_tree *s8z24_mt = mt;
514 struct intel_mipmap_level *s8z24_level = &s8z24_mt->level[level];
515 struct intel_mipmap_slice *s8z24_slice = &s8z24_mt->level[level].slice[layer];
516
517 /* Check that both miptree levels have the same dimensions. */
518 assert(s8_level->width == s8z24_level->width);
519 assert(s8_level->height == s8z24_level->height);
520 assert(s8_level->depth == s8z24_level->depth);
521
522 /* Map the buffers. */
523 if (drm_intel_bo_references(intel->batch.bo, s8_mt->region->bo) ||
524 drm_intel_bo_references(intel->batch.bo, s8z24_mt->region->bo)) {
525 intel_batchbuffer_flush(intel);
526 }
527 drm_intel_gem_bo_map_gtt(s8_mt->region->bo);
528 drm_intel_gem_bo_map_gtt(s8z24_mt->region->bo);
529
530 /* Define the invariant values outside the for loop, because I don't trust
531 * GCC to do it for us.
532 */
533 uint8_t *s8_map = s8_mt->region->bo->virtual
534 + s8_slice->x_offset
535 + s8_slice->y_offset;
536
537 uint8_t *s8z24_map = s8z24_mt->region->bo->virtual
538 + s8z24_slice->x_offset
539 + s8z24_slice->y_offset;
540
541 ptrdiff_t s8z24_stride = s8z24_mt->region->pitch * s8z24_mt->region->cpp;
542
543 uint32_t w = s8_level->width;
544 uint32_t h = s8_level->height;
545
546 for (uint32_t y = 0; y < h; ++y) {
547 for (uint32_t x = 0; x < w; ++x) {
548 ptrdiff_t s8_offset = intel_offset_S8(s8_mt->region->pitch, x, y);
549 ptrdiff_t s8z24_offset = y * s8z24_stride
550 + x * 4
551 + 3;
552 if (scatter) {
553 s8_map[s8_offset] = s8z24_map[s8z24_offset];
554 } else {
555 s8z24_map[s8z24_offset] = s8_map[s8_offset];
556 }
557 }
558 }
559
560 drm_intel_gem_bo_unmap_gtt(s8_mt->region->bo);
561 drm_intel_gem_bo_unmap_gtt(s8z24_mt->region->bo);
562 }
563
564 void
565 intel_miptree_s8z24_scatter(struct intel_context *intel,
566 struct intel_mipmap_tree *mt,
567 uint32_t level,
568 uint32_t layer)
569 {
570 intel_miptree_s8z24_scattergather(intel, mt, level, layer, true);
571 }
572
573 void
574 intel_miptree_s8z24_gather(struct intel_context *intel,
575 struct intel_mipmap_tree *mt,
576 uint32_t level,
577 uint32_t layer)
578 {
579 intel_miptree_s8z24_scattergather(intel, mt, level, layer, false);
580 }
581
582 bool
583 intel_miptree_alloc_hiz(struct intel_context *intel,
584 struct intel_mipmap_tree *mt)
585 {
586 assert(mt->hiz_mt == NULL);
587 mt->hiz_mt = intel_miptree_create(intel,
588 mt->target,
589 MESA_FORMAT_X8_Z24,
590 mt->first_level,
591 mt->last_level,
592 mt->width0,
593 mt->height0,
594 mt->depth0,
595 true);
596
597 if (!mt->hiz_mt)
598 return false;
599
600 /* Mark that all slices need a HiZ resolve. */
601 struct intel_resolve_map *head = &mt->hiz_map;
602 for (int level = mt->first_level; level <= mt->last_level; ++level) {
603 for (int layer = 0; layer < mt->level[level].depth; ++layer) {
604 head->next = malloc(sizeof(*head->next));
605 head->next->prev = head;
606 head->next->next = NULL;
607 head = head->next;
608
609 head->level = level;
610 head->layer = layer;
611 head->need = INTEL_NEED_HIZ_RESOLVE;
612 }
613 }
614
615 return true;
616 }
617
618 void
619 intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
620 uint32_t level,
621 uint32_t layer)
622 {
623 intel_miptree_check_level_layer(mt, level, layer);
624
625 if (!mt->hiz_mt)
626 return;
627
628 intel_resolve_map_set(&mt->hiz_map,
629 level, layer, INTEL_NEED_HIZ_RESOLVE);
630 }
631
632
633 void
634 intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
635 uint32_t level,
636 uint32_t layer)
637 {
638 intel_miptree_check_level_layer(mt, level, layer);
639
640 if (!mt->hiz_mt)
641 return;
642
643 intel_resolve_map_set(&mt->hiz_map,
644 level, layer, INTEL_NEED_DEPTH_RESOLVE);
645 }
646
647 typedef void (*resolve_func_t)(struct intel_context *intel,
648 struct intel_mipmap_tree *mt,
649 uint32_t level,
650 uint32_t layer);
651
652 static bool
653 intel_miptree_slice_resolve(struct intel_context *intel,
654 struct intel_mipmap_tree *mt,
655 uint32_t level,
656 uint32_t layer,
657 enum intel_need_resolve need,
658 resolve_func_t func)
659 {
660 intel_miptree_check_level_layer(mt, level, layer);
661
662 struct intel_resolve_map *item =
663 intel_resolve_map_get(&mt->hiz_map, level, layer);
664
665 if (!item || item->need != need)
666 return false;
667
668 func(intel, mt, level, layer);
669 intel_resolve_map_remove(item);
670 return true;
671 }
672
673 bool
674 intel_miptree_slice_resolve_hiz(struct intel_context *intel,
675 struct intel_mipmap_tree *mt,
676 uint32_t level,
677 uint32_t layer)
678 {
679 return intel_miptree_slice_resolve(intel, mt, level, layer,
680 INTEL_NEED_HIZ_RESOLVE,
681 intel->vtbl.resolve_hiz_slice);
682 }
683
684 bool
685 intel_miptree_slice_resolve_depth(struct intel_context *intel,
686 struct intel_mipmap_tree *mt,
687 uint32_t level,
688 uint32_t layer)
689 {
690 return intel_miptree_slice_resolve(intel, mt, level, layer,
691 INTEL_NEED_DEPTH_RESOLVE,
692 intel->vtbl.resolve_depth_slice);
693 }
694
695 static bool
696 intel_miptree_all_slices_resolve(struct intel_context *intel,
697 struct intel_mipmap_tree *mt,
698 enum intel_need_resolve need,
699 resolve_func_t func)
700 {
701 bool did_resolve = false;
702 struct intel_resolve_map *i;
703
704 for (i = mt->hiz_map.next; i; i = i->next) {
705 if (i->need != need)
706 continue;
707 func(intel, mt, i->level, i->layer);
708 intel_resolve_map_remove(i);
709 did_resolve = true;
710 }
711
712 return did_resolve;
713 }
714
715 bool
716 intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
717 struct intel_mipmap_tree *mt)
718 {
719 return intel_miptree_all_slices_resolve(intel, mt,
720 INTEL_NEED_HIZ_RESOLVE,
721 intel->vtbl.resolve_hiz_slice);
722 }
723
724 bool
725 intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
726 struct intel_mipmap_tree *mt)
727 {
728 return intel_miptree_all_slices_resolve(intel, mt,
729 INTEL_NEED_DEPTH_RESOLVE,
730 intel->vtbl.resolve_depth_slice);
731 }