radv: add RADV_NUM_PHYSICAL_VGPRS constant
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Apr 2018 12:10:34 +0000 (14:10 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 9 Apr 2018 12:28:13 +0000 (14:28 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index 59ad2f3819b9b89e06434cc38937498d7fdc5bd4..eaf24dcdee8bbb77018adbd36fa53a61d7aa37e2 100644 (file)
@@ -633,7 +633,9 @@ generate_shader_stats(struct radv_device *device,
                             radv_get_num_physical_sgprs(device->physical_device) / conf->num_sgprs);
 
        if (conf->num_vgprs)
-               max_simd_waves = MIN2(max_simd_waves, 256 / conf->num_vgprs);
+               max_simd_waves =
+                       MIN2(max_simd_waves,
+                            RADV_NUM_PHYSICAL_VGPRS / conf->num_vgprs);
 
        /* LDS is 64KB per CU (4 SIMDs), divided into 16KB blocks per SIMD
         * that PS can use.
@@ -712,7 +714,7 @@ radv_GetShaderInfoAMD(VkDevice _device,
 
                        VkShaderStatisticsInfoAMD statistics = {};
                        statistics.shaderStageMask = shaderStage;
-                       statistics.numPhysicalVgprs = 256;
+                       statistics.numPhysicalVgprs = RADV_NUM_PHYSICAL_VGPRS;
                        statistics.numPhysicalSgprs = radv_get_num_physical_sgprs(device->physical_device);
                        statistics.numAvailableSgprs = statistics.numPhysicalSgprs;
 
index f5c0645b5f13e88642f29ea12010f66db5e69fe2..cbb7394eeae6b07a4fad93158e8c891057d60f7c 100644 (file)
@@ -46,6 +46,8 @@
 // Match MAX_SETS from radv_descriptor_set.h
 #define RADV_UD_MAX_SETS MAX_SETS
 
+#define RADV_NUM_PHYSICAL_VGPRS 256
+
 struct radv_shader_module {
        struct nir_shader *nir;
        unsigned char sha1[20];