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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Jan 26 12:55:02 2023 -0500

radv: avoid a huge memset in radv_graphics_pipeline_compile()

this has a noticeable impact on pipeline creation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>

---

 src/amd/vulkan/radv_pipeline.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 64431f591ef..069696e1e10 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3465,7 +3465,7 @@ radv_graphics_pipeline_compile(struct 
radv_graphics_pipeline *pipeline,
       radv_pipeline_capture_shaders(pipeline->base.device, pCreateInfo->flags);
    bool keep_statistic_info =
       radv_pipeline_capture_shader_stats(pipeline->base.device, 
pCreateInfo->flags);
-   struct radv_pipeline_stage stages[MESA_VULKAN_SHADER_STAGES] = {0};
+   struct radv_pipeline_stage stages[MESA_VULKAN_SHADER_STAGES];
    const VkPipelineCreationFeedbackCreateInfo *creation_feedback =
       vk_find_struct_const(pCreateInfo->pNext, 
PIPELINE_CREATION_FEEDBACK_CREATE_INFO);
    VkPipelineCreationFeedback pipeline_feedback = {
@@ -3491,6 +3491,12 @@ radv_graphics_pipeline_compile(struct 
radv_graphics_pipeline *pipeline,
       skip_shaders_cache = true;
    }
 
+   for (unsigned i = 0; i < MESA_VULKAN_SHADER_STAGES; i++) {
+      stages[i].entrypoint = NULL;
+      stages[i].nir = NULL;
+      stages[i].spirv.size = 0;
+   }
+
    for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
       const VkPipelineShaderStageCreateInfo *sinfo = &pCreateInfo->pStages[i];
       gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage);

Reply via email to