Foundation
Loading...
Searching...
No Matches
Classes | Functions | Variables
GPUScene.cpp File Reference
#include "GPUScene.hpp"
#include <Core/Allocator.hpp>
#include <Core/AllocatorStack.hpp>
#include <Core/Atomic.hpp>
#include <Core/AtomicQueue.hpp>
#include <Core/Hash.hpp>
#include <Core/JobSystem.hpp>
#include <Core/Thread.hpp>
#include <algorithm>
#include <bit>
#include <condition_variable>
#include <cstddef>
#include <numbers>
#include "LightBVH.hpp"
#include "Precompute.hpp"
#include "Renderer.hpp"
#include "Tables/GGX.hpp"
#include "Tables/GGX_IOR.hpp"
#include "Tables/LTCSheen.hpp"
#include "Tables/Sobol.hpp"

Classes

struct  UploadGPURingBuffer< T >
 
struct  GPUSceneImpl
 
struct  GPUSceneImpl::Geometry
 
struct  GPUSceneImpl::DynamicTextureUpload
 
struct  GPUSceneImpl::DynamicTextureGPUUpdate
 
struct  GPUSceneImpl::Texture
 
struct  GPUSceneImpl::PendingGeometryUpload
 
struct  GPUSceneImpl::PendingTextureUpload
 
struct  GPUSceneImpl::PendingBufferUpload
 
struct  GPUSceneImpl::BlobCopyTask
 
struct  GPUSceneImpl::UploadBatchState
 

Functions

static bool IsIntersectableLight (GSLight const &light)
 
static bool IsSunDiskLight (GSLight const &light)
 
static size_t GPUSceneTextureSubresourceFootprint (FTextureHeader const &metadata, uint32_t layer, uint32_t mip)
 
static void GPUSceneAccumulateUploadBudget (size_t &budget, size_t bytes)
 
template<typename T >
uint32_t FreelistPop (Vector< T > &storage, Vector< uint32_t > &freelist)
 
void FreelistPush (Vector< uint32_t > &freelist, uint32_t slot)
 
static bool IsTexture3DView (RHITextureDimension dimension)
 
static uint32_t GetTextureUploadAlignment (FTextureHeader const &metadata)
 
static FSerializedBounds BuildMeshBounds (FImportedMesh const &mesh)
 
static Pair< FSerializedMesh, Vector< unsigned char > > SerializedFromMesh (FImportedMesh const &mesh, Allocator *alloc)
 
static FSerializedTexture SerializedFromTexture (FTexture const &source, Allocator *alloc)
 
static void TransitionTextureLayout (RHICommandList *cmd, RHITexture *texture, FTextureHeader const &metadata, RHITextureLayout from, RHITextureLayout to)
 
static RHITextureResolvePoolTexture (BindlessPool &pool, uint32_t index)
 

Variables

static constexpr size_t kUploadBudgetSlack = 1ull * (1ull << 20)
 
static constexpr size_t kUploadStagingAlignment = 64ull << 10u
 
static constexpr size_t kUploadStagingBuffers = 1u
 
static constexpr size_t kBLASBuildBatchSize = 32u
 
static constexpr size_t kGPUSceneBufferQueueCapacity = 256u
 
static constexpr uint32_t kGPUSceneDynamicRebuildRate = 60u
 
static constexpr size_t kMinDirectGeometryUploadHeapSize = 512ull * (1ull << 20)
 
static constexpr uint32_t kGPUScenePersistentTexture3DBindings = 3u
 
static constexpr uint32_t kGPUSceneTextureBindingSlack = 8u
 
static constexpr size_t kGPUSceneByteBudgetSlack = 64u << 10u
 

Function Documentation

◆ BuildMeshBounds()

static FSerializedBounds BuildMeshBounds ( FImportedMesh const &  mesh)
static

◆ FreelistPop()

template<typename T >
uint32_t FreelistPop ( Vector< T > &  storage,
Vector< uint32_t > &  freelist 
)

◆ FreelistPush()

void FreelistPush ( Vector< uint32_t > &  freelist,
uint32_t  slot 
)

◆ GetTextureUploadAlignment()

static uint32_t GetTextureUploadAlignment ( FTextureHeader const &  metadata)
static

◆ GPUSceneAccumulateUploadBudget()

static void GPUSceneAccumulateUploadBudget ( size_t &  budget,
size_t  bytes 
)
static

◆ GPUSceneTextureSubresourceFootprint()

static size_t GPUSceneTextureSubresourceFootprint ( FTextureHeader const &  metadata,
uint32_t  layer,
uint32_t  mip 
)
static

◆ IsIntersectableLight()

static bool IsIntersectableLight ( GSLight const &  light)
static

◆ IsSunDiskLight()

static bool IsSunDiskLight ( GSLight const &  light)
static

◆ IsTexture3DView()

static bool IsTexture3DView ( RHITextureDimension  dimension)
static

◆ ResolvePoolTexture()

static RHITexture * ResolvePoolTexture ( BindlessPool pool,
uint32_t  index 
)
static

◆ SerializedFromMesh()

static Pair< FSerializedMesh, Vector< unsigned char > > SerializedFromMesh ( FImportedMesh const &  mesh,
Allocator alloc 
)
static

◆ SerializedFromTexture()

static FSerializedTexture SerializedFromTexture ( FTexture const &  source,
Allocator alloc 
)
static

◆ TransitionTextureLayout()

static void TransitionTextureLayout ( RHICommandList cmd,
RHITexture texture,
FTextureHeader const &  metadata,
RHITextureLayout  from,
RHITextureLayout  to 
)
static

Variable Documentation

◆ kBLASBuildBatchSize

constexpr size_t kBLASBuildBatchSize = 32u
staticconstexpr

◆ kGPUSceneBufferQueueCapacity

constexpr size_t kGPUSceneBufferQueueCapacity = 256u
staticconstexpr

◆ kGPUSceneByteBudgetSlack

constexpr size_t kGPUSceneByteBudgetSlack = 64u << 10u
staticconstexpr

◆ kGPUSceneDynamicRebuildRate

constexpr uint32_t kGPUSceneDynamicRebuildRate = 60u
staticconstexpr

◆ kGPUScenePersistentTexture3DBindings

constexpr uint32_t kGPUScenePersistentTexture3DBindings = 3u
staticconstexpr

◆ kGPUSceneTextureBindingSlack

constexpr uint32_t kGPUSceneTextureBindingSlack = 8u
staticconstexpr

◆ kMinDirectGeometryUploadHeapSize

constexpr size_t kMinDirectGeometryUploadHeapSize = 512ull * (1ull << 20)
staticconstexpr

◆ kUploadBudgetSlack

constexpr size_t kUploadBudgetSlack = 1ull * (1ull << 20)
staticconstexpr

◆ kUploadStagingAlignment

constexpr size_t kUploadStagingAlignment = 64ull << 10u
staticconstexpr

◆ kUploadStagingBuffers

constexpr size_t kUploadStagingBuffers = 1u
staticconstexpr