VideoCommon: use memcmp to compare shader uid
This commit is contained in:
parent
3b0b5155e8
commit
3fcdf5e25b
|
@ -88,26 +88,18 @@ public:
|
|||
|
||||
bool operator == (const ShaderUid& obj) const
|
||||
{
|
||||
return memcmp(this->values, obj.values, sizeof(values)) == 0;
|
||||
return memcmp(this->values, obj.values, data.NumValues() * sizeof(*values)) == 0;
|
||||
}
|
||||
|
||||
bool operator != (const ShaderUid& obj) const
|
||||
{
|
||||
return memcmp(this->values, obj.values, sizeof(values)) != 0;
|
||||
return memcmp(this->values, obj.values, data.NumValues() * sizeof(*values)) != 0;
|
||||
}
|
||||
|
||||
// determines the storage order inside STL containers
|
||||
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 < data.NumValues(); ++i)
|
||||
{
|
||||
if (this->values[i] < obj.values[i])
|
||||
return true;
|
||||
else if (this->values[i] > obj.values[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return memcmp(this->values, obj.values, data.NumValues() * sizeof(*values)) < 0;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
Loading…
Reference in New Issue