radv: Add the BOs of all shaders in a RT pipeline
authorFriedrich Vock <friedrich.vock@gmx.de>
Thu, 15 Jun 2023 16:48:18 +0000 (18:48 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 16 Jun 2023 14:47:03 +0000 (14:47 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23681>

src/amd/vulkan/radv_cmd_buffer.c

index 4ea665f..5be68af 100644 (file)
@@ -6472,6 +6472,15 @@ radv_emit_compute_pipeline(struct radv_cmd_buffer *cmd_buffer,
       radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs, cmd_buffer->state.rt_prolog->bo);
       radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs,
                          cmd_buffer->state.shaders[MESA_SHADER_INTERSECTION]->bo);
+      struct radv_ray_tracing_pipeline *rt_pipeline = radv_pipeline_to_ray_tracing(&pipeline->base);
+      for (unsigned i = 0; i < rt_pipeline->stage_count; ++i) {
+         if (!radv_ray_tracing_stage_is_compiled(&rt_pipeline->stages[i]))
+            continue;
+
+         struct radv_shader *shader = container_of(rt_pipeline->stages[i].shader,
+                                                   struct radv_shader, base);
+         radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs, shader->bo);
+      }
    }
 
    if (unlikely(cmd_buffer->device->trace_bo))