ezEngine  Milestone 7
ezGALContextDX11 Class Reference

The DX11 implementation of the graphics context. More...

#include <ContextDX11.h>

Inheritance diagram for ezGALContextDX11:

Public Member Functions

EZ_FORCE_INLINE
ID3D11DeviceContext * 
GetDXContext () const
 
- Public Member Functions inherited from ezGALContext
void Clear (const ezColor &ClearColor, ezUInt32 uiRenderTargetClearMask=0xFFFFFFFFu, bool bClearDepth=true, bool bClearStencil=true, float fDepthClear=1.0f, ezUInt8 uiStencilClear=0x0u)
 Clears active rendertargets. More...
 
void Draw (ezUInt32 uiVertexCount, ezUInt32 uiStartVertex)
 
void DrawIndexed (ezUInt32 uiIndexCount, ezUInt32 uiStartIndex)
 
void DrawIndexedInstanced (ezUInt32 uiIndexCountPerInstance, ezUInt32 uiInstanceCount, ezUInt32 uiStartIndex)
 
void DrawIndexedInstancedIndirect (ezGALBufferHandle hIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes)
 
void DrawInstanced (ezUInt32 uiVertexCountPerInstance, ezUInt32 uiInstanceCount, ezUInt32 uiStartVertex)
 
void DrawInstancedIndirect (ezGALBufferHandle hIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes)
 
void DrawAuto ()
 
void BeginStreamOut ()
 
void EndStreamOut ()
 
void Dispatch (ezUInt32 uiThreadGroupCountX, ezUInt32 uiThreadGroupCountY, ezUInt32 uiThreadGroupCountZ)
 
void DispatchIndirect (ezGALBufferHandle hIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes)
 
void SetShader (ezGALShaderHandle hShader)
 
void SetIndexBuffer (ezGALBufferHandle hIndexBuffer)
 
void SetVertexBuffer (ezUInt32 uiSlot, ezGALBufferHandle hVertexBuffer)
 
void SetVertexDeclaration (ezGALVertexDeclarationHandle hVertexDeclaration)
 
void SetPrimitiveTopology (ezGALPrimitiveTopology::Enum Topology)
 
void SetConstantBuffer (ezUInt32 uiSlot, ezGALBufferHandle hBuffer)
 
void SetSamplerState (ezGALShaderStage::Enum Stage, ezUInt32 uiSlot, ezGALSamplerStateHandle hSamplerState)
 
void SetResourceView (ezGALShaderStage::Enum Stage, ezUInt32 uiSlot, ezGALResourceViewHandle hResourceView)
 
void SetRenderTargetSetup (const ezGALRenderTagetSetup &RenderTargetSetup)
 
void SetUnorderedAccessView (ezUInt32 uiSlot, ezGALResourceViewHandle hResourceView)
 
void SetBlendState (ezGALBlendStateHandle hBlendState, const ezColor &BlendFactor=ezColor::White, ezUInt32 uiSampleMask=0xFFFFFFFFu)
 
void SetDepthStencilState (ezGALDepthStencilStateHandle hDepthStencilState, ezUInt8 uiStencilRefValue=0xFFu)
 
void SetRasterizerState (ezGALRasterizerStateHandle hRasterizerState)
 
void SetViewport (float fX, float fY, float fWidth, float fHeight, float fMinDepth, float fMaxDepth)
 
void SetScissorRect (ezUInt32 uiX, ezUInt32 uiY, ezUInt32 uiWidth, ezUInt32 uiHeight)
 
void SetStreamOutBuffer (ezUInt32 uiSlot, ezGALBufferHandle hBuffer, ezUInt32 uiOffset)
 
void InsertFence (ezGALFenceHandle hFence)
 
bool IsFenceReached (ezGALFenceHandle hFence)
 
void WaitForFence (ezGALFenceHandle hFence)
 
void BeginQuery (ezGALQueryHandle hQuery)
 
void EndQuery (ezGALQueryHandle hQuery)
 
void CopyBuffer (ezGALBufferHandle hDest, ezGALBufferHandle hSource)
 
void CopyBufferRegion (ezGALBufferHandle hDest, ezUInt32 uiDestOffset, ezGALBufferHandle hSource, ezUInt32 uiSourceOffset, ezUInt32 uiByteCount)
 
void UpdateBuffer (ezGALBufferHandle hDest, ezUInt32 uiDestOffset, const void *pSourceData, ezUInt32 uiByteCount)
 
void CopyTexture (ezGALTextureHandle hDest, ezGALTextureHandle hSource)
 
void CopyTextureRegion (ezGALTextureHandle hDest, const ezGALTextureSubresource &DestinationSubResource, const ezVec3U32 &DestinationPoint, ezGALTextureHandle hSource, const ezGALTextureSubresource &SourceSubResource, const ezBoundingBoxu32 &Box)
 
void UpdateTexture (ezGALTextureHandle hDest, const ezGALTextureSubresource &DestinationSubResource, const ezBoundingBoxu32 &DestinationBox, const void *pSourceData, ezUInt32 uiSourceRowPitch, ezUInt32 uiSourceDepthPitch)
 
void ResolveTexture (ezGALTextureHandle hDest, const ezGALTextureSubresource &DestinationSubResource, ezGALTextureHandle hSource, const ezGALTextureSubresource &SourceSubResource)
 
void ReadbackTexture (ezGALTextureHandle hTexture)
 
void CopyTextureReadbackResult (ezGALTextureHandle hTexture, const ezArrayPtr< ezGALSystemMemoryDescription > *pData)
 
void PushMarker (const char *Marker)
 
void PopMarker ()
 
void InsertEventMarker (const char *Marker)
 
void ClearStatisticsCounters ()
 

Protected Member Functions

 ezGALContextDX11 (ezGALDevice *pDevice, ID3D11DeviceContext *pDXContext)
 
virtual void ClearPlatform (const ezColor &ClearColor, ezUInt32 uiRenderTargetClearMask, bool bClearDepth, bool bClearStencil, float fDepthClear, ezUInt8 uiStencilClear) override
 
virtual void DrawPlatform (ezUInt32 uiVertexCount, ezUInt32 uiStartVertex) override
 
virtual void DrawIndexedPlatform (ezUInt32 uiIndexCount, ezUInt32 uiStartIndex) override
 
virtual void DrawIndexedInstancedPlatform (ezUInt32 uiIndexCountPerInstance, ezUInt32 uiInstanceCount, ezUInt32 uiStartIndex) override
 
virtual void DrawIndexedInstancedIndirectPlatform (ezGALBuffer *pIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes) override
 
virtual void DrawInstancedPlatform (ezUInt32 uiVertexCountPerInstance, ezUInt32 uiInstanceCount, ezUInt32 uiStartVertex) override
 
virtual void DrawInstancedIndirectPlatform (ezGALBuffer *pIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes) override
 
virtual void DrawAutoPlatform () override
 
virtual void BeginStreamOutPlatform () override
 
virtual void EndStreamOutPlatform () override
 
virtual void DispatchPlatform (ezUInt32 uiThreadGroupCountX, ezUInt32 uiThreadGroupCountY, ezUInt32 uiThreadGroupCountZ) override
 
virtual void DispatchIndirectPlatform (ezGALBuffer *pIndirectArgumentBuffer, ezUInt32 uiArgumentOffsetInBytes) override
 
virtual void SetShaderPlatform (ezGALShader *pShader) override
 
virtual void SetIndexBufferPlatform (ezGALBuffer *pIndexBuffer) override
 
virtual void SetVertexBufferPlatform (ezUInt32 uiSlot, ezGALBuffer *pVertexBuffer) override
 
virtual void SetVertexDeclarationPlatform (ezGALVertexDeclaration *pVertexDeclaration) override
 
virtual void SetPrimitiveTopologyPlatform (ezGALPrimitiveTopology::Enum Topology) override
 
virtual void SetConstantBufferPlatform (ezUInt32 uiSlot, ezGALBuffer *pBuffer) override
 
virtual void SetSamplerStatePlatform (ezGALShaderStage::Enum Stage, ezUInt32 uiSlot, ezGALSamplerState *pSamplerState) override
 
virtual void SetResourceViewPlatform (ezGALShaderStage::Enum Stage, ezUInt32 uiSlot, ezGALResourceView *pResourceView) override
 
virtual void SetRenderTargetSetupPlatform (ezGALRenderTargetView **ppRenderTargetViews, ezUInt32 uiRenderTargetCount, ezGALRenderTargetView *pDepthStencilView) override
 
virtual void SetUnorderedAccessViewPlatform (ezUInt32 uiSlot, ezGALResourceView *pResourceView) override
 
virtual void SetBlendStatePlatform (ezGALBlendState *pBlendState, const ezColor &BlendFactor, ezUInt32 uiSampleMask) override
 
virtual void SetDepthStencilStatePlatform (ezGALDepthStencilState *pDepthStencilState, ezUInt8 uiStencilRefValue) override
 
virtual void SetRasterizerStatePlatform (ezGALRasterizerState *pRasterizerState) override
 
virtual void SetViewportPlatform (float fX, float fY, float fWidth, float fHeight, float fMinDepth, float fMaxDepth) override
 
virtual void SetScissorRectPlatform (ezUInt32 uiX, ezUInt32 uiY, ezUInt32 uiWidth, ezUInt32 uiHeight) override
 
virtual void SetStreamOutBufferPlatform (ezUInt32 uiSlot, ezGALBuffer *pBuffer, ezUInt32 uiOffset) override
 
virtual void InsertFencePlatform (ezGALFence *pFence) override
 
virtual bool IsFenceReachedPlatform (ezGALFence *pFence) override
 
virtual void BeginQueryPlatform (ezGALQuery *pQuery) override
 
virtual void EndQueryPlatform (ezGALQuery *pQuery) override
 
virtual void CopyBufferPlatform (ezGALBuffer *pDestination, ezGALBuffer *pSource) override
 
virtual void CopyBufferRegionPlatform (ezGALBuffer *pDestination, ezUInt32 uiDestOffset, ezGALBuffer *pSource, ezUInt32 uiSourceOffset, ezUInt32 uiByteCount) override
 
virtual void UpdateBufferPlatform (ezGALBuffer *pDestination, ezUInt32 uiDestOffset, const void *pSourceData, ezUInt32 uiByteCount) override
 
virtual void CopyTexturePlatform (ezGALTexture *pDestination, ezGALTexture *pSource) override
 
virtual void CopyTextureRegionPlatform (ezGALTexture *pDestination, const ezGALTextureSubresource &DestinationSubResource, const ezVec3U32 &DestinationPoint, ezGALTexture *pSource, const ezGALTextureSubresource &SourceSubResource, const ezBoundingBoxu32 &Box) override
 
virtual void UpdateTexturePlatform (ezGALTexture *pDestination, const ezGALTextureSubresource &DestinationSubResource, const ezBoundingBoxu32 &DestinationBox, const void *pSourceData, ezUInt32 uiSourceRowPitch, ezUInt32 uiSourceDepthPitch) override
 
virtual void ResolveTexturePlatform (ezGALTexture *pDestination, const ezGALTextureSubresource &DestinationSubResource, ezGALTexture *pSource, const ezGALTextureSubresource &SourceSubResource) override
 
virtual void ReadbackTexturePlatform (ezGALTexture *pTexture) override
 
virtual void CopyTextureReadbackResultPlatform (ezGALTexture *pTexture, const ezArrayPtr< ezGALSystemMemoryDescription > *pData) override
 
virtual void PushMarkerPlatform (const char *szMarker) override
 
virtual void PopMarkerPlatform () override
 
virtual void InsertEventMarkerPlatform (const char *szMarker) override
 
void FlushDeferredStateChanges ()
 
- Protected Member Functions inherited from ezGALContext
 ezGALContext (ezGALDevice *pDevice)
 
void InvalidateState ()
 

Protected Attributes

ID3D11DeviceContext * m_pDXContext
 
ID3DUserDefinedAnnotation * m_pDXAnnotation
 
ID3D11RenderTargetView * m_pBoundRenderTargets [EZ_GAL_MAX_RENDERTARGET_COUNT]
 
ID3D11DepthStencilView * m_pBoundDepthStencilTarget
 
ID3D11Buffer * m_pBoundVertexBuffers [EZ_GAL_MAX_VERTEX_BUFFER_COUNT]
 
ezUInt32 m_VertexBufferStrides [EZ_GAL_MAX_VERTEX_BUFFER_COUNT]
 
ezUInt32 m_VertexBufferOffsets [EZ_GAL_MAX_VERTEX_BUFFER_COUNT]
 
ID3D11Buffer * m_pBoundConstantBuffers [EZ_GAL_MAX_CONSTANT_BUFFER_COUNT]
 
ezUInt32 m_uiBoundRenderTargetCount
 
ID3D11ShaderResourceView * m_pBoundShaderResourceViews [ezGALShaderStage::ENUM_COUNT][EZ_GAL_MAX_SHADER_RESOURCE_VIEW_COUNT]
 
ID3D11SamplerState * m_pBoundSamplerStates [ezGALShaderStage::ENUM_COUNT][EZ_GAL_MAX_SHADER_RESOURCE_VIEW_COUNT]
 
ezBitflags
< ezGALDX11::DeferredStateChanged > 
m_DeferredStateChanged
 

Friends

class ezGALDeviceDX11
 
class ezMemoryUtils
 

Detailed Description

The DX11 implementation of the graphics context.

Member Function Documentation

void ezGALContextDX11::ClearPlatform ( const ezColor ClearColor,
ezUInt32  uiRenderTargetClearMask,
bool  bClearDepth,
bool  bClearStencil,
float  fDepthClear,
ezUInt8  uiStencilClear 
)
overrideprotectedvirtual
Todo:
Parameters

Implements ezGALContext.

void ezGALContextDX11::CopyTextureReadbackResultPlatform ( ezGALTexture pTexture,
const ezArrayPtr< ezGALSystemMemoryDescription > *  pData 
)
overrideprotectedvirtual
Todo:
add parameters for mip level & count selection?

Implements ezGALContext.

void ezGALContextDX11::FlushDeferredStateChanges ( )
protected
Todo:
Optimize / add other stages
Todo:
Optimize / add other stages
void ezGALContextDX11::ReadbackTexturePlatform ( ezGALTexture pTexture)
overrideprotectedvirtual
Todo:
Other mip levels etc?

Implements ezGALContext.

void ezGALContextDX11::SetConstantBufferPlatform ( ezUInt32  uiSlot,
ezGALBuffer pBuffer 
)
overrideprotectedvirtual
Todo:
Check if the device supports the slot index?

Implements ezGALContext.

void ezGALContextDX11::SetSamplerStatePlatform ( ezGALShaderStage::Enum  Stage,
ezUInt32  uiSlot,
ezGALSamplerState pSamplerState 
)
overrideprotectedvirtual
Todo:
Check if the device supports the stage / the slot index

Implements ezGALContext.

void ezGALContextDX11::SetShaderPlatform ( ezGALShader pShader)
overrideprotectedvirtual
Todo:
Optimize (change only shaders which need to be set)

Implements ezGALContext.


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