radv/rmv: Fix creating RT pipelines
authorFriedrich Vock <friedrich.vock@gmx.de>
Mon, 17 Apr 2023 14:16:27 +0000 (16:16 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Apr 2023 16:06:59 +0000 (16:06 +0000)
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22532>

src/amd/vulkan/radv_pipeline_rt.c
src/amd/vulkan/radv_rmv.c

index d1e6ebe..137b7f7 100644 (file)
@@ -596,6 +596,8 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache,
 
    radv_compute_pipeline_init(device, &rt_pipeline->base, pipeline_layout);
 
+   radv_rmv_log_compute_pipeline_create(device, pCreateInfo->flags, &rt_pipeline->base.base, false);
+
    *pPipeline = radv_pipeline_to_handle(&rt_pipeline->base.base);
 shader_fail:
    ralloc_free(shader);
@@ -646,11 +648,6 @@ radv_CreateRayTracingPipelinesKHR(VkDevice _device, VkDeferredOperationKHR defer
    if (result != VK_SUCCESS)
       return result;
 
-   RADV_FROM_HANDLE(radv_device, device, _device);
-   for (uint32_t j = 0; j < count; ++j)
-      radv_rmv_log_compute_pipeline_create(device, pCreateInfos[i].flags,
-                                           radv_pipeline_from_handle(pPipelines[j]), false);
-
    /* Work around Portal RTX not handling VK_OPERATION_NOT_DEFERRED_KHR correctly. */
    if (deferredOperation != VK_NULL_HANDLE)
       return VK_OPERATION_DEFERRED_KHR;
index c500df9..a2689d0 100644 (file)
@@ -867,7 +867,9 @@ radv_rmv_log_compute_pipeline_create(struct radv_device *device, VkPipelineCreat
 
    VkPipeline _pipeline = radv_pipeline_to_handle(pipeline);
 
-   VkShaderStageFlagBits active_stages = VK_SHADER_STAGE_COMPUTE_BIT;
+   VkShaderStageFlagBits active_stages = pipeline->type == RADV_PIPELINE_COMPUTE
+                                            ? VK_SHADER_STAGE_COMPUTE_BIT
+                                            : VK_SHADER_STAGE_RAYGEN_BIT_KHR;
 
    simple_mtx_lock(&device->vk.memory_trace_data.token_mtx);
    struct vk_rmv_resource_create_token create_token = {0};
@@ -881,7 +883,7 @@ radv_rmv_log_compute_pipeline_create(struct radv_device *device, VkPipelineCreat
 
    vk_rmv_emit_token(&device->vk.memory_trace_data, VK_RMV_TOKEN_TYPE_RESOURCE_CREATE,
                      &create_token);
-   struct radv_shader *shader = pipeline->shaders[MESA_SHADER_COMPUTE];
+   struct radv_shader *shader = pipeline->shaders[vk_to_mesa_shader_stage(active_stages)];
    log_resource_bind_locked(device, (uint64_t)_pipeline, shader->bo, shader->alloc->offset,
                             shader->alloc->size);
    simple_mtx_unlock(&device->vk.memory_trace_data.token_mtx);