The ezRenderDevice 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...
|
ezResult | Init () |
|
ezResult | Shutdown () |
|
ezStringView | GetRenderer () |
|
ezGALCommandEncoder * | BeginCommands (const char *szName) |
| Begin recording GPU commands on the returned command encoder.
|
|
void | EndCommands (ezGALCommandEncoder *pCommandEncoder) |
| Stop recording commands on the command encoder. More...
|
|
ezGALBlendStateHandle | CreateBlendState (const ezGALBlendStateCreationDescription &description) |
|
void | DestroyBlendState (ezGALBlendStateHandle hBlendState) |
|
ezGALDepthStencilStateHandle | CreateDepthStencilState (const ezGALDepthStencilStateCreationDescription &description) |
|
void | DestroyDepthStencilState (ezGALDepthStencilStateHandle hDepthStencilState) |
|
ezGALRasterizerStateHandle | CreateRasterizerState (const ezGALRasterizerStateCreationDescription &description) |
|
void | DestroyRasterizerState (ezGALRasterizerStateHandle hRasterizerState) |
|
ezGALSamplerStateHandle | CreateSamplerState (const ezGALSamplerStateCreationDescription &description) |
|
void | DestroySamplerState (ezGALSamplerStateHandle hSamplerState) |
|
ezGALShaderHandle | CreateShader (const ezGALShaderCreationDescription &description) |
|
void | DestroyShader (ezGALShaderHandle hShader) |
|
ezGALBufferHandle | CreateBuffer (const ezGALBufferCreationDescription &description, ezArrayPtr< const ezUInt8 > initialData=ezArrayPtr< const ezUInt8 >()) |
|
void | DestroyBuffer (ezGALBufferHandle hBuffer) |
|
ezGALDynamicBufferHandle | CreateDynamicBuffer (const ezGALBufferCreationDescription &description, ezStringView sDebugName) |
|
void | DestroyDynamicBuffer (ezGALDynamicBufferHandle &inout_hBuffer) |
|
ezGALBufferHandle | CreateVertexBuffer (ezUInt32 uiVertexSize, ezUInt32 uiVertexCount, ezArrayPtr< const ezUInt8 > initialData=ezArrayPtr< const ezUInt8 >(), bool bDataIsMutable=false) |
|
ezGALBufferHandle | CreateIndexBuffer (ezGALIndexType::Enum indexType, ezUInt32 uiIndexCount, ezArrayPtr< const ezUInt8 > initialData=ezArrayPtr< const ezUInt8 >(), bool bDataIsMutable=false) |
|
ezGALBufferHandle | CreateConstantBuffer (ezUInt32 uiBufferSize) |
|
ezGALTextureHandle | CreateTexture (const ezGALTextureCreationDescription &description, ezArrayPtr< ezGALSystemMemoryDescription > initialData=ezArrayPtr< ezGALSystemMemoryDescription >()) |
|
void | DestroyTexture (ezGALTextureHandle hTexture) |
|
ezGALTextureHandle | CreateProxyTexture (ezGALTextureHandle hParentTexture, ezUInt32 uiSlice) |
|
void | DestroyProxyTexture (ezGALTextureHandle hProxyTexture) |
|
ezGALTextureHandle | CreateSharedTexture (const ezGALTextureCreationDescription &description, ezArrayPtr< ezGALSystemMemoryDescription > initialData={}) |
|
ezGALTextureHandle | OpenSharedTexture (const ezGALTextureCreationDescription &description, ezGALPlatformSharedHandle hSharedHandle) |
|
void | DestroySharedTexture (ezGALTextureHandle hTexture) |
|
ezGALReadbackBufferHandle | CreateReadbackBuffer (const ezGALBufferCreationDescription &description) |
|
void | DestroyReadbackBuffer (ezGALReadbackBufferHandle hBuffer) |
|
ezGALReadbackTextureHandle | CreateReadbackTexture (const ezGALTextureCreationDescription &description) |
|
void | DestroyReadbackTexture (ezGALReadbackTextureHandle hTexture) |
|
void | UpdateBufferForNextFrame (ezGALBufferHandle hBuffer, ezConstByteArrayPtr sourceData, ezUInt32 uiDestOffset=0) |
| Ensures that the given buffer is updated at the beginning of the next frame.
|
|
void | UpdateTextureForNextFrame (ezGALTextureHandle hTexture, const ezGALSystemMemoryDescription &sourceData, const ezGALTextureSubresource &destinationSubResource={}, const ezBoundingBoxu32 &destinationBox=ezBoundingBoxu32::MakeZero()) |
| Ensures that the given texture is updated at the beginning of the next frame.
|
|
ezGALTextureResourceViewHandle | GetDefaultResourceView (ezGALTextureHandle hTexture) |
|
ezGALBufferResourceViewHandle | GetDefaultResourceView (ezGALBufferHandle hBuffer) |
|
ezGALTextureResourceViewHandle | CreateResourceView (const ezGALTextureResourceViewCreationDescription &description) |
|
void | DestroyResourceView (ezGALTextureResourceViewHandle hResourceView) |
|
ezGALBufferResourceViewHandle | CreateResourceView (const ezGALBufferResourceViewCreationDescription &description) |
|
void | DestroyResourceView (ezGALBufferResourceViewHandle hResourceView) |
|
ezGALRenderTargetViewHandle | GetDefaultRenderTargetView (ezGALTextureHandle hTexture) |
|
ezGALRenderTargetViewHandle | CreateRenderTargetView (const ezGALRenderTargetViewCreationDescription &description) |
|
void | DestroyRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView) |
|
ezGALTextureUnorderedAccessViewHandle | CreateUnorderedAccessView (const ezGALTextureUnorderedAccessViewCreationDescription &description) |
|
void | DestroyUnorderedAccessView (ezGALTextureUnorderedAccessViewHandle hUnorderedAccessView) |
|
ezGALBufferUnorderedAccessViewHandle | CreateUnorderedAccessView (const ezGALBufferUnorderedAccessViewCreationDescription &description) |
|
void | DestroyUnorderedAccessView (ezGALBufferUnorderedAccessViewHandle hUnorderedAccessView) |
|
ezGALSwapChainHandle | CreateSwapChain (const SwapChainFactoryFunction &func) |
|
ezResult | UpdateSwapChain (ezGALSwapChainHandle hSwapChain, ezEnum< ezGALPresentMode > newPresentMode) |
|
void | DestroySwapChain (ezGALSwapChainHandle hSwapChain) |
|
ezGALVertexDeclarationHandle | CreateVertexDeclaration (const ezGALVertexDeclarationCreationDescription &description) |
|
void | DestroyVertexDeclaration (ezGALVertexDeclarationHandle hVertexDeclaration) |
|
ezEnum< ezGALAsyncResult > | GetTimestampResult (ezGALTimestampHandle hTimestamp, ezTime &out_result) |
| Queries the result of a timestamp. Should be called every frame until ezGALAsyncResult::Ready is returned. More...
|
|
ezEnum< ezGALAsyncResult > | GetOcclusionQueryResult (ezGALOcclusionHandle hOcclusion, ezUInt64 &out_uiResult) |
| Queries the result of an occlusion query. Should be called every frame until ezGALAsyncResult::Ready is returned. More...
|
|
ezEnum< ezGALAsyncResult > | GetFenceResult (ezGALFenceHandle hFence, ezTime timeout=ezTime::MakeZero()) |
| Queries the result of a fence. Fences can never expire as they are just monotonically increasing numbers over time. More...
|
|
ezReadbackBufferLock | LockBuffer (ezGALReadbackBufferHandle hReadbackBuffer, ezArrayPtr< const ezUInt8 > &out_memory) |
| Tries to lock a readback buffer for reading. Only fails if the handle is invalid. More...
|
|
ezReadbackTextureLock | LockTexture (ezGALReadbackTextureHandle hReadbackTexture, const ezArrayPtr< const ezGALTextureSubresource > &subResources, ezDynamicArray< ezGALSystemMemoryDescription > &out_memory) |
| Tries to lock a readback texture for reading. Only fails if the handle is invalid. More...
|
|
ezGALTextureHandle | GetBackBufferTextureFromSwapChain (ezGALSwapChainHandle hSwapChain) |
|
void | EnqueueFrameSwapChain (ezGALSwapChainHandle hSwapChain) |
| Adds a swap-chain to be used for the next frame. Must be called before or during the ezGALDeviceEvent::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. More...
|
|
void | BeginFrame (const ezUInt64 uiAppFrame=0) |
| Begins rendering of a frame. This needs to be called first before any rendering function can be called. More...
|
|
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.
|
|
ezUInt64 | 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. More...
|
|
ezUInt64 | 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. More...
|
|
const ezGALDeviceCreationDescription * | GetDescription () const |
|
const ezGALSwapChain * | GetSwapChain (ezGALSwapChainHandle hSwapChain) const |
|
template<typename T > |
const T * | GetSwapChain (ezGALSwapChainHandle hSwapChain) const |
|
const ezGALShader * | GetShader (ezGALShaderHandle hShader) const |
|
const ezGALTexture * | GetTexture (ezGALTextureHandle hTexture) const |
|
virtual const ezGALSharedTexture * | GetSharedTexture (ezGALTextureHandle hTexture) const =0 |
|
const ezGALBuffer * | GetBuffer (ezGALBufferHandle hBuffer) const |
|
const ezGALDynamicBuffer * | GetDynamicBuffer (ezGALDynamicBufferHandle hBuffer) const |
|
ezGALDynamicBuffer * | GetDynamicBuffer (ezGALDynamicBufferHandle hBuffer) |
|
const ezGALReadbackBuffer * | GetReadbackBuffer (ezGALReadbackBufferHandle hBuffer) const |
|
const ezGALReadbackTexture * | GetReadbackTexture (ezGALReadbackTextureHandle hTexture) const |
|
const ezGALDepthStencilState * | GetDepthStencilState (ezGALDepthStencilStateHandle hDepthStencilState) const |
|
const ezGALBlendState * | GetBlendState (ezGALBlendStateHandle hBlendState) const |
|
const ezGALRasterizerState * | GetRasterizerState (ezGALRasterizerStateHandle hRasterizerState) const |
|
const ezGALVertexDeclaration * | GetVertexDeclaration (ezGALVertexDeclarationHandle hVertexDeclaration) const |
|
const ezGALSamplerState * | GetSamplerState (ezGALSamplerStateHandle hSamplerState) const |
|
const ezGALTextureResourceView * | GetResourceView (ezGALTextureResourceViewHandle hResourceView) const |
|
const ezGALBufferResourceView * | GetResourceView (ezGALBufferResourceViewHandle hResourceView) const |
|
const ezGALRenderTargetView * | GetRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView) const |
|
const ezGALTextureUnorderedAccessView * | GetUnorderedAccessView (ezGALTextureUnorderedAccessViewHandle hUnorderedAccessView) const |
|
const ezGALBufferUnorderedAccessView * | GetUnorderedAccessView (ezGALBufferUnorderedAccessViewHandle hUnorderedAccessView) const |
|
const ezGALDeviceCapabilities & | GetCapabilities () const |
|
virtual ezUInt64 | GetMemoryConsumptionForTexture (const ezGALTextureCreationDescription &description) const |
|
virtual ezUInt64 | GetMemoryConsumptionForBuffer (const ezGALBufferCreationDescription &description) const |
|
void | Flush () |
|
void | WaitIdle () |
| Waits for the GPU to be idle and destroys any pending resources and GPU objects.
|
|
ezAllocator * | GetAllocator () |
| Internal: Returns the allocator used by the device.
|
|
template<typename IdTableType , typename ReturnType > |
EZ_ALWAYS_INLINE ReturnType * | Get (typename IdTableType::TypeOfId hHandle, const IdTableType &IdTable) const |
|
template<typename HandleType > |
EZ_FORCE_INLINE void | AddDeadObject (ezUInt32 uiType, HandleType handle) |
|
|
using | ShaderTable = ezIdTable< ezGALShaderHandle::IdType, ezGALShader *, ezLocalAllocatorWrapper > |
|
using | BlendStateTable = ezIdTable< ezGALBlendStateHandle::IdType, ezGALBlendState *, ezLocalAllocatorWrapper > |
|
using | DepthStencilStateTable = ezIdTable< ezGALDepthStencilStateHandle::IdType, ezGALDepthStencilState *, ezLocalAllocatorWrapper > |
|
using | RasterizerStateTable = ezIdTable< ezGALRasterizerStateHandle::IdType, ezGALRasterizerState *, ezLocalAllocatorWrapper > |
|
using | BufferTable = ezIdTable< ezGALBufferHandle::IdType, ezGALBuffer *, ezLocalAllocatorWrapper > |
|
using | DynamicBufferTable = ezIdTable< ezGALDynamicBufferHandle::IdType, ezGALDynamicBuffer *, ezLocalAllocatorWrapper > |
|
using | TextureTable = ezIdTable< ezGALTextureHandle::IdType, ezGALTexture *, ezLocalAllocatorWrapper > |
|
using | ReadbackBufferTable = ezIdTable< ezGALReadbackBufferHandle::IdType, ezGALReadbackBuffer *, ezLocalAllocatorWrapper > |
|
using | ReadbackTextureTable = ezIdTable< ezGALReadbackTextureHandle::IdType, ezGALReadbackTexture *, ezLocalAllocatorWrapper > |
|
using | TextureResourceViewTable = ezIdTable< ezGALTextureResourceViewHandle::IdType, ezGALTextureResourceView *, ezLocalAllocatorWrapper > |
|
using | BufferResourceViewTable = ezIdTable< ezGALBufferResourceViewHandle::IdType, ezGALBufferResourceView *, ezLocalAllocatorWrapper > |
|
using | SamplerStateTable = ezIdTable< ezGALSamplerStateHandle::IdType, ezGALSamplerState *, ezLocalAllocatorWrapper > |
|
using | RenderTargetViewTable = ezIdTable< ezGALRenderTargetViewHandle::IdType, ezGALRenderTargetView *, ezLocalAllocatorWrapper > |
|
using | TextureUnorderedAccessViewTable = ezIdTable< ezGALTextureUnorderedAccessViewHandle::IdType, ezGALTextureUnorderedAccessView *, ezLocalAllocatorWrapper > |
|
using | BufferUnorderedAccessViewTable = ezIdTable< ezGALBufferUnorderedAccessViewHandle::IdType, ezGALBufferUnorderedAccessView *, ezLocalAllocatorWrapper > |
|
using | SwapChainTable = ezIdTable< ezGALSwapChainHandle::IdType, ezGALSwapChain *, ezLocalAllocatorWrapper > |
|
using | VertexDeclarationTable = ezIdTable< ezGALVertexDeclarationHandle::IdType, ezGALVertexDeclaration *, ezLocalAllocatorWrapper > |
|
The ezRenderDevice 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.