You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#if RHI_RAYTRACING
|
|
|
|
class RENDERER_API FRayTracingDynamicGeometryCollection
|
|
{
|
|
public:
|
|
FRayTracingDynamicGeometryCollection();
|
|
~FRayTracingDynamicGeometryCollection();
|
|
|
|
void AddDynamicMeshBatchForGeometryUpdate(
|
|
const FScene* Scene,
|
|
const FSceneView* View,
|
|
const FPrimitiveSceneProxy* PrimitiveSceneProxy,
|
|
FRayTracingDynamicGeometryUpdateParams Params,
|
|
uint32 PrimitiveId
|
|
);
|
|
|
|
// Starts an update batch and returns the current shared buffer generation ID which is used for validation.
|
|
int64 BeginUpdate();
|
|
void DispatchUpdates(FRHIComputeCommandList& ParentCmdList);
|
|
void EndUpdate(FRHICommandListImmediate& RHICmdList);
|
|
|
|
private:
|
|
TArray<struct FMeshComputeDispatchCommand> DispatchCommands;
|
|
TArray<FRayTracingGeometryBuildParams> BuildParams;
|
|
TArray<FRayTracingGeometrySegment> Segments;
|
|
|
|
struct FVertexPositionBuffer
|
|
{
|
|
FRWBuffer RWBuffer;
|
|
uint32 UsedSize = 0;
|
|
};
|
|
TArray<FVertexPositionBuffer*> VertexPositionBuffers;
|
|
|
|
// Any uniform buffers that must be kept alive until EndUpdate (after DispatchUpdates is called)
|
|
TArray<FUniformBufferRHIRef> ReferencedUniformBuffers;
|
|
|
|
// Generation ID when the shared vertex buffers have been reset. The current generation ID is stored in the FRayTracingGeometry to keep track
|
|
// if the vertex buffer data is still valid for that frame - validated before generation the TLAS
|
|
int64 SharedBufferGenerationID = 0;
|
|
};
|
|
|
|
#endif // RHI_RAYTRACING
|