GFXD3D11Device

Engine/source/gfx/D3D11/gfxD3D11Device.h

More...

Classes:

Render Targets

Updates the render targets and viewport in a device specific manner when they are dirty.

Public Types

Map< U32, ID3D11SamplerState * >
SamplerMap 

Protected Types

VertexDeclMap 

Used to lookup a vertex declaration for the vertex format.

Protected Attributes

Track the last const buffer we've used.

ID3D11Device *
ID3D11DeviceContext *
ID3D11Texture2D *
ID3D11RenderTargetView *
ID3D11Texture2D *
ID3D11DepthStencilView *
D3D_FEATURE_LEVEL
ID3D11PixelShader *
ID3D11VertexShader *
DXGI_SAMPLE_DESC

Used to lookup sampler state for a given hash key.

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.

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

Creates a new empty shader which must be initialized and deleted by the caller.

Called by GFXDevice to create a device specific stateblock.

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)

State initialization.

To manage creating and re-creating of these when device is aquired.

To release all resources we control from D3DPOOL_DEFAULT.

Called by base GFXDevice to actually set a const buffer.

setStateBlockInternal(GFXStateBlock * block, bool force)

Called by GFXDevice to actually set a stateblock.

DXGI_SWAP_CHAIN_DESC

Device helper function.

Public Static Functions

createInstance(U32 adapterIndex)

Public Functions

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.

Called from GFXVertexFormat to allocate the hardware specific vertex declaration for rendering.

Reset.

clear(U32 flags, const LinearColorF & color, F32 z, U32 stencil)

Allocate a fence.

Returns a hardware occlusion query object or NULL if this device does not support them.

drawPrimitive(GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount)

Returns active graphics adapter type.

ID3D11Texture2D *
ID3D11DepthStencilView *
ID3D11Device *
ID3D11DeviceContext *
D3D_FEATURE_LEVEL

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 *

Initialize this GFXDevice, optionally specifying a platform window to bind to.

const char *
interpretDebugResult(long result)

This is called before this, or any other device, is deleted in the global destroy() method.

primCountToIndexCount(GFXPrimitiveType primType, U32 primitiveCount)
setShader(GFXShader * shader, bool force)

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.

Sets the current vertex declaration on the device.

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

Public Types

typedef Map< U32, ID3D11SamplerState * > SamplerMap 

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 
ID3D11Device * mD3DDevice 
ID3D11DeviceContext * mD3DDeviceContext 
bool mDebugLayers 
ID3D11Texture2D * mDeviceBackbuffer 
ID3D11RenderTargetView * mDeviceBackBufferView 
ID3D11Texture2D * mDeviceDepthStencil 
ID3D11DepthStencilView * mDeviceDepthStencilView 
U32 mDrawInstancesCount 
StrongRefPtr< GFXD3D11PrimitiveBuffer > mDynamicPB 
D3D_FEATURE_LEVEL mFeatureLevel 
GFXShaderRef mGenericShader [GS_COUNT]
GFXShaderConstBufferRef mGenericShaderBuffer [GS_COUNT]
ID3D11PixelShader * mLastPixShader 
ID3D11VertexShader * mLastVertShader 
GFXShaderConstHandle * mModelViewProjSC [GS_COUNT]
DXGI_SAMPLE_DESC mMultisampleDesc 
bool mOcclusionQuerySupported 
String mPixelShaderTarget 
F32 mPixVersion 
SamplerMap mSamplersMap 

Used to lookup sampler state for a given hash key.

String mShaderModel 
IDXGISwapChain * mSwapChain 
MatrixF mTempMatrix 

Temporary matrix, no assurances on value at all.

VertexDeclMap mVertexDecls 
String mVertexShaderTarget 
GFXD3D11VertexBuffer * mVolatileVB 

The stream 0 vertex buffer used for volatile VB offseting.

Vector< RPGDVB > mVolatileVBList 

Private Functions

allocRenderToTextureTarget(bool genMips)

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)

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.

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

beginReset()

Reset.

beginSceneInternal()

Reimplemented from: GFXDevice

clear(U32 flags, const LinearColorF & color, F32 z, U32 stencil)

Reimplemented from: GFXDevice

clearColorAttachment(const U32 attachment, const LinearColorF & color)

Reimplemented from: GFXDevice

copyResource(GFXTextureObject * pDst, GFXCubemap * pSrc, const U32 face)

Reimplemented from: GFXDevice

createCubemap()

Reimplemented from: GFXDevice

createCubemapArray()

Reimplemented from: GFXDevice

createFence()

Reimplemented from: GFXDevice

createOcclusionQuery()

Reimplemented from: GFXDevice

createTextureArray()

Reimplemented from: GFXDevice

doParanoidStateCheck()

Reimplemented from: GFXDevice

drawPrimitive(GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount)

Reimplemented from: GFXDevice

endReset(GFXD3D11WindowTarget * windowTarget)

endSceneInternal()

Reimplemented from: GFXDevice

getAdapterType()

Reimplemented from: GFXDevice

getAdaterIndex()

getBackBufferTexture()

getClipRect()

Reimplemented from: GFXDevice

getDepthStencilView()

getDevice()

getDeviceContext()

getFeatureLevel()

getFillConventionOffset()

Reimplemented from: GFXDevice

getMaxDynamicIndices()

Reimplemented from: GFXDevice

getMaxDynamicVerts()

Reimplemented from: GFXDevice

getMultisampleType()

getNumRenderTargets()

Reimplemented from: GFXDevice

getNumSamplers()

Reimplemented from: GFXDevice

getPixelShaderTarget()

getPixelShaderVersion()

Reimplemented from: GFXDevice

getRenderTargetView()

getSamplersMap()

getSamplersMap()

getShaderModel()

getVertexShaderTarget()

init(const GFXVideoMode & mode, PlatformWindow * window)

Reimplemented from: GFXDevice

interpretDebugResult(long result)

Reimplemented from: GFXDevice

preDestroy()

Reimplemented from: GFXDevice

primCountToIndexCount(GFXPrimitiveType primType, U32 primitiveCount)

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