mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-13 03:29:11 +00:00
Optimize shader uid checks by checking the number of uid values which are actually used.
This commit is contained in:
parent
16ada5fa3d
commit
bdc28106ee
5 changed files with 44 additions and 29 deletions
|
@ -100,7 +100,7 @@ public:
|
|||
bool operator < (const ShaderUid& obj) const
|
||||
{
|
||||
// TODO: Store last frame used and order by that? makes much more sense anyway...
|
||||
for (unsigned int i = 0; i < sizeof(uid_data) / sizeof(u32); ++i)
|
||||
for (unsigned int i = 0; i < data.NumValues(); ++i)
|
||||
{
|
||||
if (this->values[i] < obj.values[i])
|
||||
return true;
|
||||
|
@ -212,6 +212,8 @@ struct LightingUidData
|
|||
u32 diffusefunc : 8; // 4x2 bits
|
||||
u32 attnfunc : 8; // 4x2 bits
|
||||
u32 light_mask : 32; // 4x8 bits
|
||||
|
||||
u32 NumValues() const { return sizeof(LightingUidData) / sizeof(u32); }
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue