|
Foundation
|
#include <GPUScene.hpp>
Classes | |
| struct | GPUSceneTables |
| struct | MemoryStat |
| struct | UpdateResult |
Public Types | |
| enum class | DynamicTextureGPUAccess { UAV , RTV } |
| enum class | Result { Ready , InProgress , InvalidInput , InvalidHandle , OutOfMemory , DecodeFailed , Cancelled } |
| enum class | TLASBuildResult { Built , Empty } |
Public Member Functions | |
| GPUScene (RHIDevice *device, JobSystem *jobs, Allocator *allocator, GPUSceneDesc const &desc, AllocatorStack *frameScratch=nullptr) | |
| ~GPUScene () | |
| Result | Upload (FBlobDeserializer *blobs, FSerializedMesh const &source, GeometryHandle &outHandle) |
| Result | Upload (FImportedMesh const &source, GeometryHandle &outHandle) |
| Result | Allocate (uint32_t vertexCount, uint32_t indexCount, GeometryHandle &outHandle, bool isGpu=false) |
| Allocates a dynamic geometry handle. | |
| Result | Allocate (uint32_t vertexCount, uint32_t indexCount, uint32_t leafCount, GeometryHandle &outHandle, bool isGpu=false) |
| Result | Allocate (RHITextureDesc const &desc, TextureHandle &outHandle, bool isGpu=false, const char *debugName=nullptr) |
| Result | Upload (FBlobDeserializer *blobs, FSerializedCurve const &source, GeometryHandle &outHandle) |
| Result | Upload (FBlobDeserializer *blobs, FSerializedTexture const &source, TextureHandle &outTexture, const char *debugName=nullptr, bool pinned=false) |
| Result | Upload (FTexture const &source, TextureHandle &outTexture, const char *debugName=nullptr, bool pinned=false) |
| Result | UploadEnvironmentMap (FTexture const &source) |
| bool | HasEnvironmentMap () const |
| Result | Upload (RHIBuffer *dst, Span< const unsigned char > data, uint32_t dstOffset=0) |
| Result | Query (GeometryHandle handle) const |
| Result | Query (TextureHandle texture) const |
| void | Join () |
| Result | Poll (size_t timeout) |
| void | UpdateUBO (RendererUBO &globals) const |
| GPUSceneTables | BeginScene (uint32_t instanceCount, uint32_t materialCount, uint32_t lightCount) |
| void | ResolveGeometry (GeometryHandle handle, uint32_t &outPrimitiveOffset, uint32_t &outPrimitiveType, GSInstanceFlags &outPrimitiveFlags) const |
| UpdateResult | EndScene (GPUSceneTables &tables) |
| void | DbgGetMemoryStatistics (Vector< MemoryStat > &outStats) const |
| String | DbgGetBufferStatistics () const |
| uint32_t | GetLightCapacity () const |
| TLASBuildResult | BuildTLAS (RHICommandList *cmd, bool update=false) |
| bool | HasDynamicGeometry () const |
| bool | HasDynamicTextures () const |
| bool | HasCurveGeometry () const |
| void | BeginDynamicUpdate () |
| void | UpdateDynamicMeshCPU (GeometryHandle handle, Span< const FQVertex > vertices={}, Span< const uint32_t > indices={}) |
| Host-mapped copy. Requires isGpu = false with Allocate. | |
| void | UpdateDynamicMeshGPU (GeometryHandle handle, bool updateVertices, bool updateIndices) |
| Device local writes. Requires isGpu = true with Allocate. | |
| void | UpdateDynamicCurveCPU (GeometryHandle handle, Span< const FCurveDOTSVertex > vertices={}, Span< const uint32_t > indices={}, Span< const FCurveLeaf > leaves={}) |
| Host-mapped copy. Requires isGpu = false with Allocate. | |
| void | UpdateDynamicCurveGPU (GeometryHandle handle, bool updateVertices, bool updateIndices, bool updateLeaves) |
| Device local writes. Requires isGpu = true with Allocate. | |
| void | UpdateDynamicTextureCPU (TextureHandle handle, FTexture const &source) |
| Host-mapped copy. Requires isGpu = false with Allocate. | |
| uint32_t | UpdateDynamicTextureGPU (TextureHandle handle, DynamicTextureGPUAccess access=DynamicTextureGPUAccess::UAV) |
| Device local writes. Requires isGpu = true with Allocate. | |
| void | EndDynamicUpdate () |
| void | UploadDynamicGeometryCPU (RHICommandList *cmd) |
| Commits host-side geometry and texture updates. GPU-side updates are not required to be committed, as they are already in device-local memory. | |
| void | UploadDynamicTexturesCPU (RHICommandList *cmd) |
| void | BeginDynamicTextureGPU (RHICommandList *cmd, bool is3D, DynamicTextureGPUAccess access) |
| void | EndDynamicTextureGPU (RHICommandList *cmd, bool is3D, DynamicTextureGPUAccess access) |
| RHITexture * | ResolveDynamicTextureGPU (TextureHandle handle, RHITextureUsage requiredUsage) const |
| void | CompleteDynamicTextureGPU (TextureHandle handle, DynamicTextureGPUAccess access) |
| void | BuildBLAS (RHICommandList *cmd) |
| uint32_t | GetDynamicRefitCount () const |
| uint32_t | GetDynamicRebuildCount () const |
| void | Collect () |
| Garbage-collects geometry and textures no longer referenced by the committed scene tables. | |
| GSInstance | GetInstance (uint32_t index) const |
| uint32_t | GetInstanceCount () const |
| uint32_t | InstanceFromTLAS (uint32_t tlasID) const |
| GSLight | GetLight (uint32_t index) const |
| uint32_t | GetLightCount () const |
| GSMaterial | GetMaterial (uint32_t index) const |
| uint32_t | GetMaterialCount () const |
| RHIBuffer * | GetPrimitiveBuffer () const |
| RHIBuffer * | GetDynamicPrimitiveBuffer () const |
| RHIBuffer * | GetDynamicStagingBuffer () const |
| RHIBuffer * | GetInstanceBuffer () const |
| RHIBuffer * | GetMaterialBuffer () const |
| RHIBuffer * | GetLightBuffer () const |
| RHIBuffer * | GetEmissiveClusterBuffer () const |
| RHIBuffer * | GetLightBVHNodeBuffer () const |
| RHIBuffer * | GetLightBVHLightIndexBuffer () const |
| RHIBuffer * | GetLightBVHBitmaskBuffer () const |
| RHIBuffer * | GetLightBVHGlobalIndexBuffer () const |
| RHIBuffer * | GetLightBVHNodeIndexBuffer () const |
| bool | NeedsLightBVHRefit () const |
| uint32_t | GetLightBVHRefitLevelCount () const |
| uint32_t | GetLightBVHRefitLevelOffset (uint32_t level) const |
| uint32_t | GetLightBVHRefitLevelNodeCount (uint32_t level) const |
| uint32_t | GetLightBVHFirstNodeIndex () const |
| GSOffsetCount | GetLightBVHNodes () const |
| GSOffsetCount | GetLightBVHDistantNodes () const |
| BindlessPool * | GetTexture2DPool () |
| BindlessPool * | GetTexture3DPool () |
| BindlessPool const * | GetTexture2DPool () const |
| BindlessPool const * | GetTexture3DPool () const |
| RHITexture * | GetFoundationDefaultTexture2D () const |
| RHITexture * | GetFoundationDefaultTexture2DFloat () const |
| RHIBuffer * | GetFoundationDefaultBufferFloat () const |
| RHIAccelerationStructure * | GetTLAS () const |
| RHIBuffer * | GetSobolMatricesBuffer () const |
| void | Reset () |
Static Public Member Functions | |
| static size_t | CalculateMeshPrimitiveSize (FSerializedMesh const &src) |
| static size_t | CalculateCurvePrimitiveSize (FSerializedCurve const &src) |
Friends | |
| struct | GPUSceneImpl |
|
strong |
|
strong |
|
strong |
| GPUScene::GPUScene | ( | RHIDevice * | device, |
| JobSystem * | jobs, | ||
| Allocator * | allocator, | ||
| GPUSceneDesc const & | desc, | ||
| AllocatorStack * | frameScratch = nullptr |
||
| ) |
|
default |
| GPUScene::Result GPUScene::Allocate | ( | RHITextureDesc const & | desc, |
| TextureHandle & | outHandle, | ||
| bool | isGpu = false, |
||
| const char * | debugName = nullptr |
||
| ) |
| GPUScene::Result GPUScene::Allocate | ( | uint32_t | vertexCount, |
| uint32_t | indexCount, | ||
| GeometryHandle & | outHandle, | ||
| bool | isGpu = false |
||
| ) |
Allocates a dynamic geometry handle.
| isGpu | Whether the dynamic geometry is GPU-local. See UpdateDynamicMeshCPU, UpdateDynamicMeshGPU. |
| GPUScene::Result GPUScene::Allocate | ( | uint32_t | vertexCount, |
| uint32_t | indexCount, | ||
| uint32_t | leafCount, | ||
| GeometryHandle & | outHandle, | ||
| bool | isGpu = false |
||
| ) |
| void GPUScene::BeginDynamicTextureGPU | ( | RHICommandList * | cmd, |
| bool | is3D, | ||
| DynamicTextureGPUAccess | access | ||
| ) |
| void GPUScene::BeginDynamicUpdate | ( | ) |
| GPUScene::GPUSceneTables GPUScene::BeginScene | ( | uint32_t | instanceCount, |
| uint32_t | materialCount, | ||
| uint32_t | lightCount | ||
| ) |
| void GPUScene::BuildBLAS | ( | RHICommandList * | cmd | ) |
| GPUScene::TLASBuildResult GPUScene::BuildTLAS | ( | RHICommandList * | cmd, |
| bool | update = false |
||
| ) |
|
static |
|
static |
| void GPUScene::Collect | ( | ) |
Garbage-collects geometry and textures no longer referenced by the committed scene tables.
| void GPUScene::CompleteDynamicTextureGPU | ( | TextureHandle | handle, |
| DynamicTextureGPUAccess | access | ||
| ) |
| String GPUScene::DbgGetBufferStatistics | ( | ) | const |
| void GPUScene::DbgGetMemoryStatistics | ( | Vector< MemoryStat > & | outStats | ) | const |
| void GPUScene::EndDynamicTextureGPU | ( | RHICommandList * | cmd, |
| bool | is3D, | ||
| DynamicTextureGPUAccess | access | ||
| ) |
| void GPUScene::EndDynamicUpdate | ( | ) |
| GPUScene::UpdateResult GPUScene::EndScene | ( | GPUSceneTables & | tables | ) |
| RHIBuffer * GPUScene::GetDynamicPrimitiveBuffer | ( | ) | const |
| uint32_t GPUScene::GetDynamicRebuildCount | ( | ) | const |
| uint32_t GPUScene::GetDynamicRefitCount | ( | ) | const |
| RHIBuffer * GPUScene::GetDynamicStagingBuffer | ( | ) | const |
| RHIBuffer * GPUScene::GetEmissiveClusterBuffer | ( | ) | const |
|
inline |
| RHITexture * GPUScene::GetFoundationDefaultTexture2D | ( | ) | const |
| RHITexture * GPUScene::GetFoundationDefaultTexture2DFloat | ( | ) | const |
|
inline |
| RHIBuffer * GPUScene::GetInstanceBuffer | ( | ) | const |
|
inline |
|
inline |
| RHIBuffer * GPUScene::GetLightBuffer | ( | ) | const |
| RHIBuffer * GPUScene::GetLightBVHBitmaskBuffer | ( | ) | const |
| GSOffsetCount GPUScene::GetLightBVHDistantNodes | ( | ) | const |
| uint32_t GPUScene::GetLightBVHFirstNodeIndex | ( | ) | const |
| RHIBuffer * GPUScene::GetLightBVHGlobalIndexBuffer | ( | ) | const |
| RHIBuffer * GPUScene::GetLightBVHLightIndexBuffer | ( | ) | const |
| RHIBuffer * GPUScene::GetLightBVHNodeBuffer | ( | ) | const |
| RHIBuffer * GPUScene::GetLightBVHNodeIndexBuffer | ( | ) | const |
| GSOffsetCount GPUScene::GetLightBVHNodes | ( | ) | const |
| uint32_t GPUScene::GetLightBVHRefitLevelCount | ( | ) | const |
| uint32_t GPUScene::GetLightBVHRefitLevelNodeCount | ( | uint32_t | level | ) | const |
| uint32_t GPUScene::GetLightBVHRefitLevelOffset | ( | uint32_t | level | ) | const |
| uint32_t GPUScene::GetLightCapacity | ( | ) | const |
|
inline |
|
inline |
| RHIBuffer * GPUScene::GetMaterialBuffer | ( | ) | const |
|
inline |
|
inline |
|
inline |
| BindlessPool * GPUScene::GetTexture2DPool | ( | ) |
| BindlessPool const * GPUScene::GetTexture2DPool | ( | ) | const |
| BindlessPool * GPUScene::GetTexture3DPool | ( | ) |
| BindlessPool const * GPUScene::GetTexture3DPool | ( | ) | const |
|
inline |
| bool GPUScene::HasCurveGeometry | ( | ) | const |
| bool GPUScene::HasDynamicGeometry | ( | ) | const |
| bool GPUScene::HasDynamicTextures | ( | ) | const |
|
inline |
|
inline |
| void GPUScene::Join | ( | ) |
| bool GPUScene::NeedsLightBVHRefit | ( | ) | const |
| GPUScene::Result GPUScene::Poll | ( | size_t | timeout | ) |
| GPUScene::Result GPUScene::Query | ( | GeometryHandle | handle | ) | const |
| GPUScene::Result GPUScene::Query | ( | TextureHandle | texture | ) | const |
| void GPUScene::Reset | ( | ) |
| RHITexture * GPUScene::ResolveDynamicTextureGPU | ( | TextureHandle | handle, |
| RHITextureUsage | requiredUsage | ||
| ) | const |
| void GPUScene::ResolveGeometry | ( | GeometryHandle | handle, |
| uint32_t & | outPrimitiveOffset, | ||
| uint32_t & | outPrimitiveType, | ||
| GSInstanceFlags & | outPrimitiveFlags | ||
| ) | const |
| void GPUScene::UpdateDynamicCurveCPU | ( | GeometryHandle | handle, |
| Span< const FCurveDOTSVertex > | vertices = {}, |
||
| Span< const uint32_t > | indices = {}, |
||
| Span< const FCurveLeaf > | leaves = {} |
||
| ) |
Host-mapped copy. Requires isGpu = false with Allocate.
| void GPUScene::UpdateDynamicCurveGPU | ( | GeometryHandle | handle, |
| bool | updateVertices, | ||
| bool | updateIndices, | ||
| bool | updateLeaves | ||
| ) |
Device local writes. Requires isGpu = true with Allocate.
| void GPUScene::UpdateDynamicMeshCPU | ( | GeometryHandle | handle, |
| Span< const FQVertex > | vertices = {}, |
||
| Span< const uint32_t > | indices = {} |
||
| ) |
Host-mapped copy. Requires isGpu = false with Allocate.
| void GPUScene::UpdateDynamicMeshGPU | ( | GeometryHandle | handle, |
| bool | updateVertices, | ||
| bool | updateIndices | ||
| ) |
Device local writes. Requires isGpu = true with Allocate.
| void GPUScene::UpdateDynamicTextureCPU | ( | TextureHandle | handle, |
| FTexture const & | source | ||
| ) |
Host-mapped copy. Requires isGpu = false with Allocate.
| uint32_t GPUScene::UpdateDynamicTextureGPU | ( | TextureHandle | handle, |
| DynamicTextureGPUAccess | access = DynamicTextureGPUAccess::UAV |
||
| ) |
Device local writes. Requires isGpu = true with Allocate.
| void GPUScene::UpdateUBO | ( | RendererUBO & | globals | ) | const |
| GPUScene::Result GPUScene::Upload | ( | FBlobDeserializer * | blobs, |
| FSerializedCurve const & | source, | ||
| GeometryHandle & | outHandle | ||
| ) |
| GPUScene::Result GPUScene::Upload | ( | FBlobDeserializer * | blobs, |
| FSerializedMesh const & | source, | ||
| GeometryHandle & | outHandle | ||
| ) |
| GPUScene::Result GPUScene::Upload | ( | FBlobDeserializer * | blobs, |
| FSerializedTexture const & | source, | ||
| TextureHandle & | outTexture, | ||
| const char * | debugName = nullptr, |
||
| bool | pinned = false |
||
| ) |
| GPUScene::Result GPUScene::Upload | ( | FImportedMesh const & | source, |
| GeometryHandle & | outHandle | ||
| ) |
| GPUScene::Result GPUScene::Upload | ( | FTexture const & | source, |
| TextureHandle & | outTexture, | ||
| const char * | debugName = nullptr, |
||
| bool | pinned = false |
||
| ) |
| GPUScene::Result GPUScene::Upload | ( | RHIBuffer * | dst, |
| Span< const unsigned char > | data, | ||
| uint32_t | dstOffset = 0 |
||
| ) |
| void GPUScene::UploadDynamicGeometryCPU | ( | RHICommandList * | cmd | ) |
Commits host-side geometry and texture updates. GPU-side updates are not required to be committed, as they are already in device-local memory.
| void GPUScene::UploadDynamicTexturesCPU | ( | RHICommandList * | cmd | ) |
| GPUScene::Result GPUScene::UploadEnvironmentMap | ( | FTexture const & | source | ) |
|
friend |
|
private |
|
private |
| float GPUScene::mEnvMapAverageRadiance {1.0f} |
| TextureHandle GPUScene::mEnvMapConditionalCDFIndex |
| TextureHandle GPUScene::mEnvMapIndex |
| TextureHandle GPUScene::mEnvMapMarginalCDFIndex |
| uint32_t GPUScene::mEnvMapPrefilteredMips {0u} |
|
private |
| TextureHandle GPUScene::mFoundationDefaultTexture2DFloatIndex |
| TextureHandle GPUScene::mFoundationDefaultTexture2DIndex |
|
private |
|
private |
|
private |
| TextureHandle GPUScene::mLUTGGXEavgIndex |
| TextureHandle GPUScene::mLUTGGXEIndex |
| TextureHandle GPUScene::mLUTGGXEIORavgIndex |
| TextureHandle GPUScene::mLUTGGXEIORIndex |
| TextureHandle GPUScene::mLUTGGXEIORInvavgIndex |
| TextureHandle GPUScene::mLUTGGXEIORInvIndex |
| TextureHandle GPUScene::mLUTSheenLTCIndex |
|
private |
|
private |
|
private |
|
private |