Mesa (main): radv: move gs_table_depth to the physical_device

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 23 08:07:55 UTC 2022


Module: Mesa
Branch: main
Commit: 7fb48493144a8256f3f2d23d95ac5454972bde6d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fb48493144a8256f3f2d23d95ac5454972bde6d

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed May 18 14:57:01 2022 +0200

radv: move gs_table_depth to the physical_device

This is not a logical device property.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16603>

---

 src/amd/vulkan/radv_device.c   | 12 +++---------
 src/amd/vulkan/radv_pipeline.c |  2 +-
 src/amd/vulkan/radv_private.h  |  3 ++-
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 0bbcd57c973..21c345054c1 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -824,6 +824,9 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
       goto fail_disk_cache;
    }
 
+   device->gs_table_depth =
+      ac_get_gs_table_depth(device->rad_info.gfx_level, device->rad_info.family);
+
    *device_out = device;
 
    return VK_SUCCESS;
@@ -2735,13 +2738,6 @@ radv_queue_finish(struct radv_queue *queue)
    vk_queue_finish(&queue->vk);
 }
 
-static void
-radv_device_init_gs_info(struct radv_device *device)
-{
-   device->gs_table_depth = ac_get_gs_table_depth(device->physical_device->rad_info.gfx_level,
-                                                  device->physical_device->rad_info.family);
-}
-
 static VkResult
 radv_device_init_border_color(struct radv_device *device)
 {
@@ -3342,8 +3338,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
       device->dispatch_initiator |= S_00B800_ORDER_MODE(1);
    }
 
-   radv_device_init_gs_info(device);
-
    ac_get_hs_info(&device->physical_device->rad_info,
                   &device->hs);
 
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index ea9a9a03ff2..3badec22147 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1472,7 +1472,7 @@ radv_compute_ia_multi_vgt_param_helpers(struct radv_pipeline *pipeline)
    /* GS requirement. */
    ia_multi_vgt_param.partial_es_wave = false;
    if (radv_pipeline_has_gs(pipeline) && device->physical_device->rad_info.gfx_level <= GFX8)
-      if (SI_GS_PER_ES / ia_multi_vgt_param.primgroup_size >= pipeline->device->gs_table_depth - 3)
+      if (SI_GS_PER_ES / ia_multi_vgt_param.primgroup_size >= pipeline->device->physical_device->gs_table_depth - 3)
          ia_multi_vgt_param.partial_es_wave = true;
 
    ia_multi_vgt_param.ia_switch_on_eoi = false;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index a4772288e44..413c6ff6f4f 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -327,6 +327,8 @@ struct radv_physical_device {
 
    enum radv_queue_family vk_queue_to_radv[RADV_MAX_QUEUE_FAMILIES];
    uint32_t num_queues;
+
+   uint32_t gs_table_depth;
 };
 
 struct radv_instance {
@@ -780,7 +782,6 @@ struct radv_device {
    /* Number of entries in the task shader ring buffers. */
    uint32_t task_num_entries;
 
-   uint32_t gs_table_depth;
    struct ac_hs_info hs;
 
    /* MSAA sample locations.



More information about the mesa-commit mailing list