mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 21:00:17 +01:00
anv: Allow transfer-only linear ASTC images
Some apps depend on this to run. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2397 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13881>
This commit is contained in:
parent
bdf8b36c4c
commit
355f318843
2 changed files with 11 additions and 11 deletions
|
|
@ -546,10 +546,8 @@ copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
|
|||
buffer_row_pitch;
|
||||
|
||||
/* Some formats have additional restrictions which may cause ISL to
|
||||
* fail to create a surface for us. Some examples include:
|
||||
*
|
||||
* 1. ASTC formats are not allowed to be LINEAR and must be tiled
|
||||
* 2. YCbCr formats have to have 2-pixel aligned strides
|
||||
* fail to create a surface for us. For example, YCbCr formats
|
||||
* have to have 2-pixel aligned strides.
|
||||
*
|
||||
* To avoid these issues, we always bind the buffer as if it's a
|
||||
* "normal" format like RGBA32_UINT. Since we're using blorp_copy,
|
||||
|
|
|
|||
|
|
@ -600,14 +600,16 @@ anv_get_image_format_features2(const struct intel_device_info *devinfo,
|
|||
|
||||
enum isl_format base_isl_format = base_plane_format.isl_format;
|
||||
|
||||
/* ASTC textures must be in Y-tiled memory, and we reject compressed formats
|
||||
* with modifiers.
|
||||
*/
|
||||
if (vk_tiling != VK_IMAGE_TILING_OPTIMAL &&
|
||||
isl_format_get_layout(plane_format.isl_format)->txc == ISL_TXC_ASTC)
|
||||
return 0;
|
||||
|
||||
if (isl_format_supports_sampling(devinfo, plane_format.isl_format)) {
|
||||
/* ASTC textures must be in Y-tiled memory, and we reject compressed
|
||||
* formats with modifiers. We do however interpret ASTC textures with
|
||||
* uncompressed formats during data transfers.
|
||||
*/
|
||||
if (vk_tiling != VK_IMAGE_TILING_OPTIMAL &&
|
||||
isl_format_get_layout(plane_format.isl_format)->txc == ISL_TXC_ASTC)
|
||||
return VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR |
|
||||
VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR;
|
||||
|
||||
flags |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR;
|
||||
|
||||
if (devinfo->ver >= 9)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue