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

Author: Iago Toral Quiroga <[email protected]>
Date:   Fri Sep 16 10:22:16 2022 +0200

v3dv: fix program id for binning shaders

We had a comment stating that we were using different program ids for render
and binning but this isn't true. We were only assigning ids to the render
stages and then we would create the binning stages and not assign a program id
to them at all, so they would remain with a program id of 0.

This change removes the comment and makes sure we assign the same program
id to the binning and render stages of the pipeline, which makes it a lot
easier to match render and binning shaders when debugging.

Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18630>

---

 src/broadcom/vulkan/v3dv_pipeline.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/broadcom/vulkan/v3dv_pipeline.c 
b/src/broadcom/vulkan/v3dv_pipeline.c
index 717dfd8b6ca..5e2b7de2016 100644
--- a/src/broadcom/vulkan/v3dv_pipeline.c
+++ b/src/broadcom/vulkan/v3dv_pipeline.c
@@ -1431,6 +1431,7 @@ pipeline_stage_create_binning(const struct 
v3dv_pipeline_stage *src,
     * we only have to run the relevant NIR lowerings once for render shaders
     */
    p_stage->nir = NULL;
+   p_stage->program_id = src->program_id;
    p_stage->spec_info = src->spec_info;
    p_stage->feedback = (VkPipelineCreationFeedback) { 0 };
    memcpy(p_stage->shader_sha1, src->shader_sha1, 20);
@@ -2370,12 +2371,6 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline,
       if (p_stage == NULL)
          return VK_ERROR_OUT_OF_HOST_MEMORY;
 
-      /* Note that we are assigning program_id slightly differently that
-       * v3d. Here we are assigning one per pipeline stage, so vs and vs_bin
-       * would have a different program_id, while v3d would have the same for
-       * both. For the case of v3dv, it is more natural to have an id this way,
-       * as right now we are using it for debugging, not for shader-db.
-       */
       p_stage->program_id =
          p_atomic_inc_return(&physical_device->next_program_id);
 

Reply via email to