Removed old fixed function code from GFX.

This commit is contained in:
rextimmy 2021-01-05 12:57:17 +10:00
parent 58d2e30af7
commit 5a933c00d3
53 changed files with 98 additions and 1646 deletions

View file

@ -234,7 +234,7 @@ GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
mTextureManager = new GFXGLTextureManager();
gScreenShot = new ScreenShotGL();
for(U32 i = 0; i < TEXTURE_STAGE_COUNT; i++)
for(U32 i = 0; i < GFX_TEXTURE_STAGE_COUNT; i++)
mActiveTextureType[i] = GL_ZERO;
mNumVertexStream = 2;
@ -260,7 +260,7 @@ GFXGLDevice::~GFXGLDevice()
mVolatilePBs[i] = NULL;
// Clear out our current texture references
for (U32 i = 0; i < TEXTURE_STAGE_COUNT; i++)
for (U32 i = 0; i < GFX_TEXTURE_STAGE_COUNT; i++)
{
mCurrentTexture[i] = NULL;
mNewTexture[i] = NULL;
@ -711,21 +711,6 @@ void GFXGLDevice::setPB(GFXGLPrimitiveBuffer* pb)
mCurrentPB = pb;
}
void GFXGLDevice::setLightInternal(U32 lightStage, const GFXLightInfo light, bool lightEnable)
{
// ONLY NEEDED ON FFP
}
void GFXGLDevice::setLightMaterialInternal(const GFXLightMaterial mat)
{
// ONLY NEEDED ON FFP
}
void GFXGLDevice::setGlobalAmbientInternal(LinearColorF color)
{
// ONLY NEEDED ON FFP
}
void GFXGLDevice::setTextureInternal(U32 textureUnit, const GFXTextureObject*texture)
{
GFXGLTextureObject *tex = static_cast<GFXGLTextureObject*>(const_cast<GFXTextureObject*>(texture));
@ -791,11 +776,6 @@ void GFXGLDevice::setTextureArrayInternal(U32 textureUnit, const GFXGLTextureArr
}
}
void GFXGLDevice::setMatrix( GFXMatrixType mtype, const MatrixF &mat )
{
// ONLY NEEDED ON FFP
}
void GFXGLDevice::setClipRect( const RectI &inRect )
{
AssertFatal(mCurrentRT.isValid(), "GFXGLDevice::setClipRect - must have a render target set to do any rendering operations!");
@ -838,8 +818,6 @@ void GFXGLDevice::setClipRect( const RectI &inRect )
mProjectionMatrix *= translate;
setMatrix(GFXMatrixProjection, mProjectionMatrix);
MatrixF mTempMatrix(true);
setViewMatrix( mTempMatrix );
setWorldMatrix( mTempMatrix );
@ -985,7 +963,7 @@ void GFXGLDevice::setShaderConstBufferInternal(GFXShaderConstBuffer* buffer)
U32 GFXGLDevice::getNumSamplers() const
{
return getMin((U32)TEXTURE_STAGE_COUNT,mPixelShaderVersion > 0.001f ? mMaxShaderTextures : mMaxFFTextures);
return getMin((U32)GFX_TEXTURE_STAGE_COUNT,mPixelShaderVersion > 0.001f ? mMaxShaderTextures : mMaxFFTextures);
}
GFXTextureObject* GFXGLDevice::getDefaultDepthTex() const

View file

@ -140,8 +140,8 @@ public:
virtual void preDestroy() { Parent::preDestroy(); }
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; }
GFXFence *createFence();
@ -177,10 +177,6 @@ protected:
virtual void setCubemapArrayInternal(U32 textureUnit, const GFXGLCubemapArray* texture);
virtual void setTextureArrayInternal(U32 textureUnit, const GFXGLTextureArray* texture);
virtual void setLightInternal(U32 lightStage, const GFXLightInfo light, bool lightEnable);
virtual void setLightMaterialInternal(const GFXLightMaterial mat);
virtual void setGlobalAmbientInternal(LinearColorF color);
/// @name State Initalization.
/// @{
@ -188,8 +184,6 @@ protected:
/// is created.
virtual void initStates() { }
virtual void setMatrix( GFXMatrixType mtype, const MatrixF &mat );
virtual GFXVertexBuffer *allocVertexBuffer( U32 numVerts,
const GFXVertexFormat *vertexFormat,
U32 vertSize,
@ -255,7 +249,7 @@ private:
GFXGLStateBlockRef mCurrentGLStateBlock;
GLenum mActiveTextureType[TEXTURE_STAGE_COUNT];
GLenum mActiveTextureType[GFX_TEXTURE_STAGE_COUNT];
Vector< StrongRefPtr<GFXGLVertexBuffer> > mVolatileVBs; ///< Pool of existing volatile VBs so we can reuse previously created ones
Vector< StrongRefPtr<GFXGLPrimitiveBuffer> > mVolatilePBs; ///< Pool of existing volatile PBs so we can reuse previously created ones

View file

@ -26,7 +26,6 @@
GLenum GFXGLPrimType[GFXPT_COUNT];
GLenum GFXGLBlend[GFXBlend_COUNT];
GLenum GFXGLBlendOp[GFXBlendOp_COUNT];
GLenum GFXGLSamplerState[GFXSAMP_COUNT];
GLenum GFXGLTextureFilter[GFXTextureFilter_COUNT];
GLenum GFXGLTextureAddress[GFXAddress_COUNT];
GLenum GFXGLCmpFunc[GFXCmp_COUNT];
@ -75,14 +74,7 @@ void GFXGLEnumTranslate::init()
GFXGLBlendOp[GFXBlendOpMin] = GL_MIN;
GFXGLBlendOp[GFXBlendOpMax] = GL_MAX;
// Sampler
GFXGLSamplerState[GFXSAMPMagFilter] = GL_TEXTURE_MAG_FILTER;
GFXGLSamplerState[GFXSAMPMinFilter] = GL_TEXTURE_MIN_FILTER;
GFXGLSamplerState[GFXSAMPAddressU] = GL_TEXTURE_WRAP_S;
GFXGLSamplerState[GFXSAMPAddressV] = GL_TEXTURE_WRAP_T;
GFXGLSamplerState[GFXSAMPAddressW] = GL_TEXTURE_WRAP_R;
GFXGLSamplerState[GFXSAMPMipMapLODBias] = GL_TEXTURE_LOD_BIAS;
// Comparison
GFXGLCmpFunc[GFXCmpNever] = GL_NEVER;
GFXGLCmpFunc[GFXCmpLess] = GL_LESS;
@ -96,10 +88,7 @@ void GFXGLEnumTranslate::init()
GFXGLTextureFilter[GFXTextureFilterNone] = GL_NEAREST;
GFXGLTextureFilter[GFXTextureFilterPoint] = GL_NEAREST;
GFXGLTextureFilter[GFXTextureFilterLinear] = GL_LINEAR;
GFXGLTextureFilter[GFXTextureFilterAnisotropic] = GL_LINEAR;
GFXGLTextureFilter[GFXTextureFilterPyramidalQuad] = GL_LINEAR;
GFXGLTextureFilter[GFXTextureFilterGaussianQuad] = GL_LINEAR;
GFXGLTextureAddress[GFXAddressWrap] = GL_REPEAT;
GFXGLTextureAddress[GFXAddressMirror] = GL_REPEAT;
@ -116,8 +105,7 @@ void GFXGLEnumTranslate::init()
GFXGLStencilOp[GFXStencilOpInvert] = GL_INVERT;
GFXGLStencilOp[GFXStencilOpIncr] = GL_INCR_WRAP;
GFXGLStencilOp[GFXStencilOpDecr] = GL_DECR_WRAP;
GFXGLStencilOp[GFXStencilOpDecr] = GL_DECR_WRAP;
// Texture formats
for(int i = 0; i < GFXFormat_COUNT; ++i)

View file

@ -34,7 +34,6 @@ namespace GFXGLEnumTranslate
extern GLenum GFXGLPrimType[GFXPT_COUNT];
extern GLenum GFXGLBlend[GFXBlend_COUNT];
extern GLenum GFXGLBlendOp[GFXBlendOp_COUNT];
extern GLenum GFXGLSamplerState[GFXSAMP_COUNT];
extern GLenum GFXGLTextureFilter[GFXTextureFilter_COUNT];
extern GLenum GFXGLTextureAddress[GFXAddress_COUNT];
extern GLenum GFXGLCmpFunc[GFXCmp_COUNT];

View file

@ -41,7 +41,7 @@ GFXGLStateBlock::GFXGLStateBlock(const GFXStateBlockDesc& desc) :
{
static Map<GFXSamplerStateDesc, U32> mSamplersMap;
for(int i = 0; i < TEXTURE_STAGE_COUNT; ++i)
for(int i = 0; i < GFX_TEXTURE_STAGE_COUNT; ++i)
{
GLuint &id = mSamplerObjects[i];
GFXSamplerStateDesc &ssd = mDesc.samplers[i];
@ -172,7 +172,7 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
#undef CHECK_TOGGLE_STATE
//sampler objects
for (U32 i = 0; i < getMin(getOwningDevice()->getNumSamplers(), (U32) TEXTURE_STAGE_COUNT); i++)
for (U32 i = 0; i < getMin(getOwningDevice()->getNumSamplers(), (U32) GFX_TEXTURE_STAGE_COUNT); i++)
{
if(!oldState || oldState->mSamplerObjects[i] != mSamplerObjects[i])
glBindSampler(i, mSamplerObjects[i] );

View file

@ -63,7 +63,7 @@ public:
private:
GFXStateBlockDesc mDesc;
U32 mCachedHashValue;
U32 mSamplerObjects[TEXTURE_STAGE_COUNT];
U32 mSamplerObjects[GFX_TEXTURE_STAGE_COUNT];
};
typedef StrongRefPtr<GFXGLStateBlock> GFXGLStateBlockRef;

View file

@ -141,7 +141,7 @@ public:
protected:
GLuint mActiveTexture, mBindedVBO, mBindedIBO, mBindedFBO_W, mBindedFBO_R;
TextureUnit mTextureUnits[TEXTURE_STAGE_COUNT];
TextureUnit mTextureUnits[GFX_TEXTURE_STAGE_COUNT];
U32 mVertexAttribActive;
};