Skip to content

Commit

Permalink
Ray Query API interception and serialisation
Browse files Browse the repository at this point in the history
Ignoring acceleration structure host-build for now, and by extension deferred operation handle functions are pass-though (i.e. ignored on replay).
  • Loading branch information
cmannett85-arm authored and baldurk committed Feb 27, 2024
1 parent e5410ad commit fa70f8f
Show file tree
Hide file tree
Showing 22 changed files with 1,818 additions and 48 deletions.
2 changes: 1 addition & 1 deletion renderdoc/api/replay/rdcarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ struct rdcarray
{
const size_t lastIdx = size();
reserve(size() + 1);
new(elems + lastIdx) T(std::forward<ConstructArgs...>(args)...);
new(elems + lastIdx) T(std::forward<ConstructArgs>(args)...);
setUsedCount(usedCount + 1);
}

Expand Down
7 changes: 7 additions & 0 deletions renderdoc/api/replay/replay_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ API-specific concepts.
An object which pools together other objects in an opaque way, either for runtime allocation and
deallocation, or for caching purposes.
.. data:: AccelerationStructure
A structure used to carry implementation-defined spatial partitioning data and related
information, used to accelerate geometry intersection queries (e.g. for ray tracing).
)");
enum class ResourceType : uint32_t
{
Expand All @@ -683,6 +688,8 @@ enum class ResourceType : uint32_t
Query,
Sync,
Pool,

AccelerationStructure,
};

DECLARE_REFLECTION_ENUM(ResourceType);
Expand Down
61 changes: 60 additions & 1 deletion renderdoc/driver/vulkan/vk_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,12 @@ enum class VulkanChunk : uint32_t
vkCmdDrawMeshTasksEXT,
vkCmdDrawMeshTasksIndirectEXT,
vkCmdDrawMeshTasksIndirectCountEXT,
vkCmdBuildAccelerationStructuresIndirectKHR,
vkCmdBuildAccelerationStructuresKHR,
vkCmdCopyAccelerationStructureKHR,
vkCmdCopyAccelerationStructureToMemoryKHR,
vkCmdCopyMemoryToAccelerationStructureKHR,
vkCreateAccelerationStructureKHR,
Max,
};

Expand Down Expand Up @@ -1019,7 +1025,8 @@ DECLARE_REFLECTION_ENUM(VulkanChunk);
SERIALISE_HANDLE(VkSwapchainKHR) \
SERIALISE_HANDLE(VkSurfaceKHR) \
SERIALISE_HANDLE(VkDescriptorUpdateTemplate) \
SERIALISE_HANDLE(VkSamplerYcbcrConversion)
SERIALISE_HANDLE(VkSamplerYcbcrConversion) \
SERIALISE_HANDLE(VkAccelerationStructureKHR)

#define SERIALISE_HANDLE(type) DECLARE_REFLECTION_STRUCT(type)

Expand All @@ -1028,6 +1035,15 @@ SERIALISE_VK_HANDLES();
// declare reflect-able types

// pNext structs - always have deserialise for the next chain
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureBuildGeometryInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureBuildSizesInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureCreateInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureDeviceAddressInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureGeometryAabbsDataKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureGeometryInstancesDataKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureGeometryKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureGeometryTrianglesDataKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureVersionInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAcquireNextImageInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAcquireProfilingLockInfoKHR);
DECLARE_REFLECTION_STRUCT(VkApplicationInfo);
Expand Down Expand Up @@ -1064,11 +1080,14 @@ DECLARE_REFLECTION_STRUCT(VkCommandBufferSubmitInfo);
DECLARE_REFLECTION_STRUCT(VkCommandPoolCreateInfo);
DECLARE_REFLECTION_STRUCT(VkComputePipelineCreateInfo);
DECLARE_REFLECTION_STRUCT(VkConditionalRenderingBeginInfoEXT);
DECLARE_REFLECTION_STRUCT(VkCopyAccelerationStructureInfoKHR);
DECLARE_REFLECTION_STRUCT(VkCopyAccelerationStructureToMemoryInfoKHR);
DECLARE_REFLECTION_STRUCT(VkCopyBufferInfo2);
DECLARE_REFLECTION_STRUCT(VkCopyBufferToImageInfo2);
DECLARE_REFLECTION_STRUCT(VkCopyDescriptorSet);
DECLARE_REFLECTION_STRUCT(VkCopyImageInfo2);
DECLARE_REFLECTION_STRUCT(VkCopyImageToBufferInfo2);
DECLARE_REFLECTION_STRUCT(VkCopyMemoryToAccelerationStructureInfoKHR);
DECLARE_REFLECTION_STRUCT(VkDebugMarkerMarkerInfoEXT);
DECLARE_REFLECTION_STRUCT(VkDebugMarkerObjectNameInfoEXT);
DECLARE_REFLECTION_STRUCT(VkDebugMarkerObjectTagInfoEXT);
Expand Down Expand Up @@ -1187,6 +1206,8 @@ DECLARE_REFLECTION_STRUCT(VkPerformanceQuerySubmitInfoKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevice16BitStorageFeatures);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevice4444FormatsFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevice8BitStorageFeatures);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceAccelerationStructureFeaturesKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceAccelerationStructurePropertiesKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceASTCDecodeFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT);
Expand Down Expand Up @@ -1280,6 +1301,7 @@ DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceProtectedMemoryFeatures);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceProtectedMemoryProperties);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevicePushDescriptorPropertiesKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceRayQueryFeaturesKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceRobustness2FeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceRobustness2PropertiesEXT);
Expand Down Expand Up @@ -1445,8 +1467,18 @@ DECLARE_REFLECTION_STRUCT(VkValidationFlagsEXT);
DECLARE_REFLECTION_STRUCT(VkVertexInputAttributeDescription2EXT);
DECLARE_REFLECTION_STRUCT(VkVertexInputBindingDescription2EXT);
DECLARE_REFLECTION_STRUCT(VkWriteDescriptorSet);
DECLARE_REFLECTION_STRUCT(VkWriteDescriptorSetAccelerationStructureKHR);
DECLARE_REFLECTION_STRUCT(VkWriteDescriptorSetInlineUniformBlock);

DECLARE_DESERIALISE_TYPE(VkAccelerationStructureBuildGeometryInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureBuildSizesInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureCreateInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureDeviceAddressInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureGeometryAabbsDataKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureGeometryInstancesDataKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureGeometryKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureGeometryTrianglesDataKHR);
DECLARE_DESERIALISE_TYPE(VkAccelerationStructureVersionInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAcquireNextImageInfoKHR);
DECLARE_DESERIALISE_TYPE(VkAcquireProfilingLockInfoKHR);
DECLARE_DESERIALISE_TYPE(VkApplicationInfo);
Expand Down Expand Up @@ -1481,11 +1513,14 @@ DECLARE_DESERIALISE_TYPE(VkCommandBufferSubmitInfo);
DECLARE_DESERIALISE_TYPE(VkCommandPoolCreateInfo);
DECLARE_DESERIALISE_TYPE(VkComputePipelineCreateInfo);
DECLARE_DESERIALISE_TYPE(VkConditionalRenderingBeginInfoEXT);
DECLARE_DESERIALISE_TYPE(VkCopyAccelerationStructureInfoKHR);
DECLARE_DESERIALISE_TYPE(VkCopyAccelerationStructureToMemoryInfoKHR);
DECLARE_DESERIALISE_TYPE(VkCopyBufferInfo2);
DECLARE_DESERIALISE_TYPE(VkCopyBufferToImageInfo2);
DECLARE_DESERIALISE_TYPE(VkCopyDescriptorSet);
DECLARE_DESERIALISE_TYPE(VkCopyImageInfo2);
DECLARE_DESERIALISE_TYPE(VkCopyImageToBufferInfo2);
DECLARE_DESERIALISE_TYPE(VkCopyMemoryToAccelerationStructureInfoKHR);
DECLARE_DESERIALISE_TYPE(VkDebugMarkerMarkerInfoEXT);
DECLARE_DESERIALISE_TYPE(VkDebugMarkerObjectNameInfoEXT);
DECLARE_DESERIALISE_TYPE(VkDebugMarkerObjectTagInfoEXT);
Expand Down Expand Up @@ -1602,6 +1637,8 @@ DECLARE_DESERIALISE_TYPE(VkPerformanceQuerySubmitInfoKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevice16BitStorageFeatures);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevice4444FormatsFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevice8BitStorageFeatures);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceAccelerationStructureFeaturesKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceAccelerationStructurePropertiesKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceASTCDecodeFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT);
Expand Down Expand Up @@ -1693,6 +1730,7 @@ DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceProtectedMemoryFeatures);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceProtectedMemoryProperties);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevicePushDescriptorPropertiesKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceRayQueryFeaturesKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceRobustness2FeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceRobustness2PropertiesEXT);
Expand Down Expand Up @@ -1855,9 +1893,14 @@ DECLARE_DESERIALISE_TYPE(VkValidationFlagsEXT);
DECLARE_DESERIALISE_TYPE(VkVertexInputAttributeDescription2EXT);
DECLARE_DESERIALISE_TYPE(VkVertexInputBindingDescription2EXT);
DECLARE_DESERIALISE_TYPE(VkWriteDescriptorSet);
DECLARE_DESERIALISE_TYPE(VkWriteDescriptorSetAccelerationStructureKHR);
DECLARE_DESERIALISE_TYPE(VkWriteDescriptorSetInlineUniformBlock);

// plain structs with no next chain
DECLARE_REFLECTION_STRUCT(VkAabbPositionsKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureBuildRangeInfoKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureGeometryDataKHR);
DECLARE_REFLECTION_STRUCT(VkAccelerationStructureInstanceKHR);
DECLARE_REFLECTION_STRUCT(VkAllocationCallbacks);
DECLARE_REFLECTION_STRUCT(VkAttachmentDescription);
DECLARE_REFLECTION_STRUCT(VkAttachmentReference);
Expand All @@ -1876,6 +1919,8 @@ DECLARE_REFLECTION_STRUCT(VkDescriptorImageInfo);
DECLARE_REFLECTION_STRUCT(VkDescriptorPoolSize);
DECLARE_REFLECTION_STRUCT(VkDescriptorSetLayoutBinding);
DECLARE_REFLECTION_STRUCT(VkDescriptorUpdateTemplateEntry);
DECLARE_REFLECTION_STRUCT(VkDeviceOrHostAddressConstKHR);
DECLARE_REFLECTION_STRUCT(VkDeviceOrHostAddressKHR);
DECLARE_REFLECTION_STRUCT(VkDispatchIndirectCommand);
DECLARE_REFLECTION_STRUCT(VkDisplayModeParametersKHR);
DECLARE_REFLECTION_STRUCT(VkDisplayModePropertiesKHR);
Expand Down Expand Up @@ -1932,12 +1977,16 @@ DECLARE_REFLECTION_STRUCT(VkSubpassDependency);
DECLARE_REFLECTION_STRUCT(VkSubpassDescription);
DECLARE_REFLECTION_STRUCT(VkSurfaceCapabilitiesKHR);
DECLARE_REFLECTION_STRUCT(VkSurfaceFormatKHR);
DECLARE_REFLECTION_STRUCT(VkTransformMatrixKHR);
DECLARE_REFLECTION_STRUCT(VkVertexInputAttributeDescription);
DECLARE_REFLECTION_STRUCT(VkVertexInputBindingDescription);
DECLARE_REFLECTION_STRUCT(VkVertexInputBindingDivisorDescriptionEXT);
DECLARE_REFLECTION_STRUCT(VkViewport);
DECLARE_REFLECTION_STRUCT(VkXYColorEXT);

// rdcarray serialisation is generic but the stringification is not
DECLARE_STRINGISE_TYPE(rdcarray<VkAccelerationStructureBuildRangeInfoKHR>);

DECLARE_DESERIALISE_TYPE(VkDescriptorSetLayoutBinding);
DECLARE_DESERIALISE_TYPE(VkPresentRegionKHR);
DECLARE_DESERIALISE_TYPE(VkSparseBufferMemoryBindInfo);
Expand Down Expand Up @@ -2033,6 +2082,10 @@ enum VkFormatFeatureFlagBits2 : uint64_t

// enums

DECLARE_REFLECTION_ENUM(VkAccelerationStructureBuildTypeKHR);
DECLARE_REFLECTION_ENUM(VkAccelerationStructureCompatibilityKHR);
DECLARE_REFLECTION_ENUM(VkAccelerationStructureCreateFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkAccelerationStructureTypeKHR);
DECLARE_REFLECTION_ENUM(VkAccessFlagBits);
DECLARE_REFLECTION_ENUM(VkAccessFlagBits2);
DECLARE_REFLECTION_ENUM(VkAcquireProfilingLockFlagBitsKHR);
Expand All @@ -2044,6 +2097,8 @@ DECLARE_REFLECTION_ENUM(VkBlendOp);
DECLARE_REFLECTION_ENUM(VkBorderColor);
DECLARE_REFLECTION_ENUM(VkBufferCreateFlagBits);
DECLARE_REFLECTION_ENUM(VkBufferUsageFlagBits);
DECLARE_REFLECTION_ENUM(VkBuildAccelerationStructureFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkBuildAccelerationStructureModeKHR);
DECLARE_REFLECTION_ENUM(VkChromaLocation);
DECLARE_REFLECTION_ENUM(VkColorComponentFlagBits);
DECLARE_REFLECTION_ENUM(VkColorSpaceKHR);
Expand All @@ -2056,6 +2111,7 @@ DECLARE_REFLECTION_ENUM(VkComponentSwizzle);
DECLARE_REFLECTION_ENUM(VkCompositeAlphaFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkConditionalRenderingFlagBitsEXT);
DECLARE_REFLECTION_ENUM(VkConservativeRasterizationModeEXT);
DECLARE_REFLECTION_ENUM(VkCopyAccelerationStructureModeKHR);
DECLARE_REFLECTION_ENUM(VkCullModeFlagBits);
DECLARE_REFLECTION_ENUM(VkDebugReportFlagBitsEXT);
DECLARE_REFLECTION_ENUM(VkDebugUtilsMessageSeverityFlagBitsEXT);
Expand Down Expand Up @@ -2092,6 +2148,9 @@ DECLARE_REFLECTION_ENUM(VkFormatFeatureFlagBits);
DECLARE_REFLECTION_ENUM(VkFormatFeatureFlagBits2);
DECLARE_REFLECTION_ENUM(VkFragmentShadingRateCombinerOpKHR);
DECLARE_REFLECTION_ENUM(VkFramebufferCreateFlagBits);
DECLARE_REFLECTION_ENUM(VkGeometryFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkGeometryInstanceFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkGeometryTypeKHR);
DECLARE_REFLECTION_ENUM(VkGraphicsPipelineLibraryFlagBitsEXT);
DECLARE_REFLECTION_ENUM(VkFrontFace);
DECLARE_REFLECTION_ENUM(VkImageAspectFlagBits);
Expand Down
14 changes: 14 additions & 0 deletions renderdoc/driver/vulkan/vk_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3989,6 +3989,20 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk)
return Serialise_vkCmdSetTessellationDomainOriginEXT(ser, VK_NULL_HANDLE,
VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM);

case VulkanChunk::vkCmdBuildAccelerationStructuresIndirectKHR:
return Serialise_vkCmdBuildAccelerationStructuresIndirectKHR(ser, VK_NULL_HANDLE, 0, NULL,
NULL, NULL, NULL);
case VulkanChunk::vkCmdBuildAccelerationStructuresKHR:
return Serialise_vkCmdBuildAccelerationStructuresKHR(ser, VK_NULL_HANDLE, 0, NULL, NULL);
case VulkanChunk::vkCmdCopyAccelerationStructureKHR:
return Serialise_vkCmdCopyAccelerationStructureKHR(ser, VK_NULL_HANDLE, NULL);
case VulkanChunk::vkCmdCopyAccelerationStructureToMemoryKHR:
return Serialise_vkCmdCopyAccelerationStructureToMemoryKHR(ser, VK_NULL_HANDLE, NULL);
case VulkanChunk::vkCmdCopyMemoryToAccelerationStructureKHR:
return Serialise_vkCmdCopyMemoryToAccelerationStructureKHR(ser, VK_NULL_HANDLE, NULL);
case VulkanChunk::vkCreateAccelerationStructureKHR:
return Serialise_vkCreateAccelerationStructureKHR(ser, VK_NULL_HANDLE, NULL, NULL, NULL);

// chunks that are reserved but not yet serialised
case VulkanChunk::vkResetCommandPool:
case VulkanChunk::vkCreateDepthTargetView:
Expand Down
66 changes: 66 additions & 0 deletions renderdoc/driver/vulkan/vk_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2812,4 +2812,70 @@ class WrappedVulkan : public IFrameCapturer
VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
VkBuffer countBuffer, VkDeviceSize countBufferOffset,
uint32_t maxDrawCount, uint32_t stride);

// VK_KHR_deferred_host_operations
VkResult vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks *pAllocator,
VkDeferredOperationKHR *pDeferredOperation);
VkResult vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation);
void vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation,
const VkAllocationCallbacks *pAllocator);
uint32_t vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation);
VkResult vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation);

// VK_KHR_acceleration_structure
VkResult vkBuildAccelerationStructuresKHR(
VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR *pInfos,
const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos);
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdBuildAccelerationStructuresIndirectKHR,
VkCommandBuffer commandBuffer, uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR *pInfos,
const VkDeviceAddress *pIndirectDeviceAddresses,
const uint32_t *pIndirectStrides,
const uint32_t *const *ppMaxPrimitiveCounts);
IMPLEMENT_FUNCTION_SERIALISED(
void, vkCmdBuildAccelerationStructuresKHR, VkCommandBuffer commandBuffer, uint32_t infoCount,
const VkAccelerationStructureBuildGeometryInfoKHR *pInfos,
const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos);
VkResult vkCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation,
const VkCopyAccelerationStructureInfoKHR *pInfo);
VkResult vkCopyAccelerationStructureToMemoryKHR(
VkDevice device, VkDeferredOperationKHR deferredOperation,
const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo);
VkResult vkCopyMemoryToAccelerationStructureKHR(
VkDevice device, VkDeferredOperationKHR deferredOperation,
const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo);
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdCopyAccelerationStructureKHR,
VkCommandBuffer commandBuffer,
const VkCopyAccelerationStructureInfoKHR *pInfo);
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdCopyAccelerationStructureToMemoryKHR,
VkCommandBuffer commandBuffer,
const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo);
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdCopyMemoryToAccelerationStructureKHR,
VkCommandBuffer commandBuffer,
const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo);
void vkCmdWriteAccelerationStructuresPropertiesKHR(
VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType,
VkQueryPool queryPool, uint32_t firstQuery);
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateAccelerationStructureKHR, VkDevice device,
const VkAccelerationStructureCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkAccelerationStructureKHR *pAccelerationStructure);
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyAccelerationStructureKHR, VkDevice device,
VkAccelerationStructureKHR accelerationStructure,
const VkAllocationCallbacks *pAllocator);
void vkGetAccelerationStructureBuildSizesKHR(
VkDevice device, VkAccelerationStructureBuildTypeKHR buildType,
const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo,
const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo);
VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR(
VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR *pInfo);
void vkGetDeviceAccelerationStructureCompatibilityKHR(
VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo,
VkAccelerationStructureCompatibilityKHR *pCompatibility);
VkResult vkWriteAccelerationStructuresPropertiesKHR(
VkDevice device, uint32_t accelerationStructureCount,
const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType,
size_t dataSize, void *pData, size_t stride);
};
8 changes: 8 additions & 0 deletions renderdoc/driver/vulkan/vk_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,14 @@ const VulkanCreationInfo::PipelineLayout &VulkanDebugManager::GetPipelineLayoutI
return it->second;
}

const VulkanCreationInfo::AccelerationStructure &VulkanDebugManager::GetAccelerationStructureInfo(
ResourceId as) const
{
auto it = m_pDriver->m_CreationInfo.m_AccelerationStructure.find(as);
RDCASSERT(it != m_pDriver->m_CreationInfo.m_AccelerationStructure.end());
return it->second;
}

const DescSetLayout &VulkanDebugManager::GetDescSetLayout(ResourceId dsl) const
{
auto it = m_pDriver->m_CreationInfo.m_DescSetLayout.find(dsl);
Expand Down
1 change: 1 addition & 0 deletions renderdoc/driver/vulkan/vk_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class VulkanDebugManager
const VulkanCreationInfo::Framebuffer &GetFramebufferInfo(ResourceId fb) const;
const VulkanCreationInfo::RenderPass &GetRenderPassInfo(ResourceId rp) const;
const VulkanCreationInfo::PipelineLayout &GetPipelineLayoutInfo(ResourceId pp) const;
const VulkanCreationInfo::AccelerationStructure &GetAccelerationStructureInfo(ResourceId as) const;
const DescSetLayout &GetDescSetLayout(ResourceId dsl) const;
const WrappedVulkan::DescriptorSetInfo &GetDescSetInfo(ResourceId ds) const;

Expand Down
Loading

0 comments on commit fa70f8f

Please sign in to comment.