summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-04-23 10:16:07 +1000
committerDave Airlie <[email protected]>2018-04-24 09:08:33 +1000
commitf77caa741135e0dbdcbbf9e619195f47c2c591b2 (patch)
tree02a6fea26010db2f8b48e95258b5d3f0a0fbad4e /src
parent899df55ee046847dfd2a49059a649da4e6c29fdb (diff)
ac/radv/radeonsi: refactor max simd waves into common code.
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_gpu_info.h16
-rw-r--r--src/amd/vulkan/radv_shader.c12
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c12
3 files changed, 18 insertions, 22 deletions
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index 9227ff37799..de566c62fa9 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -134,6 +134,22 @@ int ac_get_gs_table_depth(enum chip_class chip_class, enum radeon_family family)
void ac_get_raster_config(struct radeon_info *info,
uint32_t *raster_config_p,
uint32_t *raster_config_1_p);
+
+static inline unsigned ac_get_max_simd_waves(enum radeon_family family)
+{
+
+ switch (family) {
+ /* These always have 8 waves: */
+ case CHIP_POLARIS10:
+ case CHIP_POLARIS11:
+ case CHIP_POLARIS12:
+ case CHIP_VEGAM:
+ return 8;
+ default:
+ return 10;
+ }
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 8e8a32f0256..aaa67029755 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -615,17 +615,7 @@ generate_shader_stats(struct radv_device *device,
unsigned max_simd_waves;
unsigned lds_per_wave = 0;
- switch (device->physical_device->rad_info.family) {
- /* These always have 8 waves: */
- case CHIP_POLARIS10:
- case CHIP_POLARIS11:
- case CHIP_POLARIS12:
- case CHIP_VEGAM:
- max_simd_waves = 8;
- break;
- default:
- max_simd_waves = 10;
- }
+ max_simd_waves = ac_get_max_simd_waves(device->physical_device->rad_info.family);
conf = &variant->config;
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 4eff4f57b97..b866f14623e 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5459,17 +5459,7 @@ static void si_calculate_max_simd_waves(struct si_shader *shader)
unsigned lds_per_wave = 0;
unsigned max_simd_waves;
- switch (sscreen->info.family) {
- /* These always have 8 waves: */
- case CHIP_POLARIS10:
- case CHIP_POLARIS11:
- case CHIP_POLARIS12:
- case CHIP_VEGAM:
- max_simd_waves = 8;
- break;
- default:
- max_simd_waves = 10;
- }
+ max_simd_waves = ac_get_max_simd_waves(sscreen->info.family);
/* Compute LDS usage for PS. */
switch (shader->selector->type) {