mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
radv: make optimalTilingLayoutUUID driver and chip specific
addrlib has an extra optimization for memcpy with HIC, there are two modes: - blockMemcpy: chip-specific layout but better performance overall - hybridMemcpy: chip-agnostic Because matching UUIDs doesn't matter on desktop, use the block memcpy by default. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41019>
This commit is contained in:
parent
14992361a4
commit
de978d1e5f
2 changed files with 21 additions and 1 deletions
|
|
@ -343,6 +343,24 @@ radv_get_device_uuid(const struct radeon_info *gpu_info, void *uuid)
|
|||
ac_compute_device_uuid(gpu_info, uuid, VK_UUID_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
radv_get_optimal_tiling_layout_uuid(struct radv_physical_device *pdev, void *uuid)
|
||||
{
|
||||
unsigned char blake3[BLAKE3_KEY_LEN];
|
||||
uint8_t cache_uuid[VK_UUID_SIZE];
|
||||
blake3_hasher ctx;
|
||||
|
||||
radv_device_get_cache_uuid(pdev, cache_uuid);
|
||||
|
||||
/* The block memcpy optimization in addrlib is chip-specific. */
|
||||
_mesa_blake3_init(&ctx);
|
||||
_mesa_blake3_update(&ctx, cache_uuid, sizeof(cache_uuid));
|
||||
_mesa_blake3_update(&ctx, &pdev->info.family, sizeof(pdev->info.family));
|
||||
_mesa_blake3_final(&ctx, blake3);
|
||||
|
||||
memcpy(uuid, blake3, VK_UUID_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
radv_physical_device_init_queue_table(struct radv_physical_device *pdev)
|
||||
{
|
||||
|
|
@ -2361,7 +2379,7 @@ radv_get_physical_device_properties(struct radv_physical_device *pdev)
|
|||
p->pCopySrcLayouts = (VkImageLayout *)supported_layouts;
|
||||
p->copyDstLayoutCount = ARRAY_SIZE(supported_layouts);
|
||||
p->pCopyDstLayouts = (VkImageLayout *)supported_layouts;
|
||||
memcpy(p->optimalTilingLayoutUUID, pdev->driver_uuid, VK_UUID_SIZE);
|
||||
memcpy(p->optimalTilingLayoutUUID, pdev->optimal_tiling_layout_uuid, VK_UUID_SIZE);
|
||||
p->identicalMemoryTypeRequirements = false;
|
||||
|
||||
/* VK_EXT_physical_device_drm */
|
||||
|
|
@ -2558,6 +2576,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
|
|||
|
||||
radv_get_driver_uuid(&pdev->driver_uuid);
|
||||
radv_get_device_uuid(&pdev->info, &pdev->device_uuid);
|
||||
radv_get_optimal_tiling_layout_uuid(pdev, &pdev->optimal_tiling_layout_uuid);
|
||||
|
||||
pdev->dcc_msaa_allowed = (instance->perftest_flags & RADV_PERFTEST_DCC_MSAA);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ struct radv_physical_device {
|
|||
uint8_t driver_uuid[VK_UUID_SIZE];
|
||||
uint8_t device_uuid[VK_UUID_SIZE];
|
||||
uint8_t cache_uuid[VK_UUID_SIZE];
|
||||
uint8_t optimal_tiling_layout_uuid[VK_UUID_SIZE];
|
||||
|
||||
struct disk_cache *disk_cache_meta;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue