mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Removed old fixed function code from GFX.
This commit is contained in:
parent
58d2e30af7
commit
5a933c00d3
53 changed files with 98 additions and 1646 deletions
|
|
@ -961,7 +961,7 @@ void GFXD3D11Device::reacquireDefaultPoolResources()
|
|||
mDynamicPB = new GFXD3D11PrimitiveBuffer(this, 0, 0, GFXBufferTypeDynamic);
|
||||
|
||||
D3D11_BUFFER_DESC desc;
|
||||
desc.ByteWidth = sizeof(U16) * MAX_DYNAMIC_INDICES;
|
||||
desc.ByteWidth = sizeof(U16) * GFX_MAX_DYNAMIC_INDICES;
|
||||
desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
|
@ -1019,7 +1019,7 @@ GFXD3D11VertexBuffer * GFXD3D11Device::createVBPool( const GFXVertexFormat *vert
|
|||
vertexFormat->getDecl();
|
||||
|
||||
D3D11_BUFFER_DESC desc;
|
||||
desc.ByteWidth = vertSize * MAX_DYNAMIC_VERTS;
|
||||
desc.ByteWidth = vertSize * GFX_MAX_DYNAMIC_VERTS;
|
||||
desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
|
@ -1283,7 +1283,7 @@ GFXPrimitiveBuffer * GFXD3D11Device::allocPrimitiveBuffer(U32 numIndices, U32 nu
|
|||
if(bufferType == GFXBufferTypeVolatile)
|
||||
{
|
||||
// Get it from the pool if it's a volatile...
|
||||
AssertFatal(numIndices < MAX_DYNAMIC_INDICES, "Cannot allocate that many indices in a volatile buffer, increase MAX_DYNAMIC_INDICES.");
|
||||
AssertFatal(numIndices < GFX_MAX_DYNAMIC_INDICES, "Cannot allocate that many indices in a volatile buffer, increase GFX_MAX_DYNAMIC_INDICES.");
|
||||
|
||||
res->ib = mDynamicPB->ib;
|
||||
res->mVolatileBuffer = mDynamicPB;
|
||||
|
|
@ -1362,7 +1362,7 @@ GFXVertexBuffer * GFXD3D11Device::allocVertexBuffer(U32 numVerts, const GFXVerte
|
|||
if(bufferType == GFXBufferTypeVolatile)
|
||||
{
|
||||
// NOTE: Volatile VBs are pooled and will be allocated at lock time.
|
||||
AssertFatal(numVerts <= MAX_DYNAMIC_VERTS, "GFXD3D11Device::allocVertexBuffer - Volatile vertex buffer is too big... see MAX_DYNAMIC_VERTS!");
|
||||
AssertFatal(numVerts <= GFX_MAX_DYNAMIC_VERTS, "GFXD3D11Device::allocVertexBuffer - Volatile vertex buffer is too big... see GFX_MAX_DYNAMIC_VERTS!");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -176,11 +176,6 @@ protected:
|
|||
/// Called by base GFXDevice to actually set a const buffer
|
||||
virtual void setShaderConstBufferInternal(GFXShaderConstBuffer* buffer);
|
||||
|
||||
virtual void setMatrix( GFXMatrixType /*mtype*/, const MatrixF &/*mat*/ ) { };
|
||||
virtual void setLightInternal(U32 /*lightStage*/, const GFXLightInfo /*light*/, bool /*lightEnable*/) { };
|
||||
virtual void setLightMaterialInternal(const GFXLightMaterial /*mat*/) { };
|
||||
virtual void setGlobalAmbientInternal(LinearColorF /*color*/) { };
|
||||
|
||||
// }
|
||||
|
||||
// Index buffer management
|
||||
|
|
@ -286,8 +281,8 @@ public:
|
|||
virtual void setVertexStreamFrequency( U32 stream, U32 frequency );
|
||||
// }
|
||||
|
||||
virtual U32 getMaxDynamicVerts() { return MAX_DYNAMIC_VERTS; }
|
||||
virtual U32 getMaxDynamicIndices() { return MAX_DYNAMIC_INDICES; }
|
||||
virtual U32 getMaxDynamicVerts() { return GFX_MAX_DYNAMIC_VERTS; }
|
||||
virtual U32 getMaxDynamicIndices() { return GFX_MAX_DYNAMIC_INDICES; }
|
||||
|
||||
inline U32 primCountToIndexCount(GFXPrimitiveType primType, U32 primitiveCount);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ void GFXD3D11EnumTranslate::init()
|
|||
GFXD3D11TextureFilter[GFXTextureFilterPoint] = D3D11_FILTER_MIN_MAG_MIP_POINT;
|
||||
GFXD3D11TextureFilter[GFXTextureFilterLinear] = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
|
||||
GFXD3D11TextureFilter[GFXTextureFilterAnisotropic] = D3D11_FILTER_ANISOTROPIC;
|
||||
GFXD3D11TextureFilter[GFXTextureFilterPyramidalQuad] = D3D11_FILTER_ANISOTROPIC;
|
||||
GFXD3D11TextureFilter[GFXTextureFilterGaussianQuad] = D3D11_FILTER_ANISOTROPIC;
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
GFXD3D11Blend[GFXBlendZero] = D3D11_BLEND_ZERO;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void GFXD3D11PrimitiveBuffer::lock(U32 indexStart, U32 indexEnd, void **indexPtr
|
|||
case GFXBufferTypeVolatile:
|
||||
// Get our range now...
|
||||
AssertFatal(indexStart == 0, "Cannot get a subrange on a volatile buffer.");
|
||||
AssertFatal(indexEnd < MAX_DYNAMIC_INDICES, "Cannot get more than MAX_DYNAMIC_INDICES in a volatile buffer. Up the constant!");
|
||||
AssertFatal(indexEnd < GFX_MAX_DYNAMIC_INDICES, "Cannot get more than GFX_MAX_DYNAMIC_INDICES in a volatile buffer. Up the constant!");
|
||||
|
||||
// Get the primtive buffer
|
||||
mVolatileBuffer = D3D11->mDynamicPB;
|
||||
|
|
@ -56,7 +56,7 @@ void GFXD3D11PrimitiveBuffer::lock(U32 indexStart, U32 indexEnd, void **indexPtr
|
|||
AssertFatal( mVolatileBuffer, "GFXD3D11PrimitiveBuffer::lock - No dynamic primitive buffer was available!");
|
||||
|
||||
// We created the pool when we requested this volatile buffer, so assume it exists...
|
||||
if(mVolatileBuffer->mIndexCount + indexEnd > MAX_DYNAMIC_INDICES)
|
||||
if(mVolatileBuffer->mIndexCount + indexEnd > GFX_MAX_DYNAMIC_INDICES)
|
||||
{
|
||||
flags = D3D11_MAP_WRITE_DISCARD;
|
||||
mVolatileStart = indexStart = 0;
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@ private:
|
|||
D3D11_BLEND_DESC mBlendDesc;
|
||||
D3D11_RASTERIZER_DESC mRasterizerDesc;
|
||||
D3D11_DEPTH_STENCIL_DESC mDepthStencilDesc;
|
||||
D3D11_SAMPLER_DESC mSamplerDesc[TEXTURE_STAGE_COUNT];
|
||||
D3D11_SAMPLER_DESC mSamplerDesc[GFX_TEXTURE_STAGE_COUNT];
|
||||
|
||||
ID3D11BlendState* mBlendState;
|
||||
ID3D11DepthStencilState* mDepthStencilState;
|
||||
ID3D11RasterizerState* mRasterizerState;
|
||||
ID3D11SamplerState* mSamplerStates[TEXTURE_STAGE_COUNT];
|
||||
ID3D11SamplerState* mSamplerStates[GFX_TEXTURE_STAGE_COUNT];
|
||||
|
||||
GFXStateBlockDesc mDesc;
|
||||
U32 mCachedHashValue;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ protected:
|
|||
bool _freeTexture(GFXTextureObject *texture, bool zombify = false);
|
||||
|
||||
private:
|
||||
U32 mCurTexSet[TEXTURE_STAGE_COUNT];
|
||||
U32 mCurTexSet[GFX_TEXTURE_STAGE_COUNT];
|
||||
|
||||
void _innerCreateTexture(GFXD3D11TextureObject *obj, U32 height, U32 width, U32 depth, GFXFormat format, GFXTextureProfile *profile, U32 numMipLevels, bool forceMips = false, S32 antialiasLevel = 0);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ void GFXD3D11VertexBuffer::lock(U32 vertexStart, U32 vertexEnd, void **vertexPtr
|
|||
|
||||
// Get our range now...
|
||||
AssertFatal(vertexStart == 0, "Cannot get a subrange on a volatile buffer.");
|
||||
AssertFatal(vertexEnd <= MAX_DYNAMIC_VERTS, "Cannot get more than MAX_DYNAMIC_VERTS in a volatile buffer. Up the constant!");
|
||||
AssertFatal(vertexEnd <= GFX_MAX_DYNAMIC_VERTS, "Cannot get more than GFX_MAX_DYNAMIC_VERTS in a volatile buffer. Up the constant!");
|
||||
AssertFatal(mVolatileBuffer->lockedVertexStart == 0 && mVolatileBuffer->lockedVertexEnd == 0, "Got more than one lock on the volatile pool.");
|
||||
|
||||
// We created the pool when we requested this volatile buffer, so assume it exists...
|
||||
if( mVolatileBuffer->mNumVerts + vertexEnd > MAX_DYNAMIC_VERTS )
|
||||
if( mVolatileBuffer->mNumVerts + vertexEnd > GFX_MAX_DYNAMIC_VERTS )
|
||||
{
|
||||
flags = D3D11_MAP_WRITE_DISCARD;
|
||||
mVolatileStart = vertexStart = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue