mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 18:30:42 +02:00
anv: consider 64bit atomics on similar formats with mutable images
vkd3d-proton uses a R32G32_UINT image with MUTABLE Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes:ed77f67e44("anv: add emulated 64bit integer storage support") Acked-by: Nanley Chery <nanley.g.chery@intel.com> (cherry picked from commit73bf51dba0) Conflicts: src/intel/ci/anv-adl-vkd3d-fails.txt Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38803>
This commit is contained in:
parent
798ec2e23f
commit
28874a99ad
5 changed files with 31 additions and 18 deletions
|
|
@ -2134,7 +2134,7 @@
|
|||
"description": "anv: consider 64bit atomics on similar formats with mutable images",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "ed77f67e445d5104c81b999bbc7cbafc75090838",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
test_fence_wait_robustness,Crash
|
||||
test_sampler_feedback_min_mip_level_array,Fail
|
||||
test_sampler_rounding,Fail
|
||||
# Undefined behavior not supported unless EXT_descriptor_buffer is
|
||||
# used or running on Gfx12.5+ where we don't do descriptor indirection
|
||||
|
|
|
|||
|
|
@ -2134,7 +2134,7 @@ void anv_GetPhysicalDeviceSparseImageFormatProperties2(
|
|||
|
||||
isl_surf_usage_flags_t isl_usage =
|
||||
anv_image_choose_isl_surf_usage(physical_device,
|
||||
pFormatInfo->format,
|
||||
pFormatInfo->format, NULL,
|
||||
vk_create_flags, pFormatInfo->usage,
|
||||
0, aspect,
|
||||
VK_IMAGE_COMPRESSION_DEFAULT_EXT);
|
||||
|
|
|
|||
|
|
@ -203,9 +203,26 @@ memory_range_merge(struct anv_image_memory_range *a,
|
|||
a->size = MAX2(a->size, b.offset + b.size);
|
||||
}
|
||||
|
||||
static bool
|
||||
format_list_has_64bit_format(const VkImageFormatListCreateInfo *format_list_info)
|
||||
{
|
||||
/* Any block compatible format */
|
||||
if (format_list_info == NULL)
|
||||
return true;
|
||||
|
||||
for (uint32_t i = 0; i < format_list_info->viewFormatCount; i++) {
|
||||
if (format_list_info->pViewFormats[i] == VK_FORMAT_R64_SINT ||
|
||||
format_list_info->pViewFormats[i] == VK_FORMAT_R64_UINT)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
isl_surf_usage_flags_t
|
||||
anv_image_choose_isl_surf_usage(struct anv_physical_device *device,
|
||||
VkFormat vk_format,
|
||||
const VkImageFormatListCreateInfo *format_list_info,
|
||||
VkImageCreateFlags vk_create_flags,
|
||||
VkImageUsageFlags vk_usage,
|
||||
isl_surf_usage_flags_t isl_extra_usage,
|
||||
|
|
@ -315,8 +332,14 @@ anv_image_choose_isl_surf_usage(struct anv_physical_device *device,
|
|||
* so don't set the flags when using sparse, as they affect which tiling
|
||||
* format ISL will choose.
|
||||
*/
|
||||
if (anv_is_storage_format_atomics_emulated(devinfo, vk_format) &&
|
||||
(vk_create_flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) == 0) {
|
||||
if (devinfo->ver < 20 &&
|
||||
(vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) &&
|
||||
(vk_create_flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) == 0 &&
|
||||
(vk_format == VK_FORMAT_R64_SINT ||
|
||||
vk_format == VK_FORMAT_R64_UINT ||
|
||||
((vk_create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) &&
|
||||
vk_format_get_blocksizebits(vk_format) == 64 &&
|
||||
format_list_has_64bit_format(format_list_info)))) {
|
||||
isl_usage |= ISL_SURF_USAGE_DISABLE_AUX_BIT |
|
||||
ISL_SURF_USAGE_SOFTWARE_DETILING;
|
||||
}
|
||||
|
|
@ -1273,7 +1296,7 @@ add_all_surfaces_implicit_interleaved_arrays_layout(
|
|||
VkImageUsageFlags vk_usage = vk_image_usage(&image->vk, aspect);
|
||||
isl_surf_usage_flags_t isl_usage =
|
||||
anv_image_choose_isl_surf_usage(device->physical,
|
||||
image->vk.format,
|
||||
image->vk.format, format_list_info,
|
||||
image->vk.create_flags, vk_usage,
|
||||
isl_extra_usage_flags, aspect,
|
||||
image->vk.compr_flags);
|
||||
|
|
@ -1414,6 +1437,7 @@ add_all_surfaces_implicit_layout(
|
|||
isl_surf_usage_flags_t isl_usage =
|
||||
anv_image_choose_isl_surf_usage(device->physical,
|
||||
image->vk.format,
|
||||
format_list_info,
|
||||
image->vk.create_flags, vk_usage,
|
||||
isl_extra_usage_flags, aspect,
|
||||
image->vk.compr_flags);
|
||||
|
|
@ -2100,6 +2124,7 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
|||
isl_surf_usage_flags_t isl_usage =
|
||||
anv_image_choose_isl_surf_usage(device->physical,
|
||||
image->vk.format,
|
||||
&emu_format_list_info,
|
||||
image->vk.create_flags,
|
||||
image->vk.usage,
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -5454,18 +5454,6 @@ anv_is_compressed_format_emulated(const struct anv_physical_device *pdevice,
|
|||
format) != VK_FORMAT_UNDEFINED;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
anv_is_storage_format_atomics_emulated(const struct intel_device_info *devinfo,
|
||||
VkFormat format)
|
||||
{
|
||||
/* No emulation required on Xe2+ */
|
||||
if (devinfo->ver >= 20)
|
||||
return false;
|
||||
|
||||
return format == VK_FORMAT_R64_SINT ||
|
||||
format == VK_FORMAT_R64_UINT;
|
||||
}
|
||||
|
||||
static inline struct isl_swizzle
|
||||
anv_swizzle_for_render(struct isl_swizzle swizzle)
|
||||
{
|
||||
|
|
@ -6078,6 +6066,7 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer,
|
|||
isl_surf_usage_flags_t
|
||||
anv_image_choose_isl_surf_usage(struct anv_physical_device *device,
|
||||
VkFormat vk_format,
|
||||
const VkImageFormatListCreateInfo *format_list_info,
|
||||
VkImageCreateFlags vk_create_flags,
|
||||
VkImageUsageFlags vk_usage,
|
||||
isl_surf_usage_flags_t isl_extra_usage,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue