Mesa (master): radv/gfx10: adjust the number of VGPRs used to compute waves

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 26 08:20:16 UTC 2020


Module: Mesa
Branch: master
Commit: 9204ad70f2a49c783a38d926f01a54059bb3461f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9204ad70f2a49c783a38d926f01a54059bb3461f

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Feb 20 09:26:03 2020 +0100

radv/gfx10: adjust the number of VGPRs used to compute waves

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3899>

---

 src/amd/vulkan/radv_constants.h | 2 --
 src/amd/vulkan/radv_shader.c    | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_constants.h b/src/amd/vulkan/radv_constants.h
index a12e79e9623..a42984e83c6 100644
--- a/src/amd/vulkan/radv_constants.h
+++ b/src/amd/vulkan/radv_constants.h
@@ -76,8 +76,6 @@
 /* max number of descriptor sets */
 #define MAX_SETS 32
 
-#define RADV_NUM_PHYSICAL_VGPRS 256
-
 /* Make sure everything is addressable by a signed 32-bit int, and
  * our largest descriptors are 96 bytes.
  */
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 1220b4ae8b7..367817c16f8 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -1333,7 +1333,7 @@ radv_get_max_waves(struct radv_device *device,
 		unsigned vgprs = align(conf->num_vgprs, wave_size == 32 ? 8 : 4);
 		max_simd_waves =
 			MIN2(max_simd_waves,
-			     RADV_NUM_PHYSICAL_VGPRS / vgprs);
+			     device->physical_device->rad_info.num_physical_wave64_vgprs_per_simd / vgprs);
 	}
 
 	unsigned max_lds_per_simd = device->physical_device->rad_info.lds_size_per_cu / device->physical_device->rad_info.num_simd_per_compute_unit;
@@ -1423,7 +1423,7 @@ radv_GetShaderInfoAMD(VkDevice _device,
 
 			VkShaderStatisticsInfoAMD statistics = {};
 			statistics.shaderStageMask = shaderStage;
-			statistics.numPhysicalVgprs = RADV_NUM_PHYSICAL_VGPRS;
+			statistics.numPhysicalVgprs = device->physical_device->rad_info.num_physical_wave64_vgprs_per_simd;
 			statistics.numPhysicalSgprs = device->physical_device->rad_info.num_physical_sgprs_per_simd;
 			statistics.numAvailableSgprs = statistics.numPhysicalSgprs;
 



More information about the mesa-commit mailing list