Commit 0ee9da5a authored by Kenneth Graunke's avatar Kenneth Graunke
Browse files

iris: Enable compression for image load/store in more cases

We were calling iris_resource_texture_aux_usage here, which disables
auxiliary support if color happens to already be resolved.  This makes
sense for read only images, where if we know ahead of time that aux
doesn't contain any useful information, we can just tell the hardware
to not bother looking at it.  However, it makes no sense for mutable
images, as even if the aux currently has no useful data, we want to
produce that data when doing our image writes.

Import the bits of logic we need from there and shed the rest.  We don't
need to consider HiZ, MCS, or MC, nor do we need to do format-based
CCS compatibility checks on Gfx12+, so it's actually very little code.
parent f4d1a861
......@@ -1033,19 +1033,24 @@ iris_image_view_aux_usage(struct iris_context *ice,
const unsigned level = res-> != PIPE_BUFFER ?
pview->u.tex.level : 0;
enum isl_format view_format = iris_image_view_get_format(ice, pview);
enum isl_aux_usage aux_usage =
iris_resource_texture_aux_usage(ice, res, view_format, level, 1);
bool uses_atomic_load_store =
/* On GFX12, compressed surfaces supports non-atomic operations. GFX12HP and
* further, add support for all the operations.
if (aux_usage == ISL_AUX_USAGE_GFX12_CCS_E &&
(devinfo->verx10 >= 125 || !uses_atomic_load_store))
if (devinfo->verx10 < 125 && uses_atomic_load_store)
/* If the image is read-only, and doesn't have any unresolved color,
* report ISL_AUX_USAGE_NONE. Bypassing useless aux can save bandwidth.
if (!(pview->access & PIPE_IMAGE_ACCESS_WRITE) &&
!iris_has_invalid_primary(res, level, 1, 0, INTEL_REMAINING_LAYERS))
if (res->aux.usage == ISL_AUX_USAGE_GFX12_CCS_E)
return res->aux.usage;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment