#pragma once #include "vulkan/system/vk_objects.h" #include "hw_levelmesh.h" class VulkanFrameBuffer; class VkRaytrace { public: VkRaytrace(VulkanFrameBuffer* fb); void SetLevelMesh(hwrenderer::LevelMesh* mesh); VulkanAccelerationStructure* GetAccelStruct() { return tlAccelStruct.get(); } private: void Reset(); void CreateVulkanObjects(); void CreateVertexAndIndexBuffers(); void CreateBottomLevelAccelerationStructure(); void CreateTopLevelAccelerationStructure(); VulkanFrameBuffer* 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; };