diff options
author | Chia-I Wu <[email protected]> | 2015-05-02 15:36:59 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-05-02 22:14:07 +0800 |
commit | 9b705ec32d8cd527ab8d6ebc89f6550d52908c62 (patch) | |
tree | ec891e72a0b64be15fc4ade855f36669c29bff5b /src/gallium/drivers/ilo/ilo_resource.c | |
parent | 430594c34ff594b5bf47417b7240a62fc93509e9 (diff) |
ilo: add ilo_image_can_enable_aux()
It replaces ilo_texture_can_enable_hiz().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 2aa85085559..ad4852278d0 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -217,7 +217,6 @@ tex_create_hiz(struct ilo_texture *tex) const struct pipe_resource *templ = &tex->base; struct ilo_screen *is = ilo_screen(tex->base.screen); struct intel_bo *bo; - unsigned lv; bo = intel_winsys_alloc_bo(is->dev.winsys, "hiz texture", tex->image.aux.bo_stride * tex->image.aux.bo_height, false); @@ -226,17 +225,18 @@ tex_create_hiz(struct ilo_texture *tex) ilo_image_set_aux_bo(&tex->image, bo); - for (lv = 0; lv <= templ->last_level; lv++) { - if (tex->image.aux.enables & (1 << lv)) { - const unsigned num_slices = (templ->target == PIPE_TEXTURE_3D) ? - u_minify(templ->depth0, lv) : templ->array_size; - unsigned flags = ILO_TEXTURE_HIZ; + if (tex->imported) { + unsigned lv; - /* this will trigger a HiZ resolve */ - if (tex->imported) - flags |= ILO_TEXTURE_CPU_WRITE; + for (lv = 0; lv <= templ->last_level; lv++) { + if (tex->image.aux.enables & (1 << lv)) { + const unsigned num_slices = (templ->target == PIPE_TEXTURE_3D) ? + u_minify(templ->depth0, lv) : templ->array_size; + /* this will trigger HiZ resolves */ + const unsigned flags = ILO_TEXTURE_CPU_WRITE; - ilo_texture_set_slice_flags(tex, lv, 0, num_slices, flags, flags); + ilo_texture_set_slice_flags(tex, lv, 0, num_slices, flags, flags); + } } } |