2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
#include "zvulkan/vulkanobjects.h"
|
2022-07-02 08:09:59 +00:00
|
|
|
#include "hw_levelmesh.h"
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
class VulkanRenderDevice;
|
2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
class VkRaytrace
|
|
|
|
{
|
|
|
|
public:
|
2022-12-11 17:30:01 +00:00
|
|
|
VkRaytrace(VulkanRenderDevice* fb);
|
2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
void SetLevelMesh(hwrenderer::LevelMesh* mesh);
|
|
|
|
|
|
|
|
VulkanAccelerationStructure* GetAccelStruct() { return tlAccelStruct.get(); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Reset();
|
|
|
|
void CreateVulkanObjects();
|
|
|
|
void CreateVertexAndIndexBuffers();
|
|
|
|
void CreateBottomLevelAccelerationStructure();
|
|
|
|
void CreateTopLevelAccelerationStructure();
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
VulkanRenderDevice* fb = nullptr;
|
2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
hwrenderer::LevelMesh NullMesh;
|
|
|
|
hwrenderer::LevelMesh* Mesh = nullptr;
|
|
|
|
|
|
|
|
std::unique_ptr<VulkanBuffer> vertexBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> indexBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> transferBuffer;
|
|
|
|
|
|
|
|
std::unique_ptr<VulkanBuffer> blScratchBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> blAccelStructBuffer;
|
|
|
|
std::unique_ptr<VulkanAccelerationStructure> blAccelStruct;
|
|
|
|
|
|
|
|
std::unique_ptr<VulkanBuffer> tlTransferBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> tlScratchBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> tlInstanceBuffer;
|
|
|
|
std::unique_ptr<VulkanBuffer> tlAccelStructBuffer;
|
|
|
|
std::unique_ptr<VulkanAccelerationStructure> tlAccelStruct;
|
|
|
|
};
|