diff options
author | Kenneth Graunke <[email protected]> | 2018-12-10 00:35:48 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:12 -0800 |
commit | 2cddc953cd05b5ed136582c39cac0a77c0d9e311 (patch) | |
tree | a4e11c4d2bfdc81474f7fc335f35e2c27a2d3bb6 /src/gallium/drivers/iris/iris_resource.c | |
parent | 9b1126c9904598e67148d930f3f79d0de0914c20 (diff) |
iris: some initial HiZ bits
Diffstat (limited to 'src/gallium/drivers/iris/iris_resource.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index badf29542e3..2f6a0c61bf2 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -203,7 +203,6 @@ iris_resource_disable_aux(struct iris_resource *res) free(res->aux.state); // XXX: clear color BO - // XXX: HiZ res->aux.usage = ISL_AUX_USAGE_NONE; res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE; @@ -376,7 +375,18 @@ iris_resource_alloc_aux(struct iris_screen *screen, struct iris_resource *res) iris_bo_unmap(res->aux.bo); } - // XXX: HIZ enabling + if (res->aux.usage == ISL_AUX_USAGE_HIZ) { + for (unsigned level = 0; level < res->surf.levels; ++level) { + uint32_t width = u_minify(res->surf.phys_level0_sa.width, level); + uint32_t height = u_minify(res->surf.phys_level0_sa.height, level); + + /* Disable HiZ for LOD > 0 unless the width/height are 8x4 aligned. + * For LOD == 0, we can grow the dimensions to make it work. + */ + if (level == 0 || ((width & 7) == 0 && (height & 3) == 0)) + res->aux.has_hiz |= 1 << level; + } + } return true; } |