Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/DynamicPrimitiveDrawing.h
Ola Olsson 69d2af54aa Refactored GPU-Scene to store per-view dynamic primitives (for all views) in the one and primitive data buffer, after the regular primitives.
- Added step after dynamic primitives are gathered to allocate a range in GPU scene for the dynamic primitives.
- Moved more GPU-Scene functionality to member functions to clean up references to internal data
- Removed the PrimitiveShaderDataBuffer/Texture from FSceneViewState
- Removed OneFramePrimitiveShaderDataBuffer/Texture from FViewInfo
- Encapsulated the collection of dynamic primitive data for upload to avoid uploading twice and prepare for parallel upload.

#rb Krzysztof.Narkowicz,graham.wihlidal

[CL 14785776 by Ola Olsson in ue5-main branch]
2020-11-19 05:23:44 -04:00

80 lines
2.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
DynamicPrimitiveDrawing.h: Dynamic primitive drawing definitions.
=============================================================================*/
#pragma once
#include "CoreMinimal.h"
#include "SceneManagement.h"
#include "SceneRendering.h"
class FGPUScenePrimitiveCollector;
/** A primitive draw interface which adds the drawn elements to the view's batched elements. */
class FViewElementPDI : public FPrimitiveDrawInterface
{
public:
FViewElementPDI(FViewInfo* InViewInfo,FHitProxyConsumer* InHitProxyConsumer, FGPUScenePrimitiveCollector *InDynamicPrimitiveCollector);
// FPrimitiveDrawInterface interface.
virtual bool IsHitTesting() override;
virtual void SetHitProxy(HHitProxy* HitProxy) override;
virtual void RegisterDynamicResource(FDynamicPrimitiveResource* DynamicResource) override;
virtual void AddReserveLines(uint8 DepthPriorityGroup, int32 NumLines, bool bDepthBiased = false, bool bThickLines = false) override;
virtual void DrawSprite(
const FVector& Position,
float SizeX,
float SizeY,
const FTexture* Sprite,
const FLinearColor& Color,
uint8 DepthPriorityGroup,
float U,
float UL,
float V,
float VL,
uint8 BlendMode = SE_BLEND_Masked,
float OpacityMaskRefVal = .5f
) override;
virtual void DrawLine(
const FVector& Start,
const FVector& End,
const FLinearColor& Color,
uint8 DepthPriorityGroup,
float Thickness = 0.0f,
float DepthBias = 0.0f,
bool bScreenSpace = false
) override;
virtual void DrawTranslucentLine(
const FVector& Start,
const FVector& End,
const FLinearColor& Color,
uint8 DepthPriorityGroup,
float Thickness = 0.0f,
float DepthBias = 0.0f,
bool bScreenSpace = false
) override;
virtual void DrawPoint(
const FVector& Position,
const FLinearColor& Color,
float PointSize,
uint8 DepthPriorityGroup
) override;
virtual int32 DrawMesh(const FMeshBatch& Mesh) override;
private:
FViewInfo* ViewInfo;
TRefCountPtr<HHitProxy> CurrentHitProxy;
FHitProxyConsumer* HitProxyConsumer;
FGPUScenePrimitiveCollector* DynamicPrimitiveCollector;
/** Depending of the DPG we return a different FBatchedElement instance. */
FBatchedElements& GetElements(uint8 DepthPriorityGroup) const;
};
#include "DynamicPrimitiveDrawing.inl"