#pragma once #include "zvulkan/vulkanobjects.h" #include "hw_levelmesh.h" class VulkanRenderDevice; class VkRaytrace { public: VkRaytrace(VulkanRenderDevice* fb); void SetLevelMesh(hwrenderer::LevelMesh* mesh); VulkanAccelerationStructure* GetAccelStruct() { return tlAccelStruct.get(); } private: void Reset(); void CreateVulkanObjects(); void CreateVertexAndIndexBuffers(); void CreateBottomLevelAccelerationStructure(); void CreateTopLevelAccelerationStructure(); VulkanRenderDevice* fb = nullptr; hwrenderer::LevelMesh NullMesh; hwrenderer::LevelMesh* Mesh = nullptr; std::unique_ptr vertexBuffer; std::unique_ptr indexBuffer; std::unique_ptr transferBuffer; std::unique_ptr blScratchBuffer; std::unique_ptr blAccelStructBuffer; std::unique_ptr blAccelStruct; std::unique_ptr tlTransferBuffer; std::unique_ptr tlScratchBuffer; std::unique_ptr tlInstanceBuffer; std::unique_ptr tlAccelStructBuffer; std::unique_ptr tlAccelStruct; };