i965/miptree: Delete an unused function declaration
[mesa.git] / src / mesa / drivers / dri / i965 / intel_mipmap_tree.h
1 /*
2 * Copyright 2006 VMware, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26 /** @file intel_mipmap_tree.h
27 *
28 * This file defines the structure that wraps a BO and describes how the
29 * mipmap levels and slices of a texture are laid out.
30 *
31 * The hardware has a fixed layout of a texture depending on parameters such
32 * as the target/type (2D, 3D, CUBE), width, height, pitch, and number of
33 * mipmap levels. The individual level/layer slices are each 2D rectangles of
34 * pixels at some x/y offset from the start of the brw_bo.
35 *
36 * Original OpenGL allowed texture miplevels to be specified in arbitrary
37 * order, and a texture may change size over time. Thus, each
38 * intel_texture_image has a reference to a miptree that contains the pixel
39 * data sized appropriately for it, which will later be referenced by/copied
40 * to the intel_texture_object at draw time (intel_finalize_mipmap_tree()) so
41 * that there's a single miptree for the complete texture.
42 */
43
44 #ifndef INTEL_MIPMAP_TREE_H
45 #define INTEL_MIPMAP_TREE_H
46
47 #include <assert.h>
48
49 #include "main/mtypes.h"
50 #include "isl/isl.h"
51 #include "blorp/blorp.h"
52 #include "brw_bufmgr.h"
53 #include <GL/internal/dri_interface.h>
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 struct brw_context;
60 struct intel_renderbuffer;
61
62 struct intel_texture_image;
63
64 /**
65 * This bit extends the set of GL_MAP_*_BIT enums.
66 *
67 * When calling intel_miptree_map() on an ETC-transcoded-to-RGB miptree or a
68 * depthstencil-split-to-separate-stencil miptree, we'll normally make a
69 * temporary and recreate the kind of data requested by Mesa core, since we're
70 * satisfying some glGetTexImage() request or something.
71 *
72 * However, occasionally you want to actually map the miptree's current data
73 * without transcoding back. This flag to intel_miptree_map() gets you that.
74 */
75 #define BRW_MAP_DIRECT_BIT 0x80000000
76
77 struct intel_miptree_map {
78 /** Bitfield of GL_MAP_*_BIT and BRW_MAP_*_BIT. */
79 GLbitfield mode;
80 /** Region of interest for the map. */
81 int x, y, w, h;
82 /** Possibly malloced temporary buffer for the mapping. */
83 void *buffer;
84 /** Possible pointer to a temporary linear miptree for the mapping. */
85 struct intel_mipmap_tree *linear_mt;
86 /** Pointer to the start of (map_x, map_y) returned by the mapping. */
87 void *ptr;
88 /** Stride of the mapping. */
89 int stride;
90 };
91
92 /**
93 * Describes the location of each texture image within a miptree.
94 */
95 struct intel_mipmap_level
96 {
97 /** Offset to this miptree level, used in computing x_offset. */
98 GLuint level_x;
99 /** Offset to this miptree level, used in computing y_offset. */
100 GLuint level_y;
101
102 /**
103 * \brief Is HiZ enabled for this level?
104 *
105 * If \c mt->level[l].has_hiz is set, then (1) \c mt->hiz_mt has been
106 * allocated and (2) the HiZ memory for the slices in this level reside at
107 * \c mt->hiz_mt->level[l].
108 */
109 bool has_hiz;
110
111 /**
112 * \brief List of 2D images in this mipmap level.
113 *
114 * This may be a list of cube faces, array slices in 2D array texture, or
115 * layers in a 3D texture. The list's length is \c depth.
116 */
117 struct intel_mipmap_slice {
118 /**
119 * Mapping information. Persistent for the duration of
120 * intel_miptree_map/unmap on this slice.
121 */
122 struct intel_miptree_map *map;
123 } *slice;
124 };
125
126 /**
127 * Miptree aux buffer. These buffers are associated with a miptree, but the
128 * format is managed by the hardware.
129 *
130 * For Gen7+, we always give the hardware the start of the buffer, and let it
131 * handle all accesses to the buffer. Therefore we don't need the full miptree
132 * layout structure for this buffer.
133 */
134 struct intel_miptree_aux_buffer
135 {
136 struct isl_surf surf;
137
138 /**
139 * Buffer object containing the pixel data.
140 *
141 * @see RENDER_SURFACE_STATE.AuxiliarySurfaceBaseAddress
142 * @see 3DSTATE_HIER_DEPTH_BUFFER.AuxiliarySurfaceBaseAddress
143 */
144 struct brw_bo *bo;
145
146 /**
147 * Offset into bo where the surface starts.
148 *
149 * @see intel_mipmap_aux_buffer::bo
150 *
151 * @see RENDER_SURFACE_STATE.AuxiliarySurfaceBaseAddress
152 * @see 3DSTATE_DEPTH_BUFFER.SurfaceBaseAddress
153 * @see 3DSTATE_HIER_DEPTH_BUFFER.SurfaceBaseAddress
154 * @see 3DSTATE_STENCIL_BUFFER.SurfaceBaseAddress
155 */
156 uint32_t offset;
157
158 /*
159 * Size of the MCS surface.
160 *
161 * This is needed when doing any gtt mapped operations on the buffer (which
162 * will be Y-tiled). It is possible that it will not be the same as bo->size
163 * when the drm allocator rounds up the requested size.
164 */
165 size_t size;
166
167 /**
168 * Pitch in bytes.
169 *
170 * @see RENDER_SURFACE_STATE.AuxiliarySurfacePitch
171 * @see 3DSTATE_HIER_DEPTH_BUFFER.SurfacePitch
172 */
173 uint32_t pitch;
174
175 /**
176 * The distance in rows between array slices.
177 *
178 * @see RENDER_SURFACE_STATE.AuxiliarySurfaceQPitch
179 * @see 3DSTATE_HIER_DEPTH_BUFFER.SurfaceQPitch
180 */
181 uint32_t qpitch;
182 };
183
184 struct intel_mipmap_tree
185 {
186 struct isl_surf surf;
187
188 /**
189 * Buffer object containing the surface.
190 *
191 * @see intel_mipmap_tree::offset
192 * @see RENDER_SURFACE_STATE.SurfaceBaseAddress
193 * @see RENDER_SURFACE_STATE.AuxiliarySurfaceBaseAddress
194 * @see 3DSTATE_DEPTH_BUFFER.SurfaceBaseAddress
195 * @see 3DSTATE_HIER_DEPTH_BUFFER.SurfaceBaseAddress
196 * @see 3DSTATE_STENCIL_BUFFER.SurfaceBaseAddress
197 */
198 struct brw_bo *bo;
199
200 /**
201 * @brief One of GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, etc.
202 *
203 * @see RENDER_SURFACE_STATE.SurfaceType
204 * @see RENDER_SURFACE_STATE.SurfaceArray
205 * @see 3DSTATE_DEPTH_BUFFER.SurfaceType
206 */
207 GLenum target;
208
209 /**
210 * Generally, this is just the same as the gl_texture_image->TexFormat or
211 * gl_renderbuffer->Format.
212 *
213 * However, for textures and renderbuffers with packed depth/stencil formats
214 * on hardware where we want or need to use separate stencil, there will be
215 * two miptrees for storing the data. If the depthstencil texture or rb is
216 * MESA_FORMAT_Z32_FLOAT_S8X24_UINT, then mt->format will be
217 * MESA_FORMAT_Z_FLOAT32, otherwise for MESA_FORMAT_Z24_UNORM_S8_UINT objects it will be
218 * MESA_FORMAT_Z24_UNORM_X8_UINT.
219 *
220 * For ETC1/ETC2 textures, this is one of the uncompressed mesa texture
221 * formats if the hardware lacks support for ETC1/ETC2. See @ref etc_format.
222 *
223 * @see RENDER_SURFACE_STATE.SurfaceFormat
224 * @see 3DSTATE_DEPTH_BUFFER.SurfaceFormat
225 */
226 mesa_format format;
227
228 /**
229 * This variable stores the value of ETC compressed texture format
230 *
231 * @see RENDER_SURFACE_STATE.SurfaceFormat
232 */
233 mesa_format etc_format;
234
235 GLuint first_level;
236 GLuint last_level;
237
238 /** Bytes per pixel (or bytes per block if compressed) */
239 GLuint cpp;
240
241 bool compressed;
242
243 /* Includes image offset tables: */
244 struct intel_mipmap_level level[MAX_TEXTURE_LEVELS];
245
246 /**
247 * Offset into bo where the surface starts.
248 *
249 * @see intel_mipmap_tree::bo
250 *
251 * @see RENDER_SURFACE_STATE.AuxiliarySurfaceBaseAddress
252 * @see 3DSTATE_DEPTH_BUFFER.SurfaceBaseAddress
253 * @see 3DSTATE_HIER_DEPTH_BUFFER.SurfaceBaseAddress
254 * @see 3DSTATE_STENCIL_BUFFER.SurfaceBaseAddress
255 */
256 uint32_t offset;
257
258 /**
259 * \brief HiZ aux buffer
260 *
261 * To allocate the hiz buffer, use intel_miptree_alloc_hiz().
262 *
263 * To determine if hiz is enabled, do not check this pointer. Instead, use
264 * intel_miptree_level_has_hiz().
265 */
266 struct intel_miptree_aux_buffer *hiz_buf;
267
268 /**
269 * \brief The type of auxiliary compression used by this miptree.
270 *
271 * This describes the type of auxiliary compression that is intended to be
272 * used by this miptree. An aux usage of ISL_AUX_USAGE_NONE means that
273 * auxiliary compression is permanently disabled. An aux usage other than
274 * ISL_AUX_USAGE_NONE does not imply that the auxiliary buffer has actually
275 * been allocated nor does it imply that auxiliary compression will always
276 * be enabled for this surface. For instance, with CCS_D, we may allocate
277 * the CCS on-the-fly and it may not be used for texturing if the miptree
278 * is fully resolved.
279 */
280 enum isl_aux_usage aux_usage;
281
282 /**
283 * \brief Whether or not this miptree supports fast clears.
284 */
285 bool supports_fast_clear;
286
287 /**
288 * \brief Maps miptree slices to their current aux state
289 *
290 * This two-dimensional array is indexed as [level][layer] and stores an
291 * aux state for each slice.
292 */
293 enum isl_aux_state **aux_state;
294
295 /**
296 * \brief Stencil miptree for depthstencil textures.
297 *
298 * This miptree is used for depthstencil textures and renderbuffers that
299 * require separate stencil. It always has the true copy of the stencil
300 * bits, regardless of mt->format.
301 *
302 * \see 3DSTATE_STENCIL_BUFFER
303 * \see intel_miptree_map_depthstencil()
304 * \see intel_miptree_unmap_depthstencil()
305 */
306 struct intel_mipmap_tree *stencil_mt;
307
308 /**
309 * \brief Stencil texturing miptree for sampling from a stencil texture
310 *
311 * Some hardware doesn't support sampling from the stencil texture as
312 * required by the GL_ARB_stencil_texturing extenion. To workaround this we
313 * blit the texture into a new texture that can be sampled.
314 *
315 * \see intel_update_r8stencil()
316 */
317 struct intel_mipmap_tree *r8stencil_mt;
318 bool r8stencil_needs_update;
319
320 /**
321 * \brief MCS auxiliary buffer.
322 *
323 * This buffer contains the "multisample control surface", which stores
324 * the necessary information to implement compressed MSAA
325 * (INTEL_MSAA_FORMAT_CMS) and "fast color clear" behaviour on Gen7+.
326 *
327 * NULL if no MCS buffer is in use for this surface.
328 */
329 struct intel_miptree_aux_buffer *mcs_buf;
330
331 /**
332 * Planes 1 and 2 in case this is a planar surface.
333 */
334 struct intel_mipmap_tree *plane[2];
335
336 /**
337 * Fast clear color for this surface. For depth surfaces, the clear value
338 * is stored as a float32 in the red component.
339 */
340 union isl_color_value fast_clear_color;
341
342 /* These are also refcounted:
343 */
344 GLuint refcount;
345 };
346
347 bool
348 intel_miptree_alloc_ccs(struct brw_context *brw,
349 struct intel_mipmap_tree *mt);
350
351 enum {
352 MIPTREE_LAYOUT_ACCELERATED_UPLOAD = 1 << 0,
353 MIPTREE_LAYOUT_DISABLE_AUX = 1 << 3,
354
355 MIPTREE_LAYOUT_TILING_Y = 1 << 5,
356 MIPTREE_LAYOUT_TILING_NONE = 1 << 6,
357 MIPTREE_LAYOUT_TILING_ANY = MIPTREE_LAYOUT_TILING_Y |
358 MIPTREE_LAYOUT_TILING_NONE,
359 };
360
361 struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
362 GLenum target,
363 mesa_format format,
364 GLuint first_level,
365 GLuint last_level,
366 GLuint width0,
367 GLuint height0,
368 GLuint depth0,
369 GLuint num_samples,
370 uint32_t flags);
371
372 struct intel_mipmap_tree *
373 intel_miptree_create_for_bo(struct brw_context *brw,
374 struct brw_bo *bo,
375 mesa_format format,
376 uint32_t offset,
377 uint32_t width,
378 uint32_t height,
379 uint32_t depth,
380 int pitch,
381 uint32_t layout_flags);
382
383 struct intel_mipmap_tree *
384 intel_miptree_create_for_dri_image(struct brw_context *brw,
385 __DRIimage *image,
386 GLenum target,
387 enum isl_colorspace colorspace,
388 bool is_winsys_image);
389
390 bool
391 intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
392 struct intel_renderbuffer *irb,
393 struct intel_mipmap_tree *singlesample_mt,
394 uint32_t width, uint32_t height,
395 uint32_t pitch);
396
397 /**
398 * Create a miptree appropriate as the storage for a non-texture renderbuffer.
399 * The miptree has the following properties:
400 * - The target is GL_TEXTURE_2D.
401 * - There are no levels other than the base level 0.
402 * - Depth is 1.
403 */
404 struct intel_mipmap_tree*
405 intel_miptree_create_for_renderbuffer(struct brw_context *brw,
406 mesa_format format,
407 uint32_t width,
408 uint32_t height,
409 uint32_t num_samples);
410
411 mesa_format
412 intel_depth_format_for_depthstencil_format(mesa_format format);
413
414 mesa_format
415 intel_lower_compressed_format(struct brw_context *brw, mesa_format format);
416
417 unsigned
418 brw_get_num_logical_layers(const struct intel_mipmap_tree *mt, unsigned level);
419
420 /** \brief Assert that the level and layer are valid for the miptree. */
421 void
422 intel_miptree_check_level_layer(const struct intel_mipmap_tree *mt,
423 uint32_t level,
424 uint32_t layer);
425
426 void intel_miptree_reference(struct intel_mipmap_tree **dst,
427 struct intel_mipmap_tree *src);
428
429 void intel_miptree_release(struct intel_mipmap_tree **mt);
430
431 /* Check if an image fits an existing mipmap tree layout
432 */
433 bool intel_miptree_match_image(struct intel_mipmap_tree *mt,
434 struct gl_texture_image *image);
435
436 void
437 intel_miptree_get_image_offset(const struct intel_mipmap_tree *mt,
438 GLuint level, GLuint slice,
439 GLuint *x, GLuint *y);
440
441 enum isl_surf_dim
442 get_isl_surf_dim(GLenum target);
443
444 enum isl_dim_layout
445 get_isl_dim_layout(const struct gen_device_info *devinfo,
446 enum isl_tiling tiling, GLenum target);
447
448 enum isl_aux_usage
449 intel_miptree_get_aux_isl_usage(const struct brw_context *brw,
450 const struct intel_mipmap_tree *mt);
451
452 void
453 intel_get_image_dims(struct gl_texture_image *image,
454 int *width, int *height, int *depth);
455
456 void
457 intel_get_tile_masks(enum isl_tiling tiling, uint32_t cpp,
458 uint32_t *mask_x, uint32_t *mask_y);
459
460 void
461 intel_get_tile_dims(enum isl_tiling tiling, uint32_t cpp,
462 uint32_t *tile_w, uint32_t *tile_h);
463
464 uint32_t
465 intel_miptree_get_tile_offsets(const struct intel_mipmap_tree *mt,
466 GLuint level, GLuint slice,
467 uint32_t *tile_x,
468 uint32_t *tile_y);
469 uint32_t
470 intel_miptree_get_aligned_offset(const struct intel_mipmap_tree *mt,
471 uint32_t x, uint32_t y);
472
473 void
474 intel_miptree_copy_slice(struct brw_context *brw,
475 struct intel_mipmap_tree *src_mt,
476 unsigned src_level, unsigned src_layer,
477 struct intel_mipmap_tree *dst_mt,
478 unsigned dst_level, unsigned dst_layer);
479
480 void
481 intel_miptree_copy_teximage(struct brw_context *brw,
482 struct intel_texture_image *intelImage,
483 struct intel_mipmap_tree *dst_mt, bool invalidate);
484
485 /**
486 * \name Miptree HiZ functions
487 * \{
488 *
489 * It is safe to call the "slice_set_need_resolve" and "slice_resolve"
490 * functions on a miptree without HiZ. In that case, each function is a no-op.
491 */
492
493 /**
494 * \brief Allocate the miptree's embedded HiZ miptree.
495 * \see intel_mipmap_tree:hiz_mt
496 * \return false if allocation failed
497 */
498 bool
499 intel_miptree_alloc_hiz(struct brw_context *brw,
500 struct intel_mipmap_tree *mt);
501
502 bool
503 intel_miptree_level_has_hiz(const struct intel_mipmap_tree *mt, uint32_t level);
504
505 /**\}*/
506
507 bool
508 intel_miptree_has_color_unresolved(const struct intel_mipmap_tree *mt,
509 unsigned start_level, unsigned num_levels,
510 unsigned start_layer, unsigned num_layers);
511
512
513 #define INTEL_REMAINING_LAYERS UINT32_MAX
514 #define INTEL_REMAINING_LEVELS UINT32_MAX
515
516 /** Prepare a miptree for access
517 *
518 * This function should be called prior to any access to miptree in order to
519 * perform any needed resolves.
520 *
521 * \param[in] start_level The first mip level to be accessed
522 *
523 * \param[in] num_levels The number of miplevels to be accessed or
524 * INTEL_REMAINING_LEVELS to indicate every level
525 * above start_level will be accessed
526 *
527 * \param[in] start_layer The first array slice or 3D layer to be accessed
528 *
529 * \param[in] num_layers The number of array slices or 3D layers be
530 * accessed or INTEL_REMAINING_LAYERS to indicate
531 * every layer above start_layer will be accessed
532 *
533 * \param[in] aux_supported Whether or not the access will support the
534 * miptree's auxiliary compression format; this
535 * must be false for uncompressed miptrees
536 *
537 * \param[in] fast_clear_supported Whether or not the access will support
538 * fast clears in the miptree's auxiliary
539 * compression format
540 */
541 void
542 intel_miptree_prepare_access(struct brw_context *brw,
543 struct intel_mipmap_tree *mt,
544 uint32_t start_level, uint32_t num_levels,
545 uint32_t start_layer, uint32_t num_layers,
546 enum isl_aux_usage aux_usage,
547 bool fast_clear_supported);
548
549 /** Complete a write operation
550 *
551 * This function should be called after any operation writes to a miptree.
552 * This will update the miptree's compression state so that future resolves
553 * happen correctly. Technically, this function can be called before the
554 * write occurs but the caller must ensure that they don't interlace
555 * intel_miptree_prepare_access and intel_miptree_finish_write calls to
556 * overlapping layer/level ranges.
557 *
558 * \param[in] level The mip level that was written
559 *
560 * \param[in] start_layer The first array slice or 3D layer written
561 *
562 * \param[in] num_layers The number of array slices or 3D layers
563 * written or INTEL_REMAINING_LAYERS to indicate
564 * every layer above start_layer was written
565 *
566 * \param[in] written_with_aux Whether or not the write was done with
567 * auxiliary compression enabled
568 */
569 void
570 intel_miptree_finish_write(struct brw_context *brw,
571 struct intel_mipmap_tree *mt, uint32_t level,
572 uint32_t start_layer, uint32_t num_layers,
573 enum isl_aux_usage aux_usage);
574
575 /** Get the auxiliary compression state of a miptree slice */
576 enum isl_aux_state
577 intel_miptree_get_aux_state(const struct intel_mipmap_tree *mt,
578 uint32_t level, uint32_t layer);
579
580 /** Set the auxiliary compression state of a miptree slice range
581 *
582 * This function directly sets the auxiliary compression state of a slice
583 * range of a miptree. It only modifies data structures and does not do any
584 * resolves. This should only be called by code which directly performs
585 * compression operations such as fast clears and resolves. Most code should
586 * use intel_miptree_prepare_access or intel_miptree_finish_write.
587 */
588 void
589 intel_miptree_set_aux_state(struct brw_context *brw,
590 struct intel_mipmap_tree *mt, uint32_t level,
591 uint32_t start_layer, uint32_t num_layers,
592 enum isl_aux_state aux_state);
593
594 /**
595 * Prepare a miptree for raw access
596 *
597 * This helper prepares the miptree for access that knows nothing about any
598 * sort of compression whatsoever. This is useful when mapping the surface or
599 * using it with the blitter.
600 */
601 static inline void
602 intel_miptree_access_raw(struct brw_context *brw,
603 struct intel_mipmap_tree *mt,
604 uint32_t level, uint32_t layer,
605 bool write)
606 {
607 intel_miptree_prepare_access(brw, mt, level, 1, layer, 1, false, false);
608 if (write)
609 intel_miptree_finish_write(brw, mt, level, layer, 1, false);
610 }
611
612 enum isl_aux_usage
613 intel_miptree_texture_aux_usage(struct brw_context *brw,
614 struct intel_mipmap_tree *mt,
615 enum isl_format view_format);
616 void
617 intel_miptree_prepare_texture(struct brw_context *brw,
618 struct intel_mipmap_tree *mt,
619 enum isl_format view_format,
620 bool *aux_supported_out);
621 void
622 intel_miptree_prepare_image(struct brw_context *brw,
623 struct intel_mipmap_tree *mt);
624 void
625 intel_miptree_prepare_fb_fetch(struct brw_context *brw,
626 struct intel_mipmap_tree *mt, uint32_t level,
627 uint32_t start_layer, uint32_t num_layers);
628 enum isl_aux_usage
629 intel_miptree_render_aux_usage(struct brw_context *brw,
630 struct intel_mipmap_tree *mt,
631 bool srgb_enabled, bool blend_enabled);
632 void
633 intel_miptree_prepare_render(struct brw_context *brw,
634 struct intel_mipmap_tree *mt, uint32_t level,
635 uint32_t start_layer, uint32_t layer_count,
636 bool srgb_enabled, bool blend_enabled);
637 void
638 intel_miptree_finish_render(struct brw_context *brw,
639 struct intel_mipmap_tree *mt, uint32_t level,
640 uint32_t start_layer, uint32_t layer_count,
641 bool srgb_enabled, bool blend_enabled);
642 void
643 intel_miptree_prepare_depth(struct brw_context *brw,
644 struct intel_mipmap_tree *mt, uint32_t level,
645 uint32_t start_layer, uint32_t layer_count);
646 void
647 intel_miptree_finish_depth(struct brw_context *brw,
648 struct intel_mipmap_tree *mt, uint32_t level,
649 uint32_t start_layer, uint32_t layer_count,
650 bool depth_written);
651
652 void
653 intel_miptree_make_shareable(struct brw_context *brw,
654 struct intel_mipmap_tree *mt);
655
656 void
657 intel_miptree_updownsample(struct brw_context *brw,
658 struct intel_mipmap_tree *src,
659 struct intel_mipmap_tree *dst);
660
661 void
662 intel_update_r8stencil(struct brw_context *brw,
663 struct intel_mipmap_tree *mt);
664
665 void
666 intel_miptree_map(struct brw_context *brw,
667 struct intel_mipmap_tree *mt,
668 unsigned int level,
669 unsigned int slice,
670 unsigned int x,
671 unsigned int y,
672 unsigned int w,
673 unsigned int h,
674 GLbitfield mode,
675 void **out_ptr,
676 ptrdiff_t *out_stride);
677
678 void
679 intel_miptree_unmap(struct brw_context *brw,
680 struct intel_mipmap_tree *mt,
681 unsigned int level,
682 unsigned int slice);
683
684 bool
685 intel_miptree_sample_with_hiz(struct brw_context *brw,
686 struct intel_mipmap_tree *mt);
687
688 #ifdef __cplusplus
689 }
690 #endif
691
692 #endif