diff options
author | Chia-I Wu <[email protected]> | 2014-08-17 14:13:35 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-08-19 19:53:37 +0800 |
commit | 17401896ddb6bdb670da0171ff4ba3705066f908 (patch) | |
tree | 6274ee2f2f5a8665f5c291e030493f53b854f983 /src/gallium/drivers/ilo/ilo_layout.c | |
parent | 5b4fc5f156bff72e63e2f528004a48d008d3af6f (diff) |
ilo: enable HiZ in more cases on GEN6
With layer offsetting killed, we no longer need to restrict HiZ to
non-mipmapped and non-arary depth buffers.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_layout.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_layout.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/gallium/drivers/ilo/ilo_layout.c b/src/gallium/drivers/ilo/ilo_layout.c index b6e958585a5..070ee215107 100644 --- a/src/gallium/drivers/ilo/ilo_layout.c +++ b/src/gallium/drivers/ilo/ilo_layout.c @@ -769,7 +769,6 @@ layout_want_hiz(const struct ilo_layout *layout, const struct pipe_resource *templ = params->templ; const struct util_format_description *desc = util_format_description(templ->format); - bool want_hiz = false; if (ilo_debug & ILO_DEBUG_NOHIZ) return false; @@ -784,29 +783,19 @@ layout_want_hiz(const struct ilo_layout *layout, if (templ->usage == PIPE_USAGE_STAGING) return false; - if (params->dev->gen >= ILO_GEN(7)) { - want_hiz = true; - } else { - /* - * From the Sandy Bridge PRM, volume 2 part 1, page 312: - * - * "The hierarchical depth buffer does not support the LOD field, it - * is assumed by hardware to be zero. A separate hierarachical - * depth buffer is required for each LOD used, and the - * corresponding buffer's state delivered to hardware each time a - * new depth buffer state with modified LOD is delivered." - * - * But we have a stronger requirement. Because of layer offsetting - * (check out the callers of ilo_layout_get_slice_tile_offset()), we - * already have to require the texture to be non-mipmapped and - * non-array. - */ - if (templ->last_level == 0 && templ->array_size == 1 && - templ->depth0 == 1) - want_hiz = true; - } + /* + * As can be seen in layout_calculate_hiz_size(), HiZ may not be enabled + * for every level. This is generally fine except on GEN6, where HiZ and + * separate stencil are enabled and disabled at the same time. When the + * format is PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, enabling and disabling HiZ + * can result in incompatible formats. + */ + if (params->dev->gen == ILO_GEN(6) && + templ->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT && + templ->last_level) + return false; - return want_hiz; + return true; } static void |