intel_clear.c \
intel_extensions.c \
intel_mipmap_tree.c \
- intel_resolve_map.c \
intel_tex_layout.c \
intel_tex_image.c \
intel_tex_subimage.c \
i830_update_provoking_vertex(&intel->ctx);
}
-static bool
-i830_is_hiz_depth_format(struct intel_context *intel, gl_format format)
-{
- return false;
-}
-
void
i830InitVtbl(struct i830_context *i830)
{
i830->intel.vtbl.finish_batch = intel_finish_vb;
i830->intel.vtbl.invalidate_state = i830_invalidate_state;
i830->intel.vtbl.render_target_supported = i830_render_target_supported;
- i830->intel.vtbl.is_hiz_depth_format = i830_is_hiz_depth_format;
}
(void) dirty;
}
-/** Return false; i915 does not support HiZ. */
-static bool
-i915_is_hiz_depth_format(struct intel_context *intel,
- gl_format format)
-{
- return false;
-}
-
static void
i915_invalidate_state(struct intel_context *intel, GLuint new_state)
{
i915->intel.vtbl.finish_batch = intel_finish_vb;
i915->intel.vtbl.invalidate_state = i915_invalidate_state;
i915->intel.vtbl.render_target_supported = i915_render_target_supported;
- i915->intel.vtbl.is_hiz_depth_format = i915_is_hiz_depth_format;
}
return false;
}
- /* The blitter has no idea about HiZ or fast color clears, so we need to
- * resolve the miptrees before we do anything.
+ /* The blitter has no idea about fast color clears, so we need to resolve
+ * the miptrees before we do anything.
*/
- intel_miptree_slice_resolve_depth(intel, src_mt, src_level, src_slice);
- intel_miptree_slice_resolve_depth(intel, dst_mt, dst_level, dst_slice);
intel_miptree_resolve_color(intel, src_mt);
intel_miptree_resolve_color(intel, dst_mt);
intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil;
intel->must_use_separate_stencil = intel->intelScreen->hw_must_use_separate_stencil;
- intel->has_hiz = intel->gen >= 6;
intel->has_llc = intel->intelScreen->hw_has_llc;
intel->has_swizzling = intel->intelScreen->hw_has_swizzling;
intel->use_early_z = driQueryOptionb(&intel->optionCache, "early_z");
- if (!driQueryOptionb(&intel->optionCache, "hiz")) {
- intel->has_hiz = false;
- /* On gen6, you can only do separate stencil with HIZ. */
- if (intel->gen == 6)
- intel->has_separate_stencil = false;
- }
-
intel->prim.primitive = ~0;
/* Force all software fallbacks */
bool (*render_target_supported)(struct intel_context *intel,
struct gl_renderbuffer *rb);
- /** Can HiZ be enabled on a depthbuffer of the given format? */
- bool (*is_hiz_depth_format)(struct intel_context *intel,
- gl_format format);
-
/**
* Surface state operations (i965+ only)
* \{
uint32_t *out_offset,
bool dword_pitch);
/** \} */
-
- /**
- * Send the appropriate state packets to configure depth, stencil, and
- * HiZ buffers (i965+ only)
- */
- void (*emit_depth_stencil_hiz)(struct brw_context *brw,
- struct intel_mipmap_tree *depth_mt,
- uint32_t depth_offset,
- uint32_t depthbuffer_format,
- uint32_t depth_surface_type,
- struct intel_mipmap_tree *stencil_mt,
- bool hiz, bool separate_stencil,
- uint32_t width, uint32_t height,
- uint32_t tile_x, uint32_t tile_y);
-
} vtbl;
GLbitfield Fallback; /**< mask of INTEL_FALLBACK_x bits */
bool is_945;
bool has_separate_stencil;
bool must_use_separate_stencil;
- bool has_hiz;
bool has_llc;
bool has_swizzling;
intel_renderbuffer_set_draw_offset(irb);
- if (mt->hiz_mt == NULL &&
- intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
- intel_miptree_alloc_hiz(intel, mt);
- if (!mt->hiz_mt)
- return false;
- }
-
return true;
}
"instead of S8\n",
_mesa_get_format_name(stencil_mt->format));
}
- if (intel->gen < 7 && !intel_renderbuffer_has_hiz(depthRb)) {
- /* Before Gen7, separate depth and stencil buffers can be used
- * only if HiZ is enabled. From the Sandybridge PRM, Volume 2,
- * Part 1, Bit 3DSTATE_DEPTH_BUFFER.SeparateStencilBufferEnable:
- * [DevSNB]: This field must be set to the same value (enabled
- * or disabled) as Hierarchical Depth Buffer Enable.
- */
- fbo_incomplete(fb, "FBO incomplete: separate stencil "
- "without HiZ\n");
- }
}
}
irb->mt->need_downsample = true;
}
-/**
- * Does the renderbuffer have hiz enabled?
- */
-bool
-intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb)
-{
- return intel_miptree_slice_has_hiz(irb->mt, irb->mt_level, irb->mt_layer);
-}
-
-void
-intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb)
-{
- if (irb->mt) {
- intel_miptree_slice_set_needs_hiz_resolve(irb->mt,
- irb->mt_level,
- irb->mt_layer);
- }
-}
-
-void
-intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb)
-{
- if (irb->mt) {
- intel_miptree_slice_set_needs_depth_resolve(irb->mt,
- irb->mt_level,
- irb->mt_layer);
- }
-}
-
-bool
-intel_renderbuffer_resolve_hiz(struct intel_context *intel,
- struct intel_renderbuffer *irb)
-{
- if (irb->mt)
- return intel_miptree_slice_resolve_hiz(intel,
- irb->mt,
- irb->mt_level,
- irb->mt_layer);
-
- return false;
-}
-
-bool
-intel_renderbuffer_resolve_depth(struct intel_context *intel,
- struct intel_renderbuffer *irb)
-{
- if (irb->mt)
- return intel_miptree_slice_resolve_depth(intel,
- irb->mt,
- irb->mt_level,
- irb->mt_layer);
-
- return false;
-}
-
void
intel_renderbuffer_move_to_temp(struct intel_context *intel,
struct intel_renderbuffer *irb,
irb->mt->num_samples,
INTEL_MIPTREE_TILING_ANY);
- if (intel->vtbl.is_hiz_depth_format(intel, new_mt->format)) {
- intel_miptree_alloc_hiz(intel, new_mt);
- }
-
intel_miptree_copy_teximage(intel, intel_image, new_mt, invalidate);
intel_miptree_reference(&irb->mt, intel_image->mt);
void
intel_renderbuffer_set_needs_downsample(struct intel_renderbuffer *irb);
-bool
-intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb);
-
-void
-intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb);
-
-void
-intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb);
-
-
-/**
- * \brief Perform a HiZ resolve on the renderbuffer.
- *
- * It is safe to call this function on a renderbuffer without HiZ. In that
- * case, the function is a no-op.
- *
- * \return false if no resolve was needed
- */
-bool
-intel_renderbuffer_resolve_hiz(struct intel_context *intel,
- struct intel_renderbuffer *irb);
-
-/**
- * \brief Perform a depth resolve on the renderbuffer.
- *
- * It is safe to call this function on a renderbuffer without HiZ. In that
- * case, the function is a no-op.
- *
- * \return false if no resolve was needed
- */
-bool
-intel_renderbuffer_resolve_depth(struct intel_context *intel,
- struct intel_renderbuffer *irb);
-
void intel_renderbuffer_move_to_temp(struct intel_context *intel,
struct intel_renderbuffer *irb,
bool invalidate);
#include "intel_context.h"
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
-#include "intel_resolve_map.h"
#include "intel_tex_layout.h"
#include "intel_tex.h"
#include "intel_blit.h"
if (!for_bo &&
_mesa_get_format_base_format(format) == GL_DEPTH_STENCIL &&
- (intel->must_use_separate_stencil ||
- (intel->has_separate_stencil &&
- intel->vtbl.is_hiz_depth_format(intel, format)))) {
+ (intel->must_use_separate_stencil)) {
mt->stencil_mt = intel_miptree_create(intel,
mt->target,
MESA_FORMAT_S8,
if (!mt)
goto fail;
- if (intel->vtbl.is_hiz_depth_format(intel, format)) {
- ok = intel_miptree_alloc_hiz(intel, mt);
- if (!ok)
- goto fail;
- }
-
if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
ok = intel_miptree_alloc_mcs(intel, mt, num_samples);
if (!ok)
intel_region_release(&((*mt)->region));
intel_miptree_release(&(*mt)->stencil_mt);
- intel_miptree_release(&(*mt)->hiz_mt);
#ifndef I915
intel_miptree_release(&(*mt)->mcs_mt);
#endif
intel_miptree_release(&(*mt)->singlesample_mt);
- intel_resolve_map_clear(&(*mt)->hiz_map);
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
free((*mt)->level[i].slice);
#endif
}
-
-/**
- * Helper for intel_miptree_alloc_hiz() that sets
- * \c mt->level[level].slice[layer].has_hiz. Return true if and only if
- * \c has_hiz was set.
- */
-static bool
-intel_miptree_slice_enable_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- assert(mt->hiz_mt);
-
- if (intel->is_haswell) {
- /* Disable HiZ for some slices to work around a hardware bug.
- *
- * Haswell hardware fails to respect
- * 3DSTATE_DEPTH_BUFFER.Depth_Coordinate_Offset_X/Y when during HiZ
- * ambiguate operations. The failure is inconsistent and affected by
- * other GPU contexts. Running a heavy GPU workload in a separate
- * process causes the failure rate to drop to nearly 0.
- *
- * To workaround the bug, we enable HiZ only when we can guarantee that
- * the Depth Coordinate Offset fields will be set to 0. The function
- * brw_get_depthstencil_tile_masks() is used to calculate the fields,
- * and the function is sometimes called in such a way that the presence
- * of an attached stencil buffer changes the fuction's return value.
- *
- * The largest tile size considered by brw_get_depthstencil_tile_masks()
- * is that of the stencil buffer. Therefore, if this hiz slice's
- * corresponding depth slice has an offset that is aligned to the
- * stencil buffer tile size, 64x64 pixels, then
- * 3DSTATE_DEPTH_BUFFER.Depth_Coordinate_Offset_X/Y is set to 0.
- */
- uint32_t depth_x_offset = mt->level[level].slice[layer].x_offset;
- uint32_t depth_y_offset = mt->level[level].slice[layer].y_offset;
- if ((depth_x_offset & 63) || (depth_y_offset & 63)) {
- return false;
- }
- }
-
- mt->level[level].slice[layer].has_hiz = true;
- return true;
-}
-
-
-
-bool
-intel_miptree_alloc_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt)
-{
- assert(mt->hiz_mt == NULL);
- mt->hiz_mt = intel_miptree_create(intel,
- mt->target,
- mt->format,
- mt->first_level,
- mt->last_level,
- mt->logical_width0,
- mt->logical_height0,
- mt->logical_depth0,
- true,
- mt->num_samples,
- INTEL_MIPTREE_TILING_ANY);
-
- if (!mt->hiz_mt)
- return false;
-
- /* Mark that all slices need a HiZ resolve. */
- struct intel_resolve_map *head = &mt->hiz_map;
- for (int level = mt->first_level; level <= mt->last_level; ++level) {
- for (int layer = 0; layer < mt->level[level].depth; ++layer) {
- if (!intel_miptree_slice_enable_hiz(intel, mt, level, layer))
- continue;
-
- head->next = malloc(sizeof(*head->next));
- head->next->prev = head;
- head->next->next = NULL;
- head = head->next;
-
- head->level = level;
- head->layer = layer;
- head->need = GEN6_HIZ_OP_HIZ_RESOLVE;
- }
- }
-
- return true;
-}
-
-/**
- * Does the miptree slice have hiz enabled?
- */
-bool
-intel_miptree_slice_has_hiz(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- intel_miptree_check_level_layer(mt, level, layer);
- return mt->level[level].slice[layer].has_hiz;
-}
-
-void
-intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- if (!intel_miptree_slice_has_hiz(mt, level, layer))
- return;
-
- intel_resolve_map_set(&mt->hiz_map,
- level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
-}
-
-
-void
-intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- if (!intel_miptree_slice_has_hiz(mt, level, layer))
- return;
-
- intel_resolve_map_set(&mt->hiz_map,
- level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
-}
-
-static bool
-intel_miptree_slice_resolve(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer,
- enum gen6_hiz_op need)
-{
- intel_miptree_check_level_layer(mt, level, layer);
-
- struct intel_resolve_map *item =
- intel_resolve_map_get(&mt->hiz_map, level, layer);
-
- if (!item || item->need != need)
- return false;
-
- intel_hiz_exec(intel, mt, level, layer, need);
- intel_resolve_map_remove(item);
- return true;
-}
-
-bool
-intel_miptree_slice_resolve_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- return intel_miptree_slice_resolve(intel, mt, level, layer,
- GEN6_HIZ_OP_HIZ_RESOLVE);
-}
-
-bool
-intel_miptree_slice_resolve_depth(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer)
-{
- return intel_miptree_slice_resolve(intel, mt, level, layer,
- GEN6_HIZ_OP_DEPTH_RESOLVE);
-}
-
-static bool
-intel_miptree_all_slices_resolve(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- enum gen6_hiz_op need)
-{
- bool did_resolve = false;
- struct intel_resolve_map *i, *next;
-
- for (i = mt->hiz_map.next; i; i = next) {
- next = i->next;
- if (i->need != need)
- continue;
-
- intel_hiz_exec(intel, mt, i->level, i->layer, need);
- intel_resolve_map_remove(i);
- did_resolve = true;
- }
-
- return did_resolve;
-}
-
-bool
-intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt)
-{
- return intel_miptree_all_slices_resolve(intel, mt,
- GEN6_HIZ_OP_HIZ_RESOLVE);
-}
-
-bool
-intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
- struct intel_mipmap_tree *mt)
-{
- return intel_miptree_all_slices_resolve(intel, mt,
- GEN6_HIZ_OP_DEPTH_RESOLVE);
-}
-
-
void
intel_miptree_resolve_color(struct intel_context *intel,
struct intel_mipmap_tree *mt)
return;
}
- intel_miptree_slice_resolve_depth(intel, mt, level, slice);
- if (map->mode & GL_MAP_WRITE_BIT) {
- intel_miptree_slice_set_needs_hiz_resolve(mt, level, slice);
- }
-
if (mt->format == MESA_FORMAT_S8) {
intel_miptree_map_s8(intel, mt, map, level, slice);
} else if (mt->etc_format != MESA_FORMAT_NONE &&
#include <assert.h>
#include "intel_regions.h"
-#include "intel_resolve_map.h"
#ifdef __cplusplus
extern "C" {
* temporary system buffers.
*/
-struct intel_resolve_map;
struct intel_texture_image;
/**
* intel_miptree_map/unmap on this slice.
*/
struct intel_miptree_map *map;
-
- /**
- * \brief Is HiZ enabled for this slice?
- *
- * If \c mt->level[l].slice[s].has_hiz is set, then (1) \c mt->hiz_mt
- * has been allocated and (2) the HiZ memory corresponding to this slice
- * resides at \c mt->hiz_mt->level[l].slice[s].
- */
- bool has_hiz;
} *slice;
};
GLuint total_width;
GLuint total_height;
- /* The 3DSTATE_CLEAR_PARAMS value associated with the last depth clear to
- * this depth mipmap tree, if any.
- */
- uint32_t depth_clear_value;
-
/* Includes image offset tables:
*/
struct intel_mipmap_level level[MAX_TEXTURE_LEVELS];
*/
bool need_downsample;
- /**
- * \brief HiZ miptree
- *
- * The hiz miptree contains the miptree's hiz buffer. To allocate the hiz
- * miptree, use intel_miptree_alloc_hiz().
- *
- * To determine if hiz is enabled, do not check this pointer. Instead, use
- * intel_miptree_slice_has_hiz().
- */
- struct intel_mipmap_tree *hiz_mt;
-
- /**
- * \brief Map of miptree slices to needed resolves.
- *
- * This is used only when the miptree has a child HiZ miptree.
- *
- * Let \c mt be a depth miptree with HiZ enabled. Then the resolve map is
- * \c mt->hiz_map. The resolve map of the child HiZ miptree, \c
- * mt->hiz_mt->hiz_map, is unused.
- */
- struct intel_resolve_map hiz_map;
-
/**
* \brief Stencil miptree for depthstencil textures.
*
struct intel_mipmap_tree *mt,
GLuint num_samples);
-/**
- * \name Miptree HiZ functions
- * \{
- *
- * It is safe to call the "slice_set_need_resolve" and "slice_resolve"
- * functions on a miptree without HiZ. In that case, each function is a no-op.
- */
-
-/**
- * \brief Allocate the miptree's embedded HiZ miptree.
- * \see intel_mipmap_tree:hiz_mt
- * \return false if allocation failed
- */
-
-bool
-intel_miptree_alloc_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt);
-
-bool
-intel_miptree_slice_has_hiz(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t layer);
-
-void
-intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t depth);
-void
-intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
- uint32_t level,
- uint32_t depth);
-
-/**
- * \return false if no resolve was needed
- */
-bool
-intel_miptree_slice_resolve_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- unsigned int level,
- unsigned int depth);
-
-/**
- * \return false if no resolve was needed
- */
-bool
-intel_miptree_slice_resolve_depth(struct intel_context *intel,
- struct intel_mipmap_tree *mt,
- unsigned int level,
- unsigned int depth);
-
-/**
- * \return false if no resolve was needed
- */
-bool
-intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
- struct intel_mipmap_tree *mt);
-
-/**
- * \return false if no resolve was needed
- */
-bool
-intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
- struct intel_mipmap_tree *mt);
-
/**\}*/
/**
unsigned int level,
unsigned int slice);
-#ifdef I915
-static inline void
-intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op)
-{
- /* Stub on i915. It would be nice if we didn't execute resolve code at all
- * there.
- */
-}
-#else
-void
-intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
- unsigned int level, unsigned int layer, enum gen6_hiz_op op);
-#endif
#ifdef __cplusplus
}
+++ /dev/null
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "intel_resolve_map.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-/**
- * \brief Set that the miptree slice at (level, layer) needs a resolve.
- *
- * If a map element already exists with the given key, then the value is
- * changed to the given value of \c need.
- */
-void
-intel_resolve_map_set(struct intel_resolve_map *head,
- uint32_t level,
- uint32_t layer,
- enum gen6_hiz_op need)
-{
- struct intel_resolve_map **tail = &head->next;
- struct intel_resolve_map *prev = head;
-
- while (*tail) {
- if ((*tail)->level == level && (*tail)->layer == layer) {
- (*tail)->need = need;
- return;
- }
- prev = *tail;
- tail = &(*tail)->next;
- }
-
- *tail = malloc(sizeof(**tail));
- (*tail)->prev = prev;
- (*tail)->next = NULL;
- (*tail)->level = level;
- (*tail)->layer = layer;
- (*tail)->need = need;
-}
-
-/**
- * \brief Get an element from the map.
- * \return null if element is not contained in map.
- */
-struct intel_resolve_map*
-intel_resolve_map_get(struct intel_resolve_map *head,
- uint32_t level,
- uint32_t layer)
-{
- struct intel_resolve_map *item = head->next;
-
- while (item) {
- if (item->level == level && item->layer == layer)
- break;
- else
- item = item->next;
- }
-
- return item;
-}
-
-/**
- * \brief Remove and free an element from the map.
- */
-void
-intel_resolve_map_remove(struct intel_resolve_map *elem)
-{
- if (elem->prev)
- elem->prev->next = elem->next;
- if (elem->next)
- elem->next->prev = elem->prev;
- free(elem);
-}
-
-/**
- * \brief Remove and free all elements of the map.
- */
-void
-intel_resolve_map_clear(struct intel_resolve_map *head)
-{
- struct intel_resolve_map *next = head->next;
- struct intel_resolve_map *trash;
-
- while (next) {
- trash = next;
- next = next->next;
- free(trash);
- }
-
- head->next = NULL;
-}
+++ /dev/null
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#pragma once
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * For an overview of the HiZ operations, see the following sections of the
- * Sandy Bridge PRM, Volume 1, Part2:
- * - 7.5.3.1 Depth Buffer Clear
- * - 7.5.3.2 Depth Buffer Resolve
- * - 7.5.3.3 Hierarchical Depth Buffer Resolve
- *
- * Of these, two get entered in the resolve map as needing to be done to the
- * buffer: depth resolve and hiz resolve.
- */
-enum gen6_hiz_op {
- GEN6_HIZ_OP_DEPTH_CLEAR,
- GEN6_HIZ_OP_DEPTH_RESOLVE,
- GEN6_HIZ_OP_HIZ_RESOLVE,
- GEN6_HIZ_OP_NONE,
-};
-
-/**
- * \brief Map of miptree slices to needed resolves.
- *
- * The map is implemented as a linear doubly-linked list.
- *
- * In the intel_resolve_map*() functions, the \c head argument is not
- * inspected for its data. It only serves as an anchor for the list.
- *
- * \par Design Discussion
- *
- * There are two possible ways to record which miptree slices need
- * resolves. 1) Maintain a flag for every miptree slice in the texture,
- * likely in intel_mipmap_level::slice, or 2) maintain a list of only
- * those slices that need a resolve.
- *
- * Immediately before drawing, a full depth resolve performed on each
- * enabled depth texture. If design 1 were chosen, then at each draw call
- * it would be necessary to iterate over each miptree slice of each
- * enabled depth texture in order to query if each slice needed a resolve.
- * In the worst case, this would require 2^16 iterations: 16 texture
- * units, 16 miplevels, and 256 depth layers (assuming maximums for OpenGL
- * 2.1).
- *
- * By choosing design 2, the number of iterations is exactly the minimum
- * necessary.
- */
-struct intel_resolve_map {
- uint32_t level;
- uint32_t layer;
- enum gen6_hiz_op need;
-
- struct intel_resolve_map *next;
- struct intel_resolve_map *prev;
-};
-
-void
-intel_resolve_map_set(struct intel_resolve_map *head,
- uint32_t level,
- uint32_t layer,
- enum gen6_hiz_op need);
-
-struct intel_resolve_map*
-intel_resolve_map_get(struct intel_resolve_map *head,
- uint32_t level,
- uint32_t layer);
-
-void
-intel_resolve_map_remove(struct intel_resolve_map *elem);
-
-void
-intel_resolve_map_clear(struct intel_resolve_map *head);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
DRI_CONF_DESC_END
DRI_CONF_OPT_END
- DRI_CONF_OPT_BEGIN_B(hiz, "true")
- DRI_CONF_DESC(en, "Enable Hierarchical Z on gen6+")
- DRI_CONF_OPT_END
-
DRI_CONF_OPT_BEGIN_B(early_z, "false")
DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
DRI_CONF_OPT_END
DRI_CONF_SECTION_END
DRI_CONF_END;
-const GLuint __driNConfigOptions = 14;
+const GLuint __driNConfigOptions = 13;
#include "intel_batchbuffer.h"
#include "intel_buffers.h"