ezEngine  Milestone 7
ezGALDeviceDX11 Class Reference

The DX11 device implementation of the graphics abstraction layer. More...

#include <DeviceDX11.h>

Inheritance diagram for ezGALDeviceDX11:

Public Member Functions

 ezGALDeviceDX11 (const ezGALDeviceCreationDescription &Description)
 
EZ_FORCE_INLINE ID3D11Device * GetDXDevice () const
 
EZ_FORCE_INLINE IDXGIFactory1 * GetDXGIFactory () const
 
EZ_FORCE_INLINE const
ezGALFormatLookupTableDX11
GetFormatLookupTable () const
 
- Public Member Functions inherited from ezGALDevice
ezResult Init ()
 
ezResult Shutdown ()
 
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, const void *pInitialData)
 
void DestroyBuffer (ezGALBufferHandle hBuffer)
 
ezGALBufferHandle CreateVertexBuffer (ezUInt32 uiVertexSize, ezUInt32 uiVertexCount, const void *pInitialData=nullptr)
 
ezGALBufferHandle CreateIndexBuffer (ezGALIndexType::Enum IndexType, ezUInt32 uiIndexCount, const void *pInitialData=nullptr)
 
ezGALBufferHandle CreateConstantBuffer (ezUInt32 uiBufferSize)
 
ezGALTextureHandle CreateTexture (const ezGALTextureCreationDescription &Description, const ezArrayPtr< ezGALSystemMemoryDescription > *pInitialData=nullptr)
 
void DestroyTexture (ezGALTextureHandle hTexture)
 
ezGALResourceViewHandle CreateResourceView (const ezGALResourceViewCreationDescription &Description)
 
void DestroyResourceView (ezGALResourceViewHandle hResourceView)
 
ezGALRenderTargetViewHandle CreateRenderTargetView (const ezGALRenderTargetViewCreationDescription &Description)
 
void DestroyRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView)
 
ezGALSwapChainHandle CreateSwapChain (const ezGALSwapChainCreationDescription &Description)
 
void DestroySwapChain (ezGALSwapChainHandle hSwapChain)
 
ezGALFenceHandle CreateFence ()
 
void DestroyFence (ezGALFenceHandle &hFence)
 
ezGALQueryHandle CreateQuery (const ezGALQueryCreationDescription &Description)
 
void DestroyQuery (ezGALQueryHandle hQuery)
 
ezGALVertexDeclarationHandle CreateVertexDeclaration (const ezGALVertexDeclarationCreationDescription &Description)
 
void DestroyVertexDeclaration (ezGALVertexDeclarationHandle hVertexDeclaration)
 
void GetQueryData (ezGALQueryHandle hQuery, ezUInt64 *puiRendererdPixels)
 
void Present (ezGALSwapChainHandle hSwapChain)
 
ezGALTextureHandle GetBackBufferTextureFromSwapChain (ezGALSwapChainHandle hSwapChain)
 
void BeginFrame ()
 
void EndFrame ()
 
void Flush ()
 
void Finish ()
 
void SetPrimarySwapChain (ezGALSwapChainHandle hSwapChain)
 
ezGALSwapChainHandle GetPrimarySwapChain () const
 
ezGALContextGetPrimaryContext () const
 
template<typename T >
T * GetPrimaryContext () const
 
const
ezGALDeviceCreationDescription
GetDescription () const
 
const ezGALSwapChainGetSwapChain (ezGALSwapChainHandle hSwapChain) const
 
const ezGALShaderGetShader (ezGALShaderHandle hShader) const
 
const ezGALTextureGetTexture (ezGALTextureHandle hTexture) const
 
const ezGALBufferGetBuffer (ezGALBufferHandle hBuffer) const
 
const ezGALDepthStencilStateGetDepthStencilState (ezGALDepthStencilStateHandle hDepthStencilState) const
 
const ezGALBlendStateGetBlendState (ezGALBlendStateHandle hBlendState) const
 
const ezGALRasterizerStateGetRasterizerState (ezGALRasterizerStateHandle hRasterizerState) const
 
const ezGALVertexDeclarationGetVertexDeclaration (ezGALVertexDeclarationHandle hVertexDeclaration) const
 
const ezGALQuery * GetQuery (ezGALQueryHandle hQuery) const
 
const ezGALSamplerStateGetSamplerState (ezGALSamplerStateHandle hSamplerState) const
 
const ezGALResourceViewGetResourceView (ezGALResourceViewHandle hResourceView) const
 
const ezGALRenderTargetViewGetRenderTargetView (ezGALRenderTargetViewHandle hRenderTargetView) const
 
const ezGALDeviceCapabilitiesGetCapabilities () const
 
virtual ezUInt64 GetMemoryConsumptionForTexture (const ezGALTextureCreationDescription &Description) const
 
virtual ezUInt64 GetMemoryConsumptionForBuffer (const ezGALBufferCreationDescription &Description) const
 
template<typename IdTableType , typename ReturnType >
EZ_FORCE_INLINE ReturnType * Get (typename IdTableType::TypeOfId hHandle, const IdTableType &IdTable) const
 

Protected Member Functions

virtual ezResult InitPlatform () override
 
virtual ezResult ShutdownPlatform () override
 
virtual ezGALBlendStateCreateBlendStatePlatform (const ezGALBlendStateCreationDescription &Description) override
 
virtual void DestroyBlendStatePlatform (ezGALBlendState *pBlendState) override
 
virtual ezGALDepthStencilStateCreateDepthStencilStatePlatform (const ezGALDepthStencilStateCreationDescription &Description) override
 
virtual void DestroyDepthStencilStatePlatform (ezGALDepthStencilState *pDepthStencilState) override
 
virtual ezGALRasterizerStateCreateRasterizerStatePlatform (const ezGALRasterizerStateCreationDescription &Description) override
 
virtual void DestroyRasterizerStatePlatform (ezGALRasterizerState *pRasterizerState) override
 
virtual ezGALSamplerStateCreateSamplerStatePlatform (const ezGALSamplerStateCreationDescription &Description) override
 
virtual void DestroySamplerStatePlatform (ezGALSamplerState *pSamplerState) override
 
virtual ezGALShaderCreateShaderPlatform (const ezGALShaderCreationDescription &Description) override
 
virtual void DestroyShaderPlatform (ezGALShader *pShader) override
 
virtual ezGALBufferCreateBufferPlatform (const ezGALBufferCreationDescription &Description, const void *pInitialData) override
 
virtual void DestroyBufferPlatform (ezGALBuffer *pBuffer) override
 
virtual ezGALTextureCreateTexturePlatform (const ezGALTextureCreationDescription &Description, const ezArrayPtr< ezGALSystemMemoryDescription > *pInitialData) override
 
virtual void DestroyTexturePlatform (ezGALTexture *pTexture) override
 
virtual ezGALResourceViewCreateResourceViewPlatform (const ezGALResourceViewCreationDescription &Description) override
 
virtual void DestroyResourceViewPlatform (ezGALResourceView *pResourceView) override
 
virtual ezGALRenderTargetViewCreateRenderTargetViewPlatform (const ezGALRenderTargetViewCreationDescription &Description) override
 
virtual void DestroyRenderTargetViewPlatform (ezGALRenderTargetView *pRenderTargetView) override
 
virtual ezGALSwapChainCreateSwapChainPlatform (const ezGALSwapChainCreationDescription &Description) override
 
virtual void DestroySwapChainPlatform (ezGALSwapChain *pSwapChain) override
 
virtual ezGALFence * CreateFencePlatform () override
 
virtual void DestroyFencePlatform (ezGALFence *pFence) override
 
virtual ezGALQuery * CreateQueryPlatform (const ezGALQueryCreationDescription &Description) override
 
virtual void DestroyQueryPlatform (ezGALQuery *pQuery) override
 
virtual ezGALVertexDeclarationCreateVertexDeclarationPlatform (const ezGALVertexDeclarationCreationDescription &Description) override
 
virtual void DestroyVertexDeclarationPlatform (ezGALVertexDeclaration *pVertexDeclaration) override
 
virtual void GetQueryDataPlatform (ezGALQuery *pQuery, ezUInt64 *puiRendererdPixels) override
 
virtual void PresentPlatform (ezGALSwapChain *pSwapChain) override
 
virtual void BeginFramePlatform () override
 
virtual void EndFramePlatform () override
 
virtual void FlushPlatform () override
 
virtual void FinishPlatform () override
 
virtual void SetPrimarySwapChainPlatform (ezGALSwapChain *pSwapChain) override
 
virtual void FillCapabilitiesPlatform () override
 
- Protected Member Functions inherited from ezGALDevice
template<typename IdTableType , typename ReturnType >
ReturnType * Get (typename IdTableType::TypeOfId hHandle, const IdTableType &IdTable) const
 
 ezGALDevice (const ezGALDeviceCreationDescription &Description)
 

Private Member Functions

void FillFormatLookupTable ()
 

Private Attributes

ID3D11Device * m_pDevice
 
IDXGIFactory1 * m_pDXGIFactory
 
IDXGIAdapter1 * m_pDXGIAdapter
 
IDXGIDevice1 * m_pDXGIDevice
 
ezGALFormatLookupTableDX11 m_FormatLookupTable
 
D3D_FEATURE_LEVEL m_FeatureLevel
 

Additional Inherited Members

- Static Public Member Functions inherited from ezGALDevice
static void SetDefaultDevice (ezGALDevice *pDefaultDevice)
 
static ezGALDeviceGetDefaultDevice ()
 
- Protected Types inherited from ezGALDevice
typedef ezIdTable
< ezGALShaderHandle::IdType,
ezGALShader
*, ezLocalAllocatorWrapper
ShaderTable
 
typedef ezIdTable
< ezGALBlendStateHandle::IdType,
ezGALBlendState
*, ezLocalAllocatorWrapper
BlendStateTable
 
typedef ezIdTable
< ezGALDepthStencilStateHandle::IdType,
ezGALDepthStencilState
*, ezLocalAllocatorWrapper
DepthStencilStateTable
 
typedef ezIdTable
< ezGALRasterizerStateHandle::IdType,
ezGALRasterizerState
*, ezLocalAllocatorWrapper
RasterizerStateTable
 
typedef ezIdTable
< ezGALBufferHandle::IdType,
ezGALBuffer
*, ezLocalAllocatorWrapper
BufferTable
 
typedef ezIdTable
< ezGALTextureHandle::IdType,
ezGALTexture
*, ezLocalAllocatorWrapper
TextureTable
 
typedef ezIdTable
< ezGALResourceViewHandle::IdType,
ezGALResourceView
*, ezLocalAllocatorWrapper
ResourceViewTable
 
typedef ezIdTable
< ezGALSamplerStateHandle::IdType,
ezGALSamplerState
*, ezLocalAllocatorWrapper
SamplerStateTable
 
typedef ezIdTable
< ezGALRenderTargetViewHandle::IdType,
ezGALRenderTargetView
*, ezLocalAllocatorWrapper
RenderTargetViewTable
 
typedef ezIdTable
< ezGALSwapChainHandle::IdType,
ezGALSwapChain
*, ezLocalAllocatorWrapper
SwapChainTable
 
typedef ezIdTable
< ezGALFenceHandle::IdType,
ezGALFence
*, ezLocalAllocatorWrapper
FenceTable
 
typedef ezIdTable
< ezGALQueryHandle::IdType,
ezGALQuery
*, ezLocalAllocatorWrapper
QueryTable
 
typedef ezIdTable
< ezGALVertexDeclarationHandle::IdType,
ezGALVertexDeclaration
*, ezLocalAllocatorWrapper
VertexDeclarationTable
 
- Protected Attributes inherited from ezGALDevice
ezProxyAllocator m_Allocator
 
ezLocalAllocatorWrapper m_AllocatorWrapper
 
ShaderTable m_Shaders
 
BlendStateTable m_BlendStates
 
DepthStencilStateTable m_DepthStencilStates
 
RasterizerStateTable m_RasterizerStates
 
BufferTable m_Buffers
 
TextureTable m_Textures
 
ResourceViewTable m_ResourceViews
 
SamplerStateTable m_SamplerStates
 
RenderTargetViewTable m_RenderTargetViews
 
SwapChainTable m_SwapChains
 
FenceTable m_Fences
 
QueryTable m_Queries
 
VertexDeclarationTable m_VertexDeclarations
 
ezMap< ezUInt32,
ezGALBlendStateHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_BlendStateMap
 
ezMap< ezUInt32,
ezGALDepthStencilStateHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_DepthStencilStateMap
 
ezMap< ezUInt32,
ezGALRasterizerStateHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_RasterizerStateMap
 
ezMap< ezUInt32,
ezGALResourceViewHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_ResourceViewMap
 
ezMap< ezUInt32,
ezGALSamplerStateHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_SamplerStateMap
 
ezMap< ezUInt32,
ezGALRenderTargetViewHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_RenderTargetViewMap
 
ezMap< ezUInt32,
ezGALVertexDeclarationHandle,
ezCompareHelper< ezUInt32 >
, ezLocalAllocatorWrapper
m_VertexDeclarationMap
 
ezGALDeviceCreationDescription m_Description
 
ezGALSwapChainHandle m_hPrimarySwapChain
 
ezGALContextm_pPrimaryContext
 
ezGALDeviceCapabilities m_Capabilities
 

Detailed Description

The DX11 device implementation of the graphics abstraction layer.

Constructor & Destructor Documentation

ezGALDeviceDX11::ezGALDeviceDX11 ( const ezGALDeviceCreationDescription Description)
Todo:
This shouldn't be accessible, there should be a factory instantiating the correct renderer class via RTTI for example

Member Function Documentation

ezGALSwapChain * ezGALDeviceDX11::CreateSwapChainPlatform ( const ezGALSwapChainCreationDescription Description)
overrideprotectedvirtual
Todo:
Move the real code creating things to the implementation files (all?)
void ezGALDeviceDX11::FillFormatLookupTable ( )
private

The list below is in the same order as the ezGALResourceFormat enum. No format should be missing except the ones that are just different names for the same enum value.

ezResult ezGALDeviceDX11::InitPlatform ( )
overrideprotectedvirtual
Todo:
Get features of the device (depending on feature level, CheckFormat* functions etc.)

The documentation for this class was generated from the following files: