mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
clean up (some) shader variation redundencies
don't need to use macros for the shader textfile hashkeys several no longer used GFXVertexFormats removed
This commit is contained in:
parent
85c7a68f46
commit
d82e8dbec4
3 changed files with 1 additions and 108 deletions
|
|
@ -29,32 +29,12 @@ GFXImplementVertexFormat( GFXVertexP )
|
||||||
addElement( "POSITION", GFXDeclType_Float3 );
|
addElement( "POSITION", GFXDeclType_Float3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
GFXImplementVertexFormat( GFXVertexPad )
|
|
||||||
{
|
|
||||||
addElement("PADDING", GFXDeclType_UByte4);
|
|
||||||
}
|
|
||||||
|
|
||||||
GFXImplementVertexFormat( GFXVertexPT )
|
GFXImplementVertexFormat( GFXVertexPT )
|
||||||
{
|
{
|
||||||
addElement( "POSITION", GFXDeclType_Float3 );
|
addElement( "POSITION", GFXDeclType_Float3 );
|
||||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
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 )
|
GFXImplementVertexFormat( GFXVertexPC )
|
||||||
{
|
{
|
||||||
addElement( "POSITION", GFXDeclType_Float3 );
|
addElement( "POSITION", GFXDeclType_Float3 );
|
||||||
|
|
@ -75,20 +55,6 @@ GFXImplementVertexFormat( GFXVertexPCT )
|
||||||
addElement( "TEXCOORD", GFXDeclType_Float2, 0 );
|
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 )
|
GFXImplementVertexFormat( GFXVertexPNT )
|
||||||
{
|
{
|
||||||
addElement( "POSITION", GFXDeclType_Float3 );
|
addElement( "POSITION", GFXDeclType_Float3 );
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,6 @@
|
||||||
#include "math/mPoint3.h"
|
#include "math/mPoint3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPad )
|
|
||||||
{
|
|
||||||
U32 data;
|
|
||||||
};
|
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexP )
|
GFXDeclareVertexFormat( GFXVertexP )
|
||||||
{
|
{
|
||||||
Point3F point;
|
Point3F point;
|
||||||
|
|
@ -52,21 +47,6 @@ GFXDeclareVertexFormat( GFXVertexPT )
|
||||||
Point2F texCoord;
|
Point2F texCoord;
|
||||||
};
|
};
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPTT )
|
|
||||||
{
|
|
||||||
Point3F point;
|
|
||||||
Point2F texCoord1;
|
|
||||||
Point2F texCoord2;
|
|
||||||
};
|
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPTTT )
|
|
||||||
{
|
|
||||||
Point3F point;
|
|
||||||
Point2F texCoord1;
|
|
||||||
Point2F texCoord2;
|
|
||||||
Point2F texCoord3;
|
|
||||||
};
|
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPC )
|
GFXDeclareVertexFormat( GFXVertexPC )
|
||||||
{
|
{
|
||||||
Point3F point;
|
Point3F point;
|
||||||
|
|
@ -87,20 +67,6 @@ GFXDeclareVertexFormat( GFXVertexPCT )
|
||||||
Point2F texCoord;
|
Point2F texCoord;
|
||||||
};
|
};
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPCTT )
|
|
||||||
{
|
|
||||||
Point3F point;
|
|
||||||
GFXVertexColor color;
|
|
||||||
Point2F texCoord;
|
|
||||||
Point2F texCoord2;
|
|
||||||
};
|
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPN )
|
|
||||||
{
|
|
||||||
Point3F point;
|
|
||||||
Point3F normal;
|
|
||||||
};
|
|
||||||
|
|
||||||
GFXDeclareVertexFormat( GFXVertexPNT )
|
GFXDeclareVertexFormat( GFXVertexPNT )
|
||||||
{
|
{
|
||||||
Point3F point;
|
Point3F point;
|
||||||
|
|
@ -133,27 +99,6 @@ GFXDeclareVertexFormat( GFXVertexPNTBT )
|
||||||
Point2F texCoord;
|
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 )
|
GFXDeclareVertexFormat( GFXVertexPNTTB )
|
||||||
{
|
{
|
||||||
Point3F point;
|
Point3F point;
|
||||||
|
|
@ -164,16 +109,4 @@ GFXDeclareVertexFormat( GFXVertexPNTTB )
|
||||||
Point2F texCoord2;
|
Point2F texCoord2;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
DEFINE_VERT( GFXVertexPNTB,
|
|
||||||
GFXVertexFlagXYZ | GFXVertexFlagNormal | GFXVertexFlagTextureCount2 |
|
|
||||||
GFXVertexFlagUV0 | GFXVertexFlagUVW1 )
|
|
||||||
{
|
|
||||||
Point3F point;
|
|
||||||
Point3F normal;
|
|
||||||
Point2F texCoord;
|
|
||||||
Point3F binormal;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif // _GFXVERTEXTYPES_H_
|
#endif // _GFXVERTEXTYPES_H_
|
||||||
|
|
|
||||||
|
|
@ -459,18 +459,12 @@ GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, const G
|
||||||
// Build a description string from the features
|
// Build a description string from the features
|
||||||
// and vertex format combination ( and macros ).
|
// and vertex format combination ( and macros ).
|
||||||
String shaderDescription = vertexFormat->getDescription() + features.getDescription();
|
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.
|
// Generate a single 64bit hash from the description string.
|
||||||
//
|
//
|
||||||
// Don't get paranoid! This has 1 in 18446744073709551616
|
// Don't get paranoid! This has 1 in 18446744073709551616
|
||||||
// chance for collision... it won't happen in this lifetime.
|
// 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 );
|
U64 hash = Torque::hash64( (const U8*)shaderDescription.c_str(), shaderDescription.length(), 0 );
|
||||||
hash = convertHostToLEndian(hash);
|
hash = convertHostToLEndian(hash);
|
||||||
U32 high = (U32)( hash >> 32 );
|
U32 high = (U32)( hash >> 32 );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue