GFXD3D11Device
Engine/source/gfx/D3D11/gfxD3D11Device.h
Classes:
Render Targets
Updates the render targets and viewport in a device specific manner when they are dirty.
Protected Types
RPGDVB
Map< String, D3D11VertexDecl * >
VertexDeclMap
Used to lookup a vertex declaration for the vertex format.
Public Friends
class
class
class
class
class
class
Protected Static Attributes
Protected Attributes
Track the last const buffer we've used.
ID3D11Device *
ID3D11DeviceContext *
bool
ID3D11Texture2D *
ID3D11RenderTargetView *
ID3D11Texture2D *
ID3D11DepthStencilView *
mGenericShader [GS_COUNT]
mGenericShaderBuffer [GS_COUNT]
ID3D11PixelShader *
ID3D11VertexShader *
mModelViewProjSC [GS_COUNT]
DXGI_SAMPLE_DESC
IDXGISwapChain *
Temporary matrix, no assurances on value at all.
The stream 0 vertex buffer used for volatile VB offseting.
Private Functions
Allocate a target for doing render to texture operations, with no depth/stencil buffer.
allocWindowTarget(PlatformWindow * window)
Allocate a target for a given window.
enterDebugEvent(ColorI color, const char * name)
selectSupportedFormat(GFXTextureProfile * profile, const Vector< GFXFormat > & formats, bool texture, bool mustblend, bool mustfilter)
Returns the first format from the list which meets all the criteria of the texture profile and query options.
setDebugMarker(ColorI color, const char * name)
Protected Functions
_createTempShaderInternal(const GFXVertexFormat * vertexFormat)
_setPrimitiveBuffer(GFXPrimitiveBuffer * buffer)
Creates a new empty shader which must be initialized and deleted by the caller.
Called by GFXDevice to create a device specific stateblock.
createVBPool(const GFXVertexFormat * vertexFormat, U32 vertSize)
drawIndexedPrimitive(GFXPrimitiveType primType, U32 startVertex, U32 minIndex, U32 numVerts, U32 startIndex, U32 primitiveCount)
The parameters to drawIndexedPrimitive are somewhat complicated.
findVBPool(const GFXVertexFormat * vertexFormat, U32 numVertsNeeded)
IDXGISwapChain *
State initialization.
To manage creating and re-creating of these when device is aquired.
To release all resources we control from D3DPOOL_DEFAULT.
setLightInternal(U32 , const GFXLightInfo, bool )
setLightMaterialInternal(const GFXLightMaterial)
setMatrix(GFXMatrixType mtype, const MatrixF & mat)
This function must be implemented differently per API and it should set ONLY the current matrix.
Called by base GFXDevice to actually set a const buffer.
setStateBlockInternal(GFXStateBlock * block, bool force)
Called by GFXDevice to actually set a stateblock.
setTextureInternal(U32 textureUnit, const GFXTextureObject * texture)
DXGI_SWAP_CHAIN_DESC
setupPresentParams(const GFXVideoMode & mode, const HWND & hwnd)
Device helper function.
Public Static Functions
createInstance(U32 adapterIndex)
enumerateAdapters(Vector< GFXAdapter * > & adapterList)
Public Functions
GFXD3D11Device(U32 index)
Constructor.
allocPrimitiveBuffer(U32 numIndices, U32 numPrimitives, GFXBufferType bufferType, void * data)
This allocates a primitive buffer and returns a pointer to the allocated buffer.
allocVertexBuffer(U32 numVerts, const GFXVertexFormat * vertexFormat, U32 vertSize, GFXBufferType bufferType, void * data)
This allocates a vertex buffer and returns a pointer to the allocated buffer.
allocVertexDecl(const GFXVertexFormat * vertexFormat)
Called from GFXVertexFormat to allocate the hardware specific vertex declaration for rendering.
bool
GFXFence *
Allocate a fence.
Returns a hardware occlusion query object or NULL if this device does not support them.
createRenderSurface(U32 width, U32 height, GFXFormat format, U32 mipLevel)
drawPrimitive(GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount)
Returns active graphics adapter type.
ID3D11Texture2D *
ID3D11DepthStencilView *
ID3D11Device *
ID3D11DeviceContext *
Get the fill convention for this device.
DXGI_SAMPLE_DESC
Returns the number of simultaneous render targets supported by the device.
Returns the number of texture samplers that can be used in a shader rendering pass.
ID3D11RenderTargetView *
init(const GFXVideoMode & mode, PlatformWindow * window)
Initialize this GFXDevice, optionally specifying a platform window to bind to.
This is called before this, or any other device, is deleted in the global destroy() method.
primCountToIndexCount(GFXPrimitiveType primType, U32 primitiveCount)
setClipRect(const RectI & rect)
setPixelShaderVersion(F32 version)
This is a helper function to set a default shader for rendering GUI elements on systems which do not support fixed-function operations as well as for things which need just generic position/texture/color shaders.
setVertexDecl(const GFXVertexDecl * decl)
Sets the current vertex declaration on the device.
setVertexStream(U32 stream, GFXVertexBuffer * buffer)
Sets the vertex buffer on the device.
setVertexStreamFrequency(U32 stream, U32 frequency)
Set the vertex stream frequency on the device.
Detailed Description
Render Targets
_updateRenderTargets()
Reimplemented from: GFXDevice
Protected Types
typedef StrongRefPtr< GFXD3D11VertexBuffer > RPGDVB
typedef Map< String, D3D11VertexDecl * > VertexDeclMap
Used to lookup a vertex declaration for the vertex format.
Public Friends
Protected Static Attributes
GFXAdapter::CreateDeviceInstanceDelegate mCreateDeviceInstance
Protected Attributes
U32 mAdapterIndex
RectI mClipRect
S32 mCreateFenceType
StrongRefPtr< GFXD3D11ShaderConstBuffer > mCurrentConstBuffer
Track the last const buffer we've used.
Used to notify new constant buffers that they should send all of their constants up
GFXD3D11PrimitiveBuffer * mCurrentPB
GFXShader * mCurrentShader
ID3D11Device * mD3DDevice
ID3D11DeviceContext * mD3DDeviceContext
bool mDebugLayers
ID3D11Texture2D * mDeviceBackbuffer
ID3D11RenderTargetView * mDeviceBackBufferView
ID3D11Texture2D * mDeviceDepthStencil
ID3D11DepthStencilView * mDeviceDepthStencilView
U32 mDrawInstancesCount
StrongRefPtr< GFXD3D11PrimitiveBuffer > mDynamicPB
GFXShaderRef mGenericShader [GS_COUNT]
GFXShaderConstBufferRef mGenericShaderBuffer [GS_COUNT]
ID3D11PixelShader * mLastPixShader
ID3D11VertexShader * mLastVertShader
GFXShaderConstHandle * mModelViewProjSC [GS_COUNT]
DXGI_SAMPLE_DESC mMultisampleDesc
bool mOcclusionQuerySupported
F32 mPixVersion
IDXGISwapChain * mSwapChain
MatrixF mTempMatrix
Temporary matrix, no assurances on value at all.
VertexDeclMap mVertexDecls
GFXD3D11VertexBuffer * mVolatileVB
The stream 0 vertex buffer used for volatile VB offseting.
Vector< RPGDVB > mVolatileVBList
Private Functions
allocRenderToTextureTarget()
Reimplemented from: GFXDevice
allocWindowTarget(PlatformWindow * window)
Reimplemented from: GFXDevice
enterDebugEvent(ColorI color, const char * name)
Reimplemented from: GFXDevice
enumerateVideoModes()
Reimplemented from: GFXDevice
leaveDebugEvent()
Reimplemented from: GFXDevice
selectSupportedFormat(GFXTextureProfile * profile, const Vector< GFXFormat > & formats, bool texture, bool mustblend, bool mustfilter)
Reimplemented from: GFXDevice
setDebugMarker(ColorI color, const char * name)
Reimplemented from: GFXDevice
Protected Functions
_createTempShaderInternal(const GFXVertexFormat * vertexFormat)
_setPrimitiveBuffer(GFXPrimitiveBuffer * buffer)
_suppressDebugMessages()
createShader()
Reimplemented from: GFXDevice
createStateBlockInternal(const GFXStateBlockDesc & desc)
Reimplemented from: GFXDevice
createVBPool(const GFXVertexFormat * vertexFormat, U32 vertSize)
drawIndexedPrimitive(GFXPrimitiveType primType, U32 startVertex, U32 minIndex, U32 numVerts, U32 startIndex, U32 primitiveCount)
Reimplemented from: GFXDevice
findVBPool(const GFXVertexFormat * vertexFormat, U32 numVertsNeeded)
getSwapChain()
initStates()
Reimplemented from: GFXDevice
reacquireDefaultPoolResources()
To manage creating and re-creating of these when device is aquired.
releaseDefaultPoolResources()
To release all resources we control from D3DPOOL_DEFAULT.
setGlobalAmbientInternal(ColorF )
Reimplemented from: GFXDevice
setLightInternal(U32 , const GFXLightInfo, bool )
Reimplemented from: GFXDevice
setLightMaterialInternal(const GFXLightMaterial)
Reimplemented from: GFXDevice
setMatrix(GFXMatrixType mtype, const MatrixF & mat)
Reimplemented from: GFXDevice
setShaderConstBufferInternal(GFXShaderConstBuffer * buffer)
Reimplemented from: GFXDevice
setStateBlockInternal(GFXStateBlock * block, bool force)
Reimplemented from: GFXDevice
setTextureInternal(U32 textureUnit, const GFXTextureObject * texture)
Reimplemented from: GFXDevice
setupPresentParams(const GFXVideoMode & mode, const HWND & hwnd)
Device helper function.
Public Static Functions
createInstance(U32 adapterIndex)
enumerateAdapters(Vector< GFXAdapter * > & adapterList)
Public Functions
GFXD3D11Device(U32 index)
Constructor.
Parameters:
| d3d | Direct3D object to instantiate this device with |
| index | Adapter index since D3D can use multiple graphics adapters |
~GFXD3D11Device()
allocPrimitiveBuffer(U32 numIndices, U32 numPrimitives, GFXBufferType bufferType, void * data)
Reimplemented from: GFXDevice
allocVertexBuffer(U32 numVerts, const GFXVertexFormat * vertexFormat, U32 vertSize, GFXBufferType bufferType, void * data)
Reimplemented from: GFXDevice
allocVertexDecl(const GFXVertexFormat * vertexFormat)
Reimplemented from: GFXDevice
beginSceneInternal()
Reimplemented from: GFXDevice
clear(U32 flags, ColorI color, F32 z, U32 stencil)
Reimplemented from: GFXDevice
createCubemap()
Reimplemented from: GFXDevice
createFence()
Reimplemented from: GFXDevice
createOcclusionQuery()
Reimplemented from: GFXDevice
createRenderSurface(U32 width, U32 height, GFXFormat format, U32 mipLevel)
doParanoidStateCheck()
Reimplemented from: GFXDevice
drawPrimitive(GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount)
Reimplemented from: GFXDevice
endSceneInternal()
Reimplemented from: GFXDevice
getAdapterType()
Reimplemented from: GFXDevice
getAdaterIndex()
getBackBufferTexture()
getClipRect()
Reimplemented from: GFXDevice
getDepthStencilView()
getDevice()
getDeviceContext()
getFillConventionOffset()
Reimplemented from: GFXDevice
getMaxDynamicIndices()
Reimplemented from: GFXDevice
getMaxDynamicVerts()
Reimplemented from: GFXDevice
getMultisampleType()
getNumRenderTargets()
Reimplemented from: GFXDevice
getNumSamplers()
Reimplemented from: GFXDevice
getPixelShaderVersion()
Reimplemented from: GFXDevice
getRenderTargetView()
init(const GFXVideoMode & mode, PlatformWindow * window)
Reimplemented from: GFXDevice
preDestroy()
Reimplemented from: GFXDevice
primCountToIndexCount(GFXPrimitiveType primType, U32 primitiveCount)
reset(DXGI_SWAP_CHAIN_DESC & d3dpp)
Reset.
setClipRect(const RectI & rect)
Reimplemented from: GFXDevice
setPixelShaderVersion(F32 version)
Reimplemented from: GFXDevice
setShader(GFXShader * shader, bool force)
Reimplemented from: GFXDevice
setupGenericShaders(GenericShaderType type)
Reimplemented from: GFXDevice
setVertexDecl(const GFXVertexDecl * decl)
Reimplemented from: GFXDevice
setVertexStream(U32 stream, GFXVertexBuffer * buffer)
Reimplemented from: GFXDevice
setVertexStreamFrequency(U32 stream, U32 frequency)
Reimplemented from: GFXDevice
