Toast Engine
Loading...
Searching...
No Matches
renderer::VoxelGpuStorage Class Reference

Immutable scene version and versions from small carves share buffers patched in place. More...

#include <voxel_gpu_storage.hpp>

Inheritance diagram for renderer::VoxelGpuStorage:
Collaboration diagram for renderer::VoxelGpuStorage:

Public Types

enum class  Section : uint8_t {
  materials , occupancy , grids , coarse ,
  palettes , records
}
 In voxel_dda.slang binding order.
Public Types inherited from renderer::IVulkanResource
enum class  UploadState : std::uint8_t { uploading , ready , failed_load , failed_gpu }

Public Member Functions

 VoxelGpuStorage (std::vector< uint64_t > node_rids, std::vector< glm::uvec3 > brick_dims)
 New section buffers that a VoxelSceneUpload fills.
 VoxelGpuStorage (std::vector< uint64_t > node_rids, std::vector< glm::uvec3 > brick_dims, const VoxelGpuStorage &previous, uint64_t patch_sequence)
 Ready at once over the buffers of previous and needs every patch up to patch_sequence applied.
auto generation () const noexcept -> uint64_t
 Unique per storage so a cache keyed on it notices every upload.
auto recordIndexOf (uint64_t node_rid) const -> std::optional< uint32_t >
auto recordBrickDims (uint32_t index) const -> glm::uvec3
auto recordCount () const noexcept -> uint32_t
auto buffer (Section section) const -> vk::Buffer
auto size (Section section) const -> vk::DeviceSize
auto queuePatch (const VulkanCore &core, const voxel::gpu::ScenePatch &patch) const -> std::optional< uint64_t >
 Tick thread on a ready storage and nullopt when the pool outgrew the buffers or staging failed.
void recordPendingPatches (vk::CommandBuffer cmd, std::vector< std::shared_ptr< void > > &retired) const
 Render thread before anything reads the sections and retired must outlive the frame.
auto nodeRid (uint32_t index) const -> uint64_t
void setDebugInfo (VoxelStorageDebugInfo info)
auto debugInfo () const -> const VoxelStorageDebugInfo &
void setChangeHistory (VoxelChangeHistory history)
auto changeHistory () const -> const VoxelChangeHistory &
Public Member Functions inherited from renderer::IVulkanResource
void markUploading ()
void markReady ()
void markFailed (UploadState reason)
auto isReady () const -> bool
auto hasFailed () const -> bool
auto state () const -> UploadState

Static Public Attributes

static constexpr size_t k_section_count = 6

Friends

class VoxelSceneUpload

Detailed Description

Immutable scene version and versions from small carves share buffers patched in place.

Member Function Documentation

◆ setChangeHistory()

void renderer::VoxelGpuStorage::setChangeHistory ( VoxelChangeHistory history)
inline
Note
Main thread only and before the upload is queued

◆ setDebugInfo()

void renderer::VoxelGpuStorage::setDebugInfo ( VoxelStorageDebugInfo info)
inline
Note
Main thread only and before the upload is queued

The documentation for this class was generated from the following files: