From 8312b2232b78541b1aace75c92fc1ca61a451256 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Mon, 22 Mar 2021 03:52:13 +0100 Subject: [PATCH] radv: Add raytracing pipeline properties. Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_constants.h | 5 +++++ src/amd/vulkan/radv_device.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/amd/vulkan/radv_constants.h b/src/amd/vulkan/radv_constants.h index b98d0027f83..eb66897a686 100644 --- a/src/amd/vulkan/radv_constants.h +++ b/src/amd/vulkan/radv_constants.h @@ -90,4 +90,9 @@ /* Number of invocations in each subgroup. */ #define RADV_SUBGROUP_SIZE 64 +/* The spec requires this to be 32. */ +#define RADV_RT_HANDLE_SIZE 32 + +#define RADV_MAX_HIT_ATTRIB_SIZE 32 + #endif /* RADV_CONSTANTS_H */ diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 29000dbe5fa..6d84af9498b 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1718,6 +1718,16 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, features->shaderIntegerDotProduct = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: { + VkPhysicalDeviceRayTracingPipelineFeaturesKHR *features = + (VkPhysicalDeviceRayTracingPipelineFeaturesKHR *)ext; + features->rayTracingPipeline = true; + features->rayTracingPipelineShaderGroupHandleCaptureReplay = false; + features->rayTracingPipelineShaderGroupHandleCaptureReplayMixed = false; + features->rayTracingPipelineTraceRaysIndirect = false; + features->rayTraversalPrimitiveCulling = false; + break; + } default: break; } @@ -2469,6 +2479,19 @@ radv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, props->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = false; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: { + VkPhysicalDeviceRayTracingPipelinePropertiesKHR *props = + (VkPhysicalDeviceRayTracingPipelinePropertiesKHR *)ext; + props->shaderGroupHandleSize = RADV_RT_HANDLE_SIZE; + props->maxRayRecursionDepth = 31; /* Minimum allowed for DXR. */ + props->maxShaderGroupStride = 16384; /* dummy */ + props->shaderGroupBaseAlignment = 16; + props->shaderGroupHandleCaptureReplaySize = 16; + props->maxRayDispatchInvocationCount = 1024 * 1024 * 64; + props->shaderGroupHandleAlignment = 16; + props->maxRayHitAttributeSize = RADV_MAX_HIT_ATTRIB_SIZE; + break; + } default: break; }