buffered TLAS
This commit is contained in:
parent
1576d9a8b3
commit
642cef78b1
4 changed files with 23 additions and 64 deletions
|
|
@ -28,17 +28,22 @@ import :Mesh;
|
|||
import :VulkanBuffer;
|
||||
|
||||
export namespace Crafter {
|
||||
|
||||
struct TlasWithBuffer {
|
||||
VulkanBuffer<char, false, true, false> buffer;
|
||||
VkAccelerationStructureKHR accelerationStructure;
|
||||
VulkanBuffer<VkAccelerationStructureInstanceKHR, true, true, false> instanceBuffer;
|
||||
};
|
||||
|
||||
class RenderingElement3DVulkan {
|
||||
public:
|
||||
Mesh* mesh;
|
||||
VkAccelerationStructureInstanceKHR instance;
|
||||
static std::vector<RenderingElement3DVulkan> elements;
|
||||
inline static VulkanBuffer<VkAccelerationStructureInstanceKHR, true, true, false> instanceBuffer;
|
||||
inline static VulkanBuffer<char, false, true, false> scratchBuffer;
|
||||
inline static VulkanBuffer<char, false, true, false> tlasBuffer;
|
||||
inline static VkAccelerationStructureKHR accelerationStructure;
|
||||
inline static std::vector<TlasWithBuffer> tlases;
|
||||
RenderingElement3DVulkan(Mesh& mesh);
|
||||
static void BuildTLAS(VkCommandBuffer cmd);
|
||||
static void BuildTLAS(VkCommandBuffer cmd, std::uint32_t index);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue