diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index e2abbf56259a3..95f91ef0e1d45 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1784,8 +1784,8 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceRayTracingPipelineFeaturesKHR *features = (VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)ext; features->rayTracingPipeline = true; - features->rayTracingPipelineShaderGroupHandleCaptureReplay = false; - features->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = false; + features->rayTracingPipelineShaderGroupHandleCaptureReplay = true; + features->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = true; features->rayTracingPipelineTraceRaysIndirect = true; features->rayTraversalPrimitiveCulling = true; break; @@ -2620,7 +2620,7 @@ radv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, props->maxRayRecursionDepth = 31; /* Minimum allowed for DXR. */ props->maxShaderGroupStride = 16384; /* dummy */ props->shaderGroupBaseAlignment = 16; - props->shaderGroupHandleCaptureReplaySize = 16; + props->shaderGroupHandleCaptureReplaySize = RADV_RT_HANDLE_SIZE; props->maxRayDispatchInvocationCount = 1024 * 1024 * 64; props->shaderGroupHandleAlignment = 16; props->maxRayHitAttributeSize = RADV_MAX_HIT_ATTRIB_SIZE; diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 49653f88c5acb..aac5d7a60bb0e 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -368,6 +368,16 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache, case VK_SHADER_GROUP_SHADER_MAX_ENUM_KHR: unreachable("VK_SHADER_GROUP_SHADER_MAX_ENUM_KHR"); } + + if (pCreateInfo->flags & + VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR) { + if (group_info->pShaderGroupCaptureReplayHandle && + memcmp(group_info->pShaderGroupCaptureReplayHandle, &rt_pipeline->group_handles[i], + sizeof(rt_pipeline->group_handles[i])) != 0) { + result = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS; + goto shader_fail; + } + } } *pPipeline = radv_pipeline_to_handle(&rt_pipeline->base.base); @@ -450,11 +460,10 @@ radv_GetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline _pipeline, } VKAPI_ATTR VkResult VKAPI_CALL -radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice _device, VkPipeline pipeline, +radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData) { - RADV_FROM_HANDLE(radv_device, device, _device); - unreachable("Unimplemented"); - return vk_error(device, VK_ERROR_FEATURE_NOT_PRESENT); + return radv_GetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, + dataSize, pData); }