From 4b8dfaae89eedd54f7f9881adc8712d99ff30a60 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 24 Jan 2023 14:25:23 +0200 Subject: [PATCH] radv: Change radeon_cmdbuf counters to uint64_t to make alias analysis optimize radeon_emit better 1% gain in drawcall throughput on i5-2500. Depends quite heavily on compiler and CPU. Part-of: --- src/amd/vulkan/radv_radeon_winsys.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_radeon_winsys.h b/src/amd/vulkan/radv_radeon_winsys.h index dd644d22b64..0d4cd587eb8 100644 --- a/src/amd/vulkan/radv_radeon_winsys.h +++ b/src/amd/vulkan/radv_radeon_winsys.h @@ -103,8 +103,11 @@ enum radeon_value_id { }; struct radeon_cmdbuf { - unsigned cdw; /* Number of used dwords. */ - unsigned max_dw; /* Maximum number of dwords. */ + /* These are uint64_t to tell the compiler that buf can't alias them. + * If they're uint32_t the generated code needs to redundantly + * store and reload them between buf writes. */ + uint64_t cdw; /* Number of used dwords. */ + uint64_t max_dw; /* Maximum number of dwords. */ uint32_t *buf; /* The base pointer of the chunk. */ };