pgraph: fix ShaderInput ordering for vector inputs with small floats

Fixes #827
This commit is contained in:
rdb 2020-01-03 18:48:23 +01:00
parent 3367fe266f
commit fe1ecd5e79
1 changed files with 13 additions and 1 deletions

View File

@ -490,7 +490,19 @@ operator < (const ShaderInput &other) const {
return false;
case M_vector:
return _stored_vector < other._stored_vector;
if (_stored_vector[0] != other._stored_vector[0]) {
return (_stored_vector[0] < other._stored_vector[0]) ? -1 : 1;
}
if (_stored_vector[1] != other._stored_vector[1]) {
return (_stored_vector[1] < other._stored_vector[1]) ? -1 : 1;
}
if (_stored_vector[2] != other._stored_vector[2]) {
return (_stored_vector[2] < other._stored_vector[2]) ? -1 : 1;
}
if (_stored_vector[3] != other._stored_vector[3]) {
return (_stored_vector[3] < other._stored_vector[3]) ? -1 : 1;
}
return 0;
case M_numeric:
return _stored_ptr._ptr < other._stored_ptr._ptr;