From fd389ade5c00f43c8a2abfaf82677e5ceaf8bb97 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: --- src/amd/vulkan/radv_pipeline_rt.c | 7 ++----- src/amd/vulkan/radv_rmv.c | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index d1e6ebe..137b7f7 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 c500df9..a2689d0 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); -- 2.7.4