Foundation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
GPUScene Class Reference

Owns all GPU-resident scene data (geometry, textures, instance/material/light tables, acceleration structures) behind an asynchronous upload work queue. More...

#include <GPUScene.hpp>

Classes

struct  GPUSceneTables
 GPUScene-owned, caller-filled spans for the instance/material/light tables, plus their ring-buffer base offsets. More...
 
struct  MemoryStat
 
struct  UpdateResult
 Ring-buffer offsets and element counts for instances/materials/lights. More...
 

Public Types

enum class  Result {
  Ready , InProgress , InvalidInput , InvalidHandle ,
  OutOfMemory , DecodeFailed , SubmitFailed , Cancelled
}
 Outcome of an Upload / Query / Poll call. More...
 
enum class  LightSamplerType { Uniform , Power }
 
enum class  TLASBuildResult { Built , Empty }
 

Public Member Functions

 GPUScene (RHIDevice *device, Allocator *allocator, GPUSceneDesc const &desc, AllocatorStack *frameScratch=nullptr)
 
 ~GPUScene ()
 
Result Upload (FBlobDeserializer *blobs, FSerializedMesh const &source, GeometryHandle &outHandle)
 Reserves final resident memory for a resource and queues the rest of its upload, returning Result::InProgress when accepted.
 
Result Upload (FBlobDeserializer *blobs, FSerializedCurve const &source, GeometryHandle &outHandle)
 
Result UploadDynamic (FBlobDeserializer *blobs, FSerializedMesh const &source, GeometryHandle &outHandle)
 Uploads a mesh as CPU-updateable dynamic geometry (deformation workloads).
 
Result Upload (FBlobDeserializer *blobs, FSerializedTexture const &source, TextureHandle &outTexture, const char *debugName=nullptr, bool pinned=false)
 Queues a serialized texture upload, binding its bindless slot up front.
 
Result Upload (FTexture const &source, TextureHandle &outTexture, const char *debugName=nullptr, bool pinned=false)
 Uploads a CPU-resident FTexture through the same queue (runs to completion).
 
Result Upload (RHIBuffer *dst, Span< const unsigned char > data, uint32_t dstOffset=0)
 Queues a copy of data into a device-local buffer region (drained by Join/Poll).
 
Result Query (GeometryHandle handle) const
 Residency state of an uploaded geometry handle.
 
Result Query (TextureHandle texture) const
 Residency state of an uploaded texture slot.
 
void Join ()
 Drains all queued uploads on the calling thread, blocking until GPU-resident.
 
Result Poll ()
 Non-blocking drain: kicks a background worker on the first call with queued work, then reports progress while streaming residency in.
 
Result UploadViewLUTs (FTexture const &sdr, FTexture const &hdr)
 Uploads the SDR/HDR display-transform view LUTs (owns its staging).
 
Result UploadEnvMap (FTexture const &source)
 Uploads an environment map and computes its importance-sampling CDFs.
 
void BuildUBO (UBO &globals, bool hdr) const
 Writes every GPUScene-owned global bindless index into the renderer UBO: the GGX/sheen LUTs, the display-transform view LUT (SDR or HDR per hdr), and the environment map + its importance-sampling CDFs (default-substituted when no env map is loaded).
 
GPUSceneTables BeginScene (uint32_t instanceCount, uint32_t materialCount, uint32_t lightCount)
 Begins a scene-table update, returning caller-fill spans.
 
UpdateResult EndScene (GPUSceneTables &tables)
 Commits the filled spans: patches instance geometry fields, snapshots the tables for TLAS/picking/Collect, and computes the light alias table.
 
void DbgGetMemoryStatistics (Vector< MemoryStat > &outStats) const
 
String DbgGetBufferStatistics () const
 
uint32_t GetLightCapacity () const
 
TLASBuildResult BuildTLAS (RHICommandList *cmd, bool update=false)
 Builds (update=false) or refits (update=true) the TLAS from the committed instance table; instances whose geometry isn't yet Result::Ready are skipped.
 
bool HasDynamicGeometry () const
 True when at least one dynamic geometry is resident.
 
void BeginDynamicGeometryUpdate ()
 Opens the per-frame dynamic-geometry update window and advances the ring to the next frame slot. Call exactly once per rendered frame before any UpdateDynamicGeometry.
 
Span< std::byte > UpdateDynamicGeometry (GeometryHandle handle)
 Returns the mapped vertex sub-span (quantized FQVertex bytes) for handle in the current frame slot and marks it dirty for this frame's BLAS refit. Lock-free: each dynamic handle owns a disjoint region. Only valid inside the BeginDynamicGeometryUpdate / EndDynamicGeometryUpdate window.
 
void EndDynamicGeometryUpdate ()
 Closes the per-frame dynamic-geometry update window opened by BeginDynamicGeometryUpdate.
 
void BuildBLAS (RHICommandList *cmd)
 Refits (or periodically rebuilds) every dirty dynamic geometry's BLAS in place against the current frame slot. Record in a render-graph pass that runs before the "TLAS Update" pass, declaring an acceleration-structure write on the BLAS region.
 
void SetDynamicGeometryRebuildRate (uint32_t framesOrZero)
 Frames between forced full BLAS rebuilds for dynamic geo (0 = refit only). Default 64.
 
uint32_t GetDynamicRefitCount () const
 Dynamic geos refitted in the last RefitDynamicGeometry call.
 
uint32_t GetDynamicRebuildCount () const
 Of the last refit, how many were full rebuilds (the rest were in-place updates).
 
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 ResolvePickedInstance (uint32_t pickID) const
 Maps a TLAS pick id (instanceID) to its committed instance index, or UINT32_MAX.
 
GSLight GetLight (uint32_t index) const
 
uint32_t GetLightCount () const
 
GSMaterial GetMaterial (uint32_t index) const
 
uint32_t GetMaterialCount () const
 
RHIBufferGetPrimitiveBuffer () const
 
RHIBufferGetDynamicPrimitiveBuffer () const
 The host-coherent dynamic (CPU-updateable) primitive ring, bound as a second primitive storage buffer; instances with kGSInstanceFlagDynamic read from it.
 
RHIBufferGetInstanceBuffer () const
 
RHIBufferGetMaterialBuffer () const
 
RHIBufferGetLightBuffer () const
 
RHIBufferGetLightAliasTableBuffer () const
 
BindlessPoolGetTexture2DPool ()
 
BindlessPoolGetTexture3DPool ()
 
uint32_t GetGGXLutEIndex () const
 
uint32_t GetGGXLutEavgIndex () const
 
uint32_t GetGGXLutEIORIndex () const
 
uint32_t GetGGXLutEIORavgIndex () const
 
uint32_t GetGGXLutEIORInvIndex () const
 
uint32_t GetGGXLutEIORInvavgIndex () const
 
uint32_t GetSheenLtcIndex () const
 
uint32_t GetViewLutSdrIndex () const
 
uint32_t GetViewLutHdrIndex () const
 
RHITextureGetFoundationDefaultTexture2D () const
 
RHITextureGetFoundationDefaultTexture2DFloat () const
 
RHIBufferGetFoundationDefaultBufferFloat () const
 
bool HasEnvMap () const
 
uint32_t GetEnvMapIndexOrDefault () const
 
uint32_t GetEnvMapMarginalCDFIndexOrDefault () const
 
uint32_t GetEnvMapConditionalCDFIndexOrDefault () const
 
RHIAccelerationStructureGetTLAS () const
 
RHIBufferGetSobolMatricesBuffer () const
 
void Reset ()
 

Static Public Member Functions

static size_t CalculateMeshPrimitiveSize (FSerializedMesh const &src)
 
static size_t CalculateCurvePrimitiveSize (FSerializedCurve const &src)
 
static size_t CalculateCurveAABBSize (FSerializedCurve const &src)
 

Public Attributes

LightSamplerType mLightSamplerType = LightSamplerType::Power
 

Private Attributes

Vector< GSInstancemCommittedInstances
 
Vector< GSLightmCommittedLights
 
Vector< GSMaterialmCommittedMaterials
 
Vector< uint32_tmPickMap
 
RHIDeviceScopedHandle< RHIBuffermPrimitiveBuffer
 
RHIDeviceScopedHandle< RHIAccelerationStructuremTLAS
 
uint32_t mLastTLASInstancesCount {0}
 
RHIDeviceScopedHandle< RHIBuffermSobolMatricesBuffer
 
RHIDeviceScopedHandle< RHIBuffermFoundationDefaultBufferFloat
 
TextureHandle mLUTGGXEIndex
 
TextureHandle mLUTGGXEavgIndex
 
TextureHandle mLUTGGXEIORavgIndex
 
TextureHandle mLUTGGXEIORInvavgIndex
 
TextureHandle mLUTGGXEIORIndex
 
TextureHandle mLUTGGXEIORInvIndex
 
TextureHandle mLUTSheenLTCIndex
 
TextureHandle mLUTViewSdrIndex
 
TextureHandle mLUTViewHdrIndex
 
TextureHandle mFoundationDefaultTexture2DIndex
 
TextureHandle mFoundationDefaultTexture2DFloatIndex
 
TextureHandle mEnvMapIndex
 
TextureHandle mEnvMapMarginalCDFIndex
 
TextureHandle mEnvMapConditionalCDFIndex
 
UniquePtr< GPUSceneImplmImpl
 

Friends

struct GPUSceneImpl
 

Detailed Description

Owns all GPU-resident scene data (geometry, textures, instance/material/light tables, acceleration structures) behind an asynchronous upload work queue.

Typical render-build flow (after proper Renderer setup seen in Rasterizer.cpp/Pathtracer.cpp):

  1. Upload(blobs, mesh/curve/texture, outHandle) per resource — reserves memory immediately, returns Result::InProgress. UploadEnvMap / UploadViewLUTs for environment + display LUTs.
  2. Poll() each frame (background drain) or Join() (blocking) until ready.
  3. BeginScene → fill the mapped instance/material/light spans → EndScene, then write the returned UpdateResult offsets into the renderer UBO.
  4. BuildUBO(ubo*) to update the UBO with the latest scene data.
  5. [opt. ray-tracing only] BuildTLAS(cmd) Geometry is reclaimed explicitly via Collect after destructive edits.
Note
Uploads run on a persistent background worker fed by a lock-free multi-producer queue: Upload may be called from any thread at any time (including while a drain is in flight), and the owning GPUScene MAY be rendered concurrently while Poll reports InProgress — geometry/textures stream into the live scene as they become Result::Ready. Per-resource readiness is observable via Query.
The upload / residency / acceleration-structure machinery lives in GPUSceneImpl, reached through mImpl. Only the committed-snapshot tables and the LUT / env / primitive / TLAS handles backing the hot inline read getters remain direct members here.

Member Enumeration Documentation

◆ LightSamplerType

Enumerator
Uniform 
Power 

◆ Result

Outcome of an Upload / Query / Poll call.

Note
Ready is the GPU-usable boundary, not merely "bytes copied": for geometry it means primitive/curve bytes are visible, the BLAS is built and residency is patched; for textures it means all subresources are uploaded, layouts are transitioned, and the bindless slot is shader-readable.
Enumerator
Ready 
InProgress 
InvalidInput 
InvalidHandle 
OutOfMemory 
DecodeFailed 
SubmitFailed 
Cancelled 

◆ TLASBuildResult

Enumerator
Built 
Empty 

Constructor & Destructor Documentation

◆ GPUScene()

GPUScene::GPUScene ( RHIDevice device,
Allocator allocator,
GPUSceneDesc const desc,
AllocatorStack frameScratch = nullptr 
)

◆ ~GPUScene()

GPUScene::~GPUScene ( )
default

Member Function Documentation

◆ BeginDynamicGeometryUpdate()

void GPUScene::BeginDynamicGeometryUpdate ( )

Opens the per-frame dynamic-geometry update window and advances the ring to the next frame slot. Call exactly once per rendered frame before any UpdateDynamicGeometry.

The slot the CPU writes (current) is distinct from the slot the GPU traced last frame, mirroring the table rings' frames-in-flight invariant. Must be paired with EndDynamicGeometryUpdate.

◆ BeginScene()

GPUScene::GPUSceneTables GPUScene::BeginScene ( uint32_t  instanceCount,
uint32_t  materialCount,
uint32_t  lightCount 
)

Begins a scene-table update, returning caller-fill spans.

Fill instances with InstanceDesc (geometry handle + transform + material); EndScene resolves the GPU-owned geometry offset/type. The materials/lights spans are mapped GPU memory filled in place. Must be paired with EndScene.

◆ BuildBLAS()

void GPUScene::BuildBLAS ( RHICommandList cmd)

Refits (or periodically rebuilds) every dirty dynamic geometry's BLAS in place against the current frame slot. Record in a render-graph pass that runs before the "TLAS Update" pass, declaring an acceleration-structure write on the BLAS region.

◆ BuildTLAS()

GPUScene::TLASBuildResult GPUScene::BuildTLAS ( RHICommandList cmd,
bool  update = false 
)

Builds (update=false) or refits (update=true) the TLAS from the committed instance table; instances whose geometry isn't yet Result::Ready are skipped.

Note
The TLAS lives in buffers pre-allocated to GPUSceneDesc::tlasBudget and is never reallocated: the AS device object stays stable, so the render graph's captured handle never goes stale and no renderer rebuild is needed. A committed instance set whose TLAS would exceed the budget is a hard error (raise tlasBudget).

◆ BuildUBO()

void GPUScene::BuildUBO ( UBO globals,
bool  hdr 
) const

Writes every GPUScene-owned global bindless index into the renderer UBO: the GGX/sheen LUTs, the display-transform view LUT (SDR or HDR per hdr), and the environment map + its importance-sampling CDFs (default-substituted when no env map is loaded).

Parameters
hdrSelects the HDR view LUT when true, the SDR one otherwise.
Note
Leaves instance/material/light table offsets untouched (those come from EndScene's UpdateResult).

◆ CalculateCurveAABBSize()

size_t GPUScene::CalculateCurveAABBSize ( FSerializedCurve const src)
static

◆ CalculateCurvePrimitiveSize()

size_t GPUScene::CalculateCurvePrimitiveSize ( FSerializedCurve const src)
static

◆ CalculateMeshPrimitiveSize()

size_t GPUScene::CalculateMeshPrimitiveSize ( FSerializedMesh const src)
static

◆ Collect()

void GPUScene::Collect ( )

Garbage-collects geometry and textures no longer referenced by the committed scene tables.

Note
Marks geometry referenced by the committed instance table and (non-pinned) textures referenced by the committed material table, then frees the rest (geometry + their BLAS; texture bindless slots, bumping their generation so stale TextureHandle values fail Query). Pinned textures (LUTs / defaults / env map) and in-flight uploads are kept. The caller must ensure the GPU is no longer using the reclaimed resources (e.g. WaitIdle after a destructive edit).

◆ DbgGetBufferStatistics()

String GPUScene::DbgGetBufferStatistics ( ) const

◆ DbgGetMemoryStatistics()

void GPUScene::DbgGetMemoryStatistics ( Vector< MemoryStat > &  outStats) const

◆ EndDynamicGeometryUpdate()

void GPUScene::EndDynamicGeometryUpdate ( )

Closes the per-frame dynamic-geometry update window opened by BeginDynamicGeometryUpdate.

◆ EndScene()

GPUScene::UpdateResult GPUScene::EndScene ( GPUSceneTables tables)

Commits the filled spans: patches instance geometry fields, snapshots the tables for TLAS/picking/Collect, and computes the light alias table.

Returns
Ring-buffer offsets/counts to populate the UBO with.

◆ GetDynamicPrimitiveBuffer()

RHIBuffer * GPUScene::GetDynamicPrimitiveBuffer ( ) const

The host-coherent dynamic (CPU-updateable) primitive ring, bound as a second primitive storage buffer; instances with kGSInstanceFlagDynamic read from it.

Returns
The dynamic ring, or the immutable primitive buffer as a fallback when the feature is disabled (so the binding is always valid; no dynamic instance ever selects it).

◆ GetDynamicRebuildCount()

uint32_t GPUScene::GetDynamicRebuildCount ( ) const

Of the last refit, how many were full rebuilds (the rest were in-place updates).

◆ GetDynamicRefitCount()

uint32_t GPUScene::GetDynamicRefitCount ( ) const

Dynamic geos refitted in the last RefitDynamicGeometry call.

◆ GetEnvMapConditionalCDFIndexOrDefault()

uint32_t GPUScene::GetEnvMapConditionalCDFIndexOrDefault ( ) const
inline

◆ GetEnvMapIndexOrDefault()

uint32_t GPUScene::GetEnvMapIndexOrDefault ( ) const
inline

◆ GetEnvMapMarginalCDFIndexOrDefault()

uint32_t GPUScene::GetEnvMapMarginalCDFIndexOrDefault ( ) const
inline

◆ GetFoundationDefaultBufferFloat()

RHIBuffer * GPUScene::GetFoundationDefaultBufferFloat ( ) const
inline

◆ GetFoundationDefaultTexture2D()

RHITexture * GPUScene::GetFoundationDefaultTexture2D ( ) const

◆ GetFoundationDefaultTexture2DFloat()

RHITexture * GPUScene::GetFoundationDefaultTexture2DFloat ( ) const

◆ GetGGXLutEavgIndex()

uint32_t GPUScene::GetGGXLutEavgIndex ( ) const
inline

◆ GetGGXLutEIndex()

uint32_t GPUScene::GetGGXLutEIndex ( ) const
inline

◆ GetGGXLutEIORavgIndex()

uint32_t GPUScene::GetGGXLutEIORavgIndex ( ) const
inline

◆ GetGGXLutEIORIndex()

uint32_t GPUScene::GetGGXLutEIORIndex ( ) const
inline

◆ GetGGXLutEIORInvavgIndex()

uint32_t GPUScene::GetGGXLutEIORInvavgIndex ( ) const
inline

◆ GetGGXLutEIORInvIndex()

uint32_t GPUScene::GetGGXLutEIORInvIndex ( ) const
inline

◆ GetInstance()

GSInstance GPUScene::GetInstance ( uint32_t  index) const
inline

◆ GetInstanceBuffer()

RHIBuffer * GPUScene::GetInstanceBuffer ( ) const

◆ GetInstanceCount()

uint32_t GPUScene::GetInstanceCount ( ) const
inline

◆ GetLight()

GSLight GPUScene::GetLight ( uint32_t  index) const
inline

◆ GetLightAliasTableBuffer()

RHIBuffer * GPUScene::GetLightAliasTableBuffer ( ) const

◆ GetLightBuffer()

RHIBuffer * GPUScene::GetLightBuffer ( ) const

◆ GetLightCapacity()

uint32_t GPUScene::GetLightCapacity ( ) const

◆ GetLightCount()

uint32_t GPUScene::GetLightCount ( ) const
inline

◆ GetMaterial()

GSMaterial GPUScene::GetMaterial ( uint32_t  index) const
inline

◆ GetMaterialBuffer()

RHIBuffer * GPUScene::GetMaterialBuffer ( ) const

◆ GetMaterialCount()

uint32_t GPUScene::GetMaterialCount ( ) const
inline

◆ GetPrimitiveBuffer()

RHIBuffer * GPUScene::GetPrimitiveBuffer ( ) const
inline

◆ GetSheenLtcIndex()

uint32_t GPUScene::GetSheenLtcIndex ( ) const
inline

◆ GetSobolMatricesBuffer()

RHIBuffer * GPUScene::GetSobolMatricesBuffer ( ) const
inline

◆ GetTexture2DPool()

BindlessPool * GPUScene::GetTexture2DPool ( )

◆ GetTexture3DPool()

BindlessPool * GPUScene::GetTexture3DPool ( )

◆ GetTLAS()

RHIAccelerationStructure * GPUScene::GetTLAS ( ) const
inline

◆ GetViewLutHdrIndex()

uint32_t GPUScene::GetViewLutHdrIndex ( ) const
inline

◆ GetViewLutSdrIndex()

uint32_t GPUScene::GetViewLutSdrIndex ( ) const
inline

◆ HasDynamicGeometry()

bool GPUScene::HasDynamicGeometry ( ) const

True when at least one dynamic geometry is resident.

◆ HasEnvMap()

bool GPUScene::HasEnvMap ( ) const
inline

◆ Join()

void GPUScene::Join ( )

Drains all queued uploads on the calling thread, blocking until GPU-resident.

Note
Joins an in-flight background drain (Poll) first.

◆ Poll()

GPUScene::Result GPUScene::Poll ( )

Non-blocking drain: kicks a background worker on the first call with queued work, then reports progress while streaming residency in.

The worker uploads geometry/textures and publishes residency incrementally; the owning GPUScene MAY be rendered concurrently while this returns InProgress. Instances stream into the TLAS as their geometry becomes Result::Ready, and Query reports per-texture residency so materials can fall back to defaults.

Returns
Result::InProgress while draining, Result::Ready when complete (or when nothing is queued), or an error Result on failure.

◆ Query() [1/2]

GPUScene::Result GPUScene::Query ( GeometryHandle  handle) const

Residency state of an uploaded geometry handle.

Returns
Ready / InProgress / error.

◆ Query() [2/2]

GPUScene::Result GPUScene::Query ( TextureHandle  texture) const

Residency state of an uploaded texture slot.

Returns
Ready / InProgress / error.

◆ Reset()

void GPUScene::Reset ( )

◆ ResolvePickedInstance()

uint32_t GPUScene::ResolvePickedInstance ( uint32_t  pickID) const
inline

Maps a TLAS pick id (instanceID) to its committed instance index, or UINT32_MAX.

◆ SetDynamicGeometryRebuildRate()

void GPUScene::SetDynamicGeometryRebuildRate ( uint32_t  framesOrZero)

Frames between forced full BLAS rebuilds for dynamic geo (0 = refit only). Default 64.

◆ UpdateDynamicGeometry()

Span< std::byte > GPUScene::UpdateDynamicGeometry ( GeometryHandle  handle)

Returns the mapped vertex sub-span (quantized FQVertex bytes) for handle in the current frame slot and marks it dirty for this frame's BLAS refit. Lock-free: each dynamic handle owns a disjoint region. Only valid inside the BeginDynamicGeometryUpdate / EndDynamicGeometryUpdate window.

◆ Upload() [1/5]

GPUScene::Result GPUScene::Upload ( FBlobDeserializer blobs,
FSerializedCurve const source,
GeometryHandle outHandle 
)

◆ Upload() [2/5]

GPUScene::Result GPUScene::Upload ( FBlobDeserializer blobs,
FSerializedMesh const source,
GeometryHandle outHandle 
)

Reserves final resident memory for a resource and queues the rest of its upload, returning Result::InProgress when accepted.

The returned handle / texture slot is valid immediately and usable as a Query key while the work is pending. Hard failures that cannot succeed later (invalid input, final-residency OOM) are returned up front. Drain the queue with Join (blocking) or Poll (background); the resource is GPU-usable only once Query reports Result::Ready.

Parameters
blobsDeserializer for the source's payloads; must outlive the drain.
sourceSerialized mesh/curve/texture to upload.
outHandle[out] Geometry handle, allocated before completion.
Returns
Result::InProgress on success, else a hard error.

◆ Upload() [3/5]

GPUScene::Result GPUScene::Upload ( FBlobDeserializer blobs,
FSerializedTexture const source,
TextureHandle outTexture,
const char debugName = nullptr,
bool  pinned = false 
)

Queues a serialized texture upload, binding its bindless slot up front.

Parameters
outTexture[in,out] Pass a default (invalid) handle to allocate a new slot, or an existing handle to update it in place (env map / view LUT reload).
pinnedWhen true the slot is a GPUScene-owned singleton that Collect must never reclaim (LUTs / defaults / env map); scene textures pass false.

◆ Upload() [4/5]

GPUScene::Result GPUScene::Upload ( FTexture const source,
TextureHandle outTexture,
const char debugName = nullptr,
bool  pinned = false 
)

Uploads a CPU-resident FTexture through the same queue (runs to completion).

◆ Upload() [5/5]

GPUScene::Result GPUScene::Upload ( RHIBuffer dst,
Span< const unsigned char data,
uint32_t  dstOffset = 0 
)

Queues a copy of data into a device-local buffer region (drained by Join/Poll).

◆ UploadDynamic()

GPUScene::Result GPUScene::UploadDynamic ( FBlobDeserializer blobs,
FSerializedMesh const source,
GeometryHandle outHandle 
)

Uploads a mesh as CPU-updateable dynamic geometry (deformation workloads).

Topology (indices) is fixed; only vertex positions change per frame. The source's quantized verts + LOD0 indices are reserved in the host-coherent dynamic ring (replicated across every frame slot) and a single RHIAccelerationStructureBuildFlagsBits::AllowUpdate BLAS is built once. Per frame the caller rewrites the current slot's verts via BeginGeometryUpdate / EndGeometryUpdate and the graph's "Dynamic BLAS Refit" pass (RefitDynamicGeometry) refits the BLAS in place. DAG/meshlet payloads are ignored (dynamic geo is drawn with a plain vertex/index path, not the meshlet pipeline). Requires GPUSceneDesc::dynamicGeometryBudget > 0.

Note
The source's rest-pose verts seed every slot; the handle is Result::Ready once its bytes are resident and the BLAS is built (synchronous, not via the upload worker).

◆ UploadEnvMap()

GPUScene::Result GPUScene::UploadEnvMap ( FTexture const source)

Uploads an environment map and computes its importance-sampling CDFs.

Returns
Result::Ready on success.

◆ UploadViewLUTs()

GPUScene::Result GPUScene::UploadViewLUTs ( FTexture const sdr,
FTexture const hdr 
)

Uploads the SDR/HDR display-transform view LUTs (owns its staging).

Returns
Result::Ready on success.

Friends And Related Symbol Documentation

◆ GPUSceneImpl

Member Data Documentation

◆ mCommittedInstances

Vector<GSInstance> GPUScene::mCommittedInstances
private

◆ mCommittedLights

Vector<GSLight> GPUScene::mCommittedLights
private

◆ mCommittedMaterials

Vector<GSMaterial> GPUScene::mCommittedMaterials
private

◆ mEnvMapConditionalCDFIndex

TextureHandle GPUScene::mEnvMapConditionalCDFIndex
private

◆ mEnvMapIndex

TextureHandle GPUScene::mEnvMapIndex
private

◆ mEnvMapMarginalCDFIndex

TextureHandle GPUScene::mEnvMapMarginalCDFIndex
private

◆ mFoundationDefaultBufferFloat

RHIDeviceScopedHandle<RHIBuffer> GPUScene::mFoundationDefaultBufferFloat
private

◆ mFoundationDefaultTexture2DFloatIndex

TextureHandle GPUScene::mFoundationDefaultTexture2DFloatIndex
private

◆ mFoundationDefaultTexture2DIndex

TextureHandle GPUScene::mFoundationDefaultTexture2DIndex
private

◆ mImpl

UniquePtr<GPUSceneImpl> GPUScene::mImpl
private

◆ mLastTLASInstancesCount

uint32_t GPUScene::mLastTLASInstancesCount {0}
private

◆ mLightSamplerType

LightSamplerType GPUScene::mLightSamplerType = LightSamplerType::Power

◆ mLUTGGXEavgIndex

TextureHandle GPUScene::mLUTGGXEavgIndex
private

◆ mLUTGGXEIndex

TextureHandle GPUScene::mLUTGGXEIndex
private

◆ mLUTGGXEIORavgIndex

TextureHandle GPUScene::mLUTGGXEIORavgIndex
private

◆ mLUTGGXEIORIndex

TextureHandle GPUScene::mLUTGGXEIORIndex
private

◆ mLUTGGXEIORInvavgIndex

TextureHandle GPUScene::mLUTGGXEIORInvavgIndex
private

◆ mLUTGGXEIORInvIndex

TextureHandle GPUScene::mLUTGGXEIORInvIndex
private

◆ mLUTSheenLTCIndex

TextureHandle GPUScene::mLUTSheenLTCIndex
private

◆ mLUTViewHdrIndex

TextureHandle GPUScene::mLUTViewHdrIndex
private

◆ mLUTViewSdrIndex

TextureHandle GPUScene::mLUTViewSdrIndex
private

◆ mPickMap

Vector<uint32_t> GPUScene::mPickMap
private

◆ mPrimitiveBuffer

RHIDeviceScopedHandle<RHIBuffer> GPUScene::mPrimitiveBuffer
private

◆ mSobolMatricesBuffer

RHIDeviceScopedHandle<RHIBuffer> GPUScene::mSobolMatricesBuffer
private

◆ mTLAS


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