diff options
-rw-r--r-- | src/amd/common/ac_gpu_info.h | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_device.c | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_shader.c | 4 | ||||
-rw-r--r-- | src/amd/vulkan/radv_shader.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 7 |
5 files changed, 12 insertions, 13 deletions
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index a7dc1094c05..b1ef9c53734 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -172,6 +172,12 @@ static inline unsigned ac_get_max_simd_waves(enum radeon_family family) } } +static inline uint32_t +ac_get_num_physical_sgprs(enum chip_class chip_class) +{ + return chip_class >= VI ? 800 : 512; +} + #ifdef __cplusplus } #endif diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 34d93b262f8..b8ef93d0cd2 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1129,7 +1129,7 @@ void radv_GetPhysicalDeviceProperties2( /* SGPR. */ properties->sgprsPerSimd = - radv_get_num_physical_sgprs(pdevice); + ac_get_num_physical_sgprs(pdevice->rad_info.chip_class); properties->minSgprAllocation = pdevice->rad_info.chip_class >= VI ? 16 : 8; properties->maxSgprAllocation = diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 32cd9ae25e9..2fd287fcd17 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -751,7 +751,7 @@ generate_shader_stats(struct radv_device *device, if (conf->num_sgprs) max_simd_waves = MIN2(max_simd_waves, - radv_get_num_physical_sgprs(device->physical_device) / conf->num_sgprs); + ac_get_num_physical_sgprs(device->physical_device->rad_info.chip_class) / conf->num_sgprs); if (conf->num_vgprs) max_simd_waves = @@ -836,7 +836,7 @@ radv_GetShaderInfoAMD(VkDevice _device, VkShaderStatisticsInfoAMD statistics = {}; statistics.shaderStageMask = shaderStage; statistics.numPhysicalVgprs = RADV_NUM_PHYSICAL_VGPRS; - statistics.numPhysicalSgprs = radv_get_num_physical_sgprs(device->physical_device); + statistics.numPhysicalSgprs = ac_get_num_physical_sgprs(device->physical_device->rad_info.chip_class); statistics.numAvailableSgprs = statistics.numPhysicalSgprs; if (stage == MESA_SHADER_COMPUTE) { diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 3652a811e80..b67cd2b4f15 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -407,10 +407,4 @@ static inline unsigned shader_io_get_unique_index(gl_varying_slot slot) unreachable("illegal slot in get unique index\n"); } -static inline uint32_t -radv_get_num_physical_sgprs(struct radv_physical_device *physical_device) -{ - return physical_device->rad_info.chip_class >= VI ? 800 : 512; -} - #endif diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index a2ed899b58f..efae02ee91c 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5380,10 +5380,9 @@ static void si_calculate_max_simd_waves(struct si_shader *shader) /* Compute the per-SIMD wave counts. */ if (conf->num_sgprs) { - if (sscreen->info.chip_class >= VI) - max_simd_waves = MIN2(max_simd_waves, 800 / conf->num_sgprs); - else - max_simd_waves = MIN2(max_simd_waves, 512 / conf->num_sgprs); + max_simd_waves = + MIN2(max_simd_waves, + ac_get_num_physical_sgprs(sscreen->info.chip_class) / conf->num_sgprs); } if (conf->num_vgprs) |