mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
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. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
This commit is contained in:
parent
bf3d6ca94f
commit
16a7e15d4f
1 changed files with 12 additions and 7 deletions
|
|
@ -1021,19 +1021,24 @@ iris_image_view_aux_usage(struct iris_context *ice,
|
|||
const unsigned level = res->base.b.target != 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 =
|
||||
ice->shaders.uncompiled[info->stage]->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))
|
||||
return ISL_AUX_USAGE_GFX12_CCS_E;
|
||||
if (devinfo->verx10 < 125 && uses_atomic_load_store)
|
||||
return ISL_AUX_USAGE_NONE;
|
||||
|
||||
/* 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))
|
||||
return ISL_AUX_USAGE_NONE;
|
||||
|
||||
if (res->aux.usage == ISL_AUX_USAGE_GFX12_CCS_E)
|
||||
return res->aux.usage;
|
||||
|
||||
return ISL_AUX_USAGE_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue