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.
|
|
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) |
|
ezGALBindGroupLayoutHandle | CreateBindGroupLayout (const ezGALBindGroupLayoutCreationDescription &description) |
|
void | DestroyBindGroupLayout (ezGALBindGroupLayoutHandle hBindGroupLayout) |
|
ezGALPipelineLayoutHandle | CreatePipelineLayout (const ezGALPipelineLayoutCreationDescription &description) |
|
void | DestroyPipelineLayout (ezGALPipelineLayoutHandle hPipelineLayout) |
|
ezGALGraphicsPipelineHandle | CreateGraphicsPipeline (const ezGALGraphicsPipelineCreationDescription &description) |
|
void | DestroyGraphicsPipeline (ezGALGraphicsPipelineHandle hGraphicsPipeline) |
|
ezGALComputePipelineHandle | CreateComputePipeline (const ezGALComputePipelineCreationDescription &description) |
|
void | DestroyComputePipeline (ezGALComputePipelineHandle hComputePipeline) |
|
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.
|
|
ezGALRenderTargetViewHandle | GetDefaultRenderTargetView (ezGALTextureHandle hTexture) |
|
ezGALRenderTargetViewHandle | CreateRenderTargetView (const ezGALRenderTargetViewCreationDescription &description) |
|
void | DestroyRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView) |
|
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.
|
|
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.
|
|
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.
|
|
ezReadbackBufferLock | LockBuffer (ezGALReadbackBufferHandle hReadbackBuffer, ezArrayPtr< const ezUInt8 > &out_memory) |
| Tries to lock a readback buffer for reading. Only fails if the handle is invalid.
|
|
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.
|
|
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.
|
|
void | BeginFrame (const ezUInt64 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.
|
|
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.
|
|
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.
|
|
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 ezGALBindGroupLayout * | GetBindGroupLayout (ezGALBindGroupLayoutHandle hBindGroupLayout) const |
|
const ezGALPipelineLayout * | GetPipelineLayout (ezGALPipelineLayoutHandle hPipelineLayout) const |
|
const ezGALGraphicsPipeline * | GetGraphicsPipeline (ezGALGraphicsPipelineHandle hGraphicsPipeline) const |
|
const ezGALComputePipeline * | GetComputePipeline (ezGALComputePipelineHandle hComputePipeline) const |
|
const ezGALRenderTargetView * | GetRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView) 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 | SamplerStateTable = ezIdTable< ezGALSamplerStateHandle::IdType, ezGALSamplerState *, ezLocalAllocatorWrapper > |
|
using | RenderTargetViewTable = ezIdTable< ezGALRenderTargetViewHandle::IdType, ezGALRenderTargetView *, ezLocalAllocatorWrapper > |
|
using | SwapChainTable = ezIdTable< ezGALSwapChainHandle::IdType, ezGALSwapChain *, ezLocalAllocatorWrapper > |
|
using | VertexDeclarationTable = ezIdTable< ezGALVertexDeclarationHandle::IdType, ezGALVertexDeclaration *, ezLocalAllocatorWrapper > |
|
using | BindGroupLayoutTable = ezIdTable< ezGALBindGroupLayoutHandle::IdType, ezGALBindGroupLayout *, ezLocalAllocatorWrapper > |
|
using | PipelineLayoutTable = ezIdTable< ezGALPipelineLayoutHandle::IdType, ezGALPipelineLayout *, ezLocalAllocatorWrapper > |
|
using | GraphicsPipelineTable = ezIdTable< ezGALGraphicsPipelineHandle::IdType, ezGALGraphicsPipeline *, ezLocalAllocatorWrapper > |
|
using | ComputePipelineTable = ezIdTable< ezGALComputePipelineHandle::IdType, ezGALComputePipeline *, ezLocalAllocatorWrapper > |
|
|
| ezGALDevice (const ezGALDeviceCreationDescription &Description) |
|
template<typename IdTableType , typename ReturnType > |
ReturnType * | Get (typename IdTableType::TypeOfId hHandle, const IdTableType &IdTable) const |
|
void | DestroyViews (ezGALTexture *pResource) |
|
template<typename HandleType > |
void | AddDeadObject (ezUInt32 uiType, HandleType handle) |
|
template<typename HandleType > |
void | ReviveDeadObject (ezUInt32 uiType, HandleType handle) |
|
void | DestroyDeadObjects () |
|
void | VerifyMultithreadedAccess () const |
| Asserts that either this device supports multi-threaded resource creation, or that this function is executed on the main thread.
|
|
const ezGALSwapChain * | GetSwapChainInternal (ezGALSwapChainHandle hSwapChain, const ezRTTI *pRequestedType) const |
|
ezGALTextureHandle | FinalizeTextureInternal (const ezGALTextureCreationDescription &desc, ezGALTexture *pTexture) |
|
template<typename Handle , typename View , typename ViewTable , typename CacheTable > |
Handle | TryGetView (ezUInt32 uiHash, ViewTable &viewTable, CacheTable &cacheTable) |
|
template<typename Handle , typename View , typename ViewTable , typename CacheTable > |
Handle | InsertView (ezUInt32 uiHash, View *pView, ViewTable &viewTable, CacheTable &cacheTable) |
|
template<typename View , typename Handle , typename ViewTable > |
void | DestroyView (Handle hView, ViewTable &table, ezUInt32 galObjectType) |
|
template<typename Handle , typename Resource , typename Table , typename CacheTable > |
Handle | TryGetHashedResource (ezUInt32 uiHash, Table &table, CacheTable &cacheTable, ezUInt32 galObjectType, ezUInt32 &ref_uiCounter) |
|
template<typename Handle , typename Resource , typename Table , typename CacheTable > |
Handle | InsertHashedResource (ezUInt32 uiHash, Resource *pResource, Table &table, CacheTable &cacheTable, ezUInt32 &ref_uiCounter) |
|
template<typename Resource , typename Handle , typename Table > |
void | DestroyHashedResource (Handle hResource, Table &table, ezUInt32 galObjectType, ezUInt32 &ref_uiCounter) |
|
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.