Plasma Engine  2.0
Loading...
Searching...
No Matches
CommandEncoderPlatformInterface.h
1
2#pragma once
3
4#include <Foundation/Math/Color.h>
5#include <Foundation/Math/Rect.h>
6#include <RendererFoundation/Descriptors/Enumerations.h>
7#include <RendererFoundation/RendererFoundationDLL.h>
8
11
12class PL_RENDERERFOUNDATION_DLL plGALCommandEncoderCommonPlatformInterface
13{
14public:
15 // State setting functions
16
17 virtual void SetShaderPlatform(const plGALShader* pShader) = 0;
18
19 virtual void SetConstantBufferPlatform(const plShaderResourceBinding& binding, const plGALBuffer* pBuffer) = 0;
20 virtual void SetSamplerStatePlatform(const plShaderResourceBinding& binding, const plGALSamplerState* pSamplerState) = 0;
21 virtual void SetResourceViewPlatform(const plShaderResourceBinding& binding, const plGALTextureResourceView* pResourceView) = 0;
22 virtual void SetResourceViewPlatform(const plShaderResourceBinding& binding, const plGALBufferResourceView* pResourceView) = 0;
23 virtual void SetUnorderedAccessViewPlatform(const plShaderResourceBinding& binding, const plGALTextureUnorderedAccessView* pUnorderedAccessView) = 0;
24 virtual void SetUnorderedAccessViewPlatform(const plShaderResourceBinding& binding, const plGALBufferUnorderedAccessView* pUnorderedAccessView) = 0;
25 virtual void SetPushConstantsPlatform(plArrayPtr<const plUInt8> data) = 0;
26
27 // GPU -> CPU query functions
28
29 virtual plGALTimestampHandle InsertTimestampPlatform() = 0;
30 virtual plGALOcclusionHandle BeginOcclusionQueryPlatform(plEnum<plGALQueryType> type) = 0;
31 virtual void EndOcclusionQueryPlatform(plGALOcclusionHandle hOcclusion) = 0;
32 virtual plGALFenceHandle InsertFencePlatform() = 0;
33
34 // Resource update functions
35
36 virtual void ClearUnorderedAccessViewPlatform(const plGALTextureUnorderedAccessView* pUnorderedAccessView, plVec4 vClearValues) = 0;
37 virtual void ClearUnorderedAccessViewPlatform(const plGALTextureUnorderedAccessView* pUnorderedAccessView, plVec4U32 vClearValues) = 0;
38
39 virtual void ClearUnorderedAccessViewPlatform(const plGALBufferUnorderedAccessView* pUnorderedAccessView, plVec4 vClearValues) = 0;
40 virtual void ClearUnorderedAccessViewPlatform(const plGALBufferUnorderedAccessView* pUnorderedAccessView, plVec4U32 vClearValues) = 0;
41
42 virtual void CopyBufferPlatform(const plGALBuffer* pDestination, const plGALBuffer* pSource) = 0;
43 virtual void CopyBufferRegionPlatform(const plGALBuffer* pDestination, plUInt32 uiDestOffset, const plGALBuffer* pSource, plUInt32 uiSourceOffset, plUInt32 uiByteCount) = 0;
44
45 virtual void UpdateBufferPlatform(const plGALBuffer* pDestination, plUInt32 uiDestOffset, plArrayPtr<const plUInt8> sourceData, plGALUpdateMode::Enum updateMode) = 0;
46
47 virtual void CopyTexturePlatform(const plGALTexture* pDestination, const plGALTexture* pSource) = 0;
48 virtual void CopyTextureRegionPlatform(const plGALTexture* pDestination, const plGALTextureSubresource& destinationSubResource, const plVec3U32& vDestinationPoint, const plGALTexture* pSource, const plGALTextureSubresource& sourceSubResource, const plBoundingBoxu32& box) = 0;
49
50 virtual void UpdateTexturePlatform(const plGALTexture* pDestination, const plGALTextureSubresource& destinationSubResource, const plBoundingBoxu32& destinationBox, const plGALSystemMemoryDescription& sourceData) = 0;
51
52 virtual void ResolveTexturePlatform(const plGALTexture* pDestination, const plGALTextureSubresource& destinationSubResource, const plGALTexture* pSource, const plGALTextureSubresource& sourceSubResource) = 0;
53
54 virtual void ReadbackTexturePlatform(const plGALTexture* pTexture) = 0;
55
56 virtual void CopyTextureReadbackResultPlatform(const plGALTexture* pTexture, plArrayPtr<plGALTextureSubresource> sourceSubResource, plArrayPtr<plGALSystemMemoryDescription> targetData) = 0;
57
58 virtual void GenerateMipMapsPlatform(const plGALTextureResourceView* pResourceView) = 0;
59
60 // Misc
61
62 virtual void FlushPlatform() = 0;
63
64 // Debug helper functions
65
66 virtual void PushMarkerPlatform(const char* szMarker) = 0;
67 virtual void PopMarkerPlatform() = 0;
68 virtual void InsertEventMarkerPlatform(const char* szMarker) = 0;
69
70 // Compute Dispatch
71
72 virtual void BeginComputePlatform() = 0;
73 virtual void EndComputePlatform() = 0;
74
75 virtual plResult DispatchPlatform(plUInt32 uiThreadGroupCountX, plUInt32 uiThreadGroupCountY, plUInt32 uiThreadGroupCountZ) = 0;
76 virtual plResult DispatchIndirectPlatform(const plGALBuffer* pIndirectArgumentBuffer, plUInt32 uiArgumentOffsetInBytes) = 0;
77
78 // Draw functions
79
80 virtual void BeginRenderingPlatform(const plGALRenderingSetup& renderingSetup) = 0;
81 virtual void EndRenderingPlatform() = 0;
82
83 virtual void ClearPlatform(const plColor& clearColor, plUInt32 uiRenderTargetClearMask, bool bClearDepth, bool bClearStencil, float fDepthClear, plUInt8 uiStencilClear) = 0;
84
85 virtual plResult DrawPlatform(plUInt32 uiVertexCount, plUInt32 uiStartVertex) = 0;
86 virtual plResult DrawIndexedPlatform(plUInt32 uiIndexCount, plUInt32 uiStartIndex) = 0;
87 virtual plResult DrawIndexedInstancedPlatform(plUInt32 uiIndexCountPerInstance, plUInt32 uiInstanceCount, plUInt32 uiStartIndex) = 0;
88 virtual plResult DrawIndexedInstancedIndirectPlatform(const plGALBuffer* pIndirectArgumentBuffer, plUInt32 uiArgumentOffsetInBytes) = 0;
89 virtual plResult DrawInstancedPlatform(plUInt32 uiVertexCountPerInstance, plUInt32 uiInstanceCount, plUInt32 uiStartVertex) = 0;
90 virtual plResult DrawInstancedIndirectPlatform(const plGALBuffer* pIndirectArgumentBuffer, plUInt32 uiArgumentOffsetInBytes) = 0;
91
92 // State functions
93
94 virtual void SetIndexBufferPlatform(const plGALBuffer* pIndexBuffer) = 0;
95 virtual void SetVertexBufferPlatform(plUInt32 uiSlot, const plGALBuffer* pVertexBuffer) = 0;
96 virtual void SetVertexDeclarationPlatform(const plGALVertexDeclaration* pVertexDeclaration) = 0;
97 virtual void SetPrimitiveTopologyPlatform(plGALPrimitiveTopology::Enum topology) = 0;
98
99 virtual void SetBlendStatePlatform(const plGALBlendState* pBlendState, const plColor& blendFactor, plUInt32 uiSampleMask) = 0;
100 virtual void SetDepthStencilStatePlatform(const plGALDepthStencilState* pDepthStencilState, plUInt8 uiStencilRefValue) = 0;
101 virtual void SetRasterizerStatePlatform(const plGALRasterizerState* pRasterizerState) = 0;
102
103 virtual void SetViewportPlatform(const plRectFloat& rect, float fMinDepth, float fMaxDepth) = 0;
104 virtual void SetScissorRectPlatform(const plRectU32& rect) = 0;
105
106};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
An axis-aligned bounding box implementation.
Definition BoundingBox.h:12
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
Definition State.h:7
Definition Buffer.h:8
Definition ResourceView.h:30
Definition UnorderedAccesView.h:28
Definition CommandEncoderPlatformInterface.h:13
Definition State.h:20
Definition State.h:33
Definition State.h:46
Definition Shader.h:7
Definition Texture.h:8
Definition ResourceView.h:11
Definition UnorderedAccesView.h:11
Definition VertexDeclaration.h:8
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition RenderTargetSetup.h:44
Definition RendererFoundationDLL.h:365
Definition RendererFoundationDLL.h:359
Enum
Definition RendererFoundationDLL.h:336
A generic id class that holds an id combined of an instance index and a generation counter.
Definition Id.h:52
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Shader reflection of a single shader resource (texture, constant buffer, etc.).
Definition ShaderByteCode.h:77