mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1430 from Azaezel/alpha41/GFXRedundancyCleanups
clean up (some) shader variation redundancies
This commit is contained in:
commit
f41cdaaa7e
|
|
@ -29,32 +29,12 @@ GFXImplementVertexFormat( GFXVertexP )
|
|||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPad )
|
||||
{
|
||||
addElement("PADDING", GFXDeclType_UByte4);
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPTTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 2 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPC )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
|
|
@ -75,20 +55,6 @@ GFXImplementVertexFormat( GFXVertexPCT )
|
|||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPCTT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "COLOR", GFXDeclType_Color );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
||||
addElement( "TEXCOORD", GFXDeclType_Float2, 1 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPN )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
addElement( "NORMAL", GFXDeclType_Float3 );
|
||||
}
|
||||
|
||||
GFXImplementVertexFormat( GFXVertexPNT )
|
||||
{
|
||||
addElement( "POSITION", GFXDeclType_Float3 );
|
||||
|
|
|
|||
|
|
@ -36,11 +36,6 @@
|
|||
#include "math/mPoint3.h"
|
||||
#endif
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPad )
|
||||
{
|
||||
U32 data;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexP )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -52,21 +47,6 @@ GFXDeclareVertexFormat( GFXVertexPT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPTT )
|
||||
{
|
||||
Point3F point;
|
||||
Point2F texCoord1;
|
||||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPTTT )
|
||||
{
|
||||
Point3F point;
|
||||
Point2F texCoord1;
|
||||
Point2F texCoord2;
|
||||
Point2F texCoord3;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPC )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -87,20 +67,6 @@ GFXDeclareVertexFormat( GFXVertexPCT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPCTT )
|
||||
{
|
||||
Point3F point;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord;
|
||||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPN )
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
};
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPNT )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -133,27 +99,6 @@ GFXDeclareVertexFormat( GFXVertexPNTBT )
|
|||
Point2F texCoord;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
DEFINE_VERT( GFXVertexPCNT,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagDiffuse | GFXVertexFlagTextureCount1 | GFXVertexFlagUV0)
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord;
|
||||
};
|
||||
|
||||
DEFINE_VERT( GFXVertexPCNTT,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagDiffuse | GFXVertexFlagTextureCount2 | GFXVertexFlagUV0 | GFXVertexFlagUV1)
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
GFXVertexColor color;
|
||||
Point2F texCoord[2];
|
||||
};
|
||||
*/
|
||||
|
||||
GFXDeclareVertexFormat( GFXVertexPNTTB )
|
||||
{
|
||||
Point3F point;
|
||||
|
|
@ -164,16 +109,4 @@ GFXDeclareVertexFormat( GFXVertexPNTTB )
|
|||
Point2F texCoord2;
|
||||
};
|
||||
|
||||
/*
|
||||
DEFINE_VERT( GFXVertexPNTB,
|
||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagTextureCount2 |
|
||||
GFXVertexFlagUV0 | GFXVertexFlagUVW1 )
|
||||
{
|
||||
Point3F point;
|
||||
Point3F normal;
|
||||
Point2F texCoord;
|
||||
Point3F binormal;
|
||||
};
|
||||
*/
|
||||
|
||||
#endif // _GFXVERTEXTYPES_H_
|
||||
|
|
|
|||
|
|
@ -459,18 +459,12 @@ GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, const G
|
|||
// Build a description string from the features
|
||||
// and vertex format combination ( and macros ).
|
||||
String shaderDescription = vertexFormat->getDescription() + features.getDescription();
|
||||
if ( macros && !macros->empty() )
|
||||
{
|
||||
String macroStr;
|
||||
GFXShaderMacro::stringize( *macros, ¯oStr );
|
||||
shaderDescription += macroStr;
|
||||
}
|
||||
|
||||
// Generate a single 64bit hash from the description string.
|
||||
//
|
||||
// Don't get paranoid! This has 1 in 18446744073709551616
|
||||
// chance for collision... it won't happen in this lifetime.
|
||||
//
|
||||
shaderDescription.replace("\n", " ");
|
||||
U64 hash = Torque::hash64( (const U8*)shaderDescription.c_str(), shaderDescription.length(), 0 );
|
||||
hash = convertHostToLEndian(hash);
|
||||
U32 high = (U32)( hash >> 32 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue