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

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Fri Apr  6 14:10:34 2018 +0200

radv: add RADV_NUM_PHYSICAL_VGPRS constant

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>

---

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

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 59ad2f3819..eaf24dcdee 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -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;
 
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index f5c0645b5f..cbb7394eea 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -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];

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to