Replace the pixel shader UID generation algorithm with a better one which reduces the number of redundant shader compilations by around 30% (can be optimized even further though).

This should help some games which suffer from heavy stuttering like e.g. F-Zero GX or Red Steel 2.
This commit is contained in:
NeoBrainX 2011-08-31 03:18:19 +02:00
parent 08e06b2293
commit 7f01139d13
2 changed files with 1267 additions and 1097 deletions

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@
#define C_PLIGHTS (C_FOG + 3) #define C_PLIGHTS (C_FOG + 3)
#define C_PMATERIALS (C_PLIGHTS + 40) #define C_PMATERIALS (C_PLIGHTS + 40)
#define C_PENVCONST_END (C_PMATERIALS + 4) #define C_PENVCONST_END (C_PMATERIALS + 4)
#define PIXELSHADERUID_MAX_VALUES (5 + 32 + 6 + 11 + 2) #define PIXELSHADERUID_MAX_VALUES 67
// DO NOT make anything in this class virtual. // DO NOT make anything in this class virtual.
class PIXELSHADERUID class PIXELSHADERUID
@ -71,7 +71,7 @@ public:
int GetNumValues() const int GetNumValues() const
{ {
return tevstages + indstages + 4; return tevstages;
} }
bool operator <(const PIXELSHADERUID& _Right) const bool operator <(const PIXELSHADERUID& _Right) const