Plasma Engine
2.0
Loading...
Searching...
No Matches
InstanceDataProvider.h
1
#pragma once
2
3
#include <RendererCore/Declarations.h>
4
#include <RendererCore/Pipeline/FrameDataProvider.h>
5
#include <RendererCore/Shader/ConstantBufferStorage.h>
6
7
struct
plPerInstanceData;
8
class
plInstanceDataProvider
;
9
class
plInstancedMeshComponent
;
10
11
struct
PL_RENDERERCORE_DLL
plInstanceData
12
{
13
PL_DISALLOW_COPY_AND_ASSIGN(
plInstanceData
);
14
15
public
:
16
plInstanceData
(plUInt32 uiMaxInstanceCount = 1024);
17
~plInstanceData
();
18
19
plGALBufferHandle
m_hInstanceDataBuffer;
20
21
plConstantBufferStorageHandle
m_hConstantBuffer;
22
23
void
BindResources(
plRenderContext
* pRenderContext);
24
25
plArrayPtr<plPerInstanceData>
GetInstanceData(plUInt32 uiCount, plUInt32& out_uiOffset);
26
void
UpdateInstanceData(
plRenderContext
* pRenderContext, plUInt32 uiCount);
27
28
private
:
29
friend
plInstanceDataProvider
;
30
friend
plInstancedMeshComponent
;
31
32
void
CreateBuffer(plUInt32 uiSize);
33
void
Reset();
34
35
plUInt32 m_uiBufferSize = 0;
36
plUInt32 m_uiBufferOffset = 0;
37
plDynamicArray<plPerInstanceData, plAlignedAllocatorWrapper>
m_PerInstanceData;
38
};
39
40
class
PL_RENDERERCORE_DLL
plInstanceDataProvider
:
public
plFrameDataProvider
<plInstanceData>
41
{
42
PL_ADD_DYNAMIC_REFLECTION(
plInstanceDataProvider
,
plFrameDataProviderBase
);
43
44
public
:
45
plInstanceDataProvider
();
46
~plInstanceDataProvider
();
47
48
private
:
49
virtual
void
* UpdateData(
const
plRenderViewContext
& renderViewContext,
const
plExtractedRenderData
& extractedData)
override
;
50
51
plInstanceData
m_Data;
52
};
plArrayPtr
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition
ArrayPtr.h:37
plConstantBufferStorageHandle
Definition
ConstantBufferStorage.h:54
plDynamicArray
Definition
DynamicArray.h:81
plExtractedRenderData
Definition
ExtractedRenderData.h:10
plFrameDataProviderBase
Definition
FrameDataProvider.h:6
plFrameDataProvider
Definition
FrameDataProvider.h:26
plGALBufferHandle
Definition
RendererFoundationDLL.h:418
plInstanceDataProvider
Definition
InstanceDataProvider.h:41
plInstancedMeshComponent
Renders multiple instances of the same mesh.
Definition
InstancedMeshComponent.h:86
plRenderContext
Definition
RenderContext.h:30
plInstanceData
Definition
InstanceDataProvider.h:12
plRenderViewContext
Definition
Declarations.h:51
Code
Engine
RendererCore
Pipeline
InstanceDataProvider.h
Generated by
1.11.0