From ec55e467f50b07352c2730b7db78754af95d21f6 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Mon, 17 Apr 2023 16:16:27 +0200 Subject: [PATCH] radv/rmv: Fix creating RT pipelines Cc: mesa-stable Part-of: (cherry picked from commit fd389ade5c00f43c8a2abfaf82677e5ceaf8bb97) --- .pick_status.json | 2 +- src/amd/vulkan/radv_pipeline_rt.c | 7 ++----- src/amd/vulkan/radv_rmv.c | 6 ++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 27a1d6efb87..da105fc3a55 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -688,7 +688,7 @@ "description": "radv/rmv: Fix creating RT pipelines", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index d1e6ebebbc7..137b7f70d24 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -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; diff --git a/src/amd/vulkan/radv_rmv.c b/src/amd/vulkan/radv_rmv.c index c500df9f940..a2689d08d21 100644 --- a/src/amd/vulkan/radv_rmv.c +++ b/src/amd/vulkan/radv_rmv.c @@ -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);