The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a set of (non-virtual) functions to set state, create resources etc. which rely on API specific implementations provided by protected virtual functions. Redundant state changes are prevented at the platform independent level in the non-virtual functions.
More...
|
plResult | Init () |
|
plResult | Shutdown () |
|
plStringView | GetRenderer () |
|
plGALCommandEncoder * | BeginCommands (const char *szName) |
| Begin recording GPU commands on the returned command encoder.
|
|
void | EndCommands (plGALCommandEncoder *pCommandEncoder) |
| Stop recording commands on the command encoder.
|
|
plGALBlendStateHandle | CreateBlendState (const plGALBlendStateCreationDescription &description) |
|
void | DestroyBlendState (plGALBlendStateHandle hBlendState) |
|
plGALDepthStencilStateHandle | CreateDepthStencilState (const plGALDepthStencilStateCreationDescription &description) |
|
void | DestroyDepthStencilState (plGALDepthStencilStateHandle hDepthStencilState) |
|
plGALRasterizerStateHandle | CreateRasterizerState (const plGALRasterizerStateCreationDescription &description) |
|
void | DestroyRasterizerState (plGALRasterizerStateHandle hRasterizerState) |
|
plGALSamplerStateHandle | CreateSamplerState (const plGALSamplerStateCreationDescription &description) |
|
void | DestroySamplerState (plGALSamplerStateHandle hSamplerState) |
|
plGALShaderHandle | CreateShader (const plGALShaderCreationDescription &description) |
|
void | DestroyShader (plGALShaderHandle hShader) |
|
plGALBufferHandle | CreateBuffer (const plGALBufferCreationDescription &description, plArrayPtr< const plUInt8 > initialData=plArrayPtr< const plUInt8 >()) |
|
void | DestroyBuffer (plGALBufferHandle hBuffer) |
|
plGALBufferHandle | CreateVertexBuffer (plUInt32 uiVertexSize, plUInt32 uiVertexCount, plArrayPtr< const plUInt8 > initialData=plArrayPtr< const plUInt8 >(), bool bDataIsMutable=false) |
|
plGALBufferHandle | CreateIndexBuffer (plGALIndexType::Enum indexType, plUInt32 uiIndexCount, plArrayPtr< const plUInt8 > initialData=plArrayPtr< const plUInt8 >(), bool bDataIsMutable=false) |
|
plGALBufferHandle | CreateConstantBuffer (plUInt32 uiBufferSize) |
|
plGALTextureHandle | CreateTexture (const plGALTextureCreationDescription &description, plArrayPtr< plGALSystemMemoryDescription > initialData=plArrayPtr< plGALSystemMemoryDescription >()) |
|
void | DestroyTexture (plGALTextureHandle hTexture) |
|
plGALTextureHandle | CreateProxyTexture (plGALTextureHandle hParentTexture, plUInt32 uiSlice) |
|
void | DestroyProxyTexture (plGALTextureHandle hProxyTexture) |
|
plGALTextureHandle | CreateSharedTexture (const plGALTextureCreationDescription &description, plArrayPtr< plGALSystemMemoryDescription > initialData={}) |
|
plGALTextureHandle | OpenSharedTexture (const plGALTextureCreationDescription &description, plGALPlatformSharedHandle hSharedHandle) |
|
void | DestroySharedTexture (plGALTextureHandle hTexture) |
|
plGALTextureResourceViewHandle | GetDefaultResourceView (plGALTextureHandle hTexture) |
|
plGALBufferResourceViewHandle | GetDefaultResourceView (plGALBufferHandle hBuffer) |
|
plGALTextureResourceViewHandle | CreateResourceView (const plGALTextureResourceViewCreationDescription &description) |
|
void | DestroyResourceView (plGALTextureResourceViewHandle hResourceView) |
|
plGALBufferResourceViewHandle | CreateResourceView (const plGALBufferResourceViewCreationDescription &description) |
|
void | DestroyResourceView (plGALBufferResourceViewHandle hResourceView) |
|
plGALRenderTargetViewHandle | GetDefaultRenderTargetView (plGALTextureHandle hTexture) |
|
plGALRenderTargetViewHandle | CreateRenderTargetView (const plGALRenderTargetViewCreationDescription &description) |
|
void | DestroyRenderTargetView (plGALRenderTargetViewHandle hRenderTargetView) |
|
plGALTextureUnorderedAccessViewHandle | CreateUnorderedAccessView (const plGALTextureUnorderedAccessViewCreationDescription &description) |
|
void | DestroyUnorderedAccessView (plGALTextureUnorderedAccessViewHandle hUnorderedAccessView) |
|
plGALBufferUnorderedAccessViewHandle | CreateUnorderedAccessView (const plGALBufferUnorderedAccessViewCreationDescription &description) |
|
void | DestroyUnorderedAccessView (plGALBufferUnorderedAccessViewHandle hUnorderedAccessView) |
|
plGALSwapChainHandle | CreateSwapChain (const SwapChainFactoryFunction &func) |
|
plResult | UpdateSwapChain (plGALSwapChainHandle hSwapChain, plEnum< plGALPresentMode > newPresentMode) |
|
void | DestroySwapChain (plGALSwapChainHandle hSwapChain) |
|
plGALVertexDeclarationHandle | CreateVertexDeclaration (const plGALVertexDeclarationCreationDescription &description) |
|
void | DestroyVertexDeclaration (plGALVertexDeclarationHandle hVertexDeclaration) |
|
plEnum< plGALAsyncResult > | GetTimestampResult (plGALTimestampHandle hTimestamp, plTime &out_result) |
| Queries the result of a timestamp. Should be called every frame until plGALAsyncResult::Ready is returned.
|
|
plEnum< plGALAsyncResult > | GetOcclusionQueryResult (plGALOcclusionHandle hOcclusion, plUInt64 &out_uiResult) |
|
plEnum< plGALAsyncResult > | GetFenceResult (plGALFenceHandle hFence, plTime timeout=plTime::MakeZero()) |
|
plGALTextureHandle | GetBackBufferTextureFromSwapChain (plGALSwapChainHandle hSwapChain) |
|
void | EnqueueFrameSwapChain (plGALSwapChainHandle hSwapChain) |
| Adds a swap-chain to be used for the next frame. Must be called before or during the plGALDeviceEvent::BeforeBeginFrame event (BeginFrame function) and repeated for every frame the swap-chain is to be used. This approach guarantees that all swap-chains of a frame acquire and present at the same time, which improves frame pacing.
|
|
void | BeginFrame (const plUInt64 uiAppFrame=0) |
| Begins rendering of a frame. This needs to be called first before any rendering function can be called.
|
|
void | EndFrame () |
| Ends rendering of a frame and submits all data to the GPU. No further rendering calls are allowed until BeginFrame is called again.
|
|
plUInt64 | GetCurrentFrame () const |
| The current rendering frame. This is a monotonically increasing number which changes +1 every time EndFrame is called. You can use this to synchronize read/writes between CPU and GPU, see GetSafeFrame.
|
|
plUInt64 | GetSafeFrame () const |
| The latest frame that has been fully executed on the GPU. Whenever you execute any work that requires synchronization between CPU and GPU, remember the GetCurrentFrame result in which the operation was done. When GetSafeFrame reaches this number, you know for sure that the GPU has completed all operations of that frame.
|
|
const plGALDeviceCreationDescription * | GetDescription () const |
|
const plGALSwapChain * | GetSwapChain (plGALSwapChainHandle hSwapChain) const |
|
template<typename T > |
const T * | GetSwapChain (plGALSwapChainHandle hSwapChain) const |
|
const plGALShader * | GetShader (plGALShaderHandle hShader) const |
|
const plGALTexture * | GetTexture (plGALTextureHandle hTexture) const |
|
virtual const plGALSharedTexture * | GetSharedTexture (plGALTextureHandle hTexture) const =0 |
|
const plGALBuffer * | GetBuffer (plGALBufferHandle hBuffer) const |
|
const plGALDepthStencilState * | GetDepthStencilState (plGALDepthStencilStateHandle hDepthStencilState) const |
|
const plGALBlendState * | GetBlendState (plGALBlendStateHandle hBlendState) const |
|
const plGALRasterizerState * | GetRasterizerState (plGALRasterizerStateHandle hRasterizerState) const |
|
const plGALVertexDeclaration * | GetVertexDeclaration (plGALVertexDeclarationHandle hVertexDeclaration) const |
|
const plGALSamplerState * | GetSamplerState (plGALSamplerStateHandle hSamplerState) const |
|
const plGALTextureResourceView * | GetResourceView (plGALTextureResourceViewHandle hResourceView) const |
|
const plGALBufferResourceView * | GetResourceView (plGALBufferResourceViewHandle hResourceView) const |
|
const plGALRenderTargetView * | GetRenderTargetView (plGALRenderTargetViewHandle hRenderTargetView) const |
|
const plGALTextureUnorderedAccessView * | GetUnorderedAccessView (plGALTextureUnorderedAccessViewHandle hUnorderedAccessView) const |
|
const plGALBufferUnorderedAccessView * | GetUnorderedAccessView (plGALBufferUnorderedAccessViewHandle hUnorderedAccessView) const |
|
const plGALDeviceCapabilities & | GetCapabilities () const |
|
virtual plUInt64 | GetMemoryConsumptionForTexture (const plGALTextureCreationDescription &description) const |
|
virtual plUInt64 | GetMemoryConsumptionForBuffer (const plGALBufferCreationDescription &description) const |
|
void | Flush () |
|
void | WaitIdle () |
| Waits for the GPU to be idle and destroys any pending resources and GPU objects.
|
|
plAllocator * | GetAllocator () |
| Internal: Returns the allocator used by the device.
|
|
template<typename IdTableType , typename ReturnType > |
PL_ALWAYS_INLINE ReturnType * | Get (typename IdTableType::TypeOfId hHandle, const IdTableType &IdTable) const |
|
template<typename HandleType > |
PL_FORCE_INLINE void | AddDeadObject (plUInt32 uiType, HandleType handle) |
|
|
using | ShaderTable = plIdTable<plGALShaderHandle::IdType, plGALShader*, plLocalAllocatorWrapper> |
|
using | BlendStateTable = plIdTable<plGALBlendStateHandle::IdType, plGALBlendState*, plLocalAllocatorWrapper> |
|
using | DepthStencilStateTable = plIdTable<plGALDepthStencilStateHandle::IdType, plGALDepthStencilState*, plLocalAllocatorWrapper> |
|
using | RasterizerStateTable = plIdTable<plGALRasterizerStateHandle::IdType, plGALRasterizerState*, plLocalAllocatorWrapper> |
|
using | BufferTable = plIdTable<plGALBufferHandle::IdType, plGALBuffer*, plLocalAllocatorWrapper> |
|
using | TextureTable = plIdTable<plGALTextureHandle::IdType, plGALTexture*, plLocalAllocatorWrapper> |
|
using | TextureResourceViewTable = plIdTable<plGALTextureResourceViewHandle::IdType, plGALTextureResourceView*, plLocalAllocatorWrapper> |
|
using | BufferResourceViewTable = plIdTable<plGALBufferResourceViewHandle::IdType, plGALBufferResourceView*, plLocalAllocatorWrapper> |
|
using | SamplerStateTable = plIdTable<plGALSamplerStateHandle::IdType, plGALSamplerState*, plLocalAllocatorWrapper> |
|
using | RenderTargetViewTable = plIdTable<plGALRenderTargetViewHandle::IdType, plGALRenderTargetView*, plLocalAllocatorWrapper> |
|
using | TextureUnorderedAccessViewTable = plIdTable<plGALTextureUnorderedAccessViewHandle::IdType, plGALTextureUnorderedAccessView*, plLocalAllocatorWrapper> |
|
using | BufferUnorderedAccessViewTable = plIdTable<plGALBufferUnorderedAccessViewHandle::IdType, plGALBufferUnorderedAccessView*, plLocalAllocatorWrapper> |
|
using | SwapChainTable = plIdTable<plGALSwapChainHandle::IdType, plGALSwapChain*, plLocalAllocatorWrapper> |
|
using | VertexDeclarationTable = plIdTable<plGALVertexDeclarationHandle::IdType, plGALVertexDeclaration*, plLocalAllocatorWrapper> |
|
The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a set of (non-virtual) functions to set state, create resources etc. which rely on API specific implementations provided by protected virtual functions. Redundant state changes are prevented at the platform independent level in the non-virtual functions.