Selaa lähdekoodia

pgraph: fix ShaderInput ordering for vector inputs with small floats

Fixes #827
rdb 6 vuotta sitten
vanhempi
sitoutus
fe1ecd5e79
1 muutettua tiedostoa jossa 13 lisäystä ja 1 poistoa
  1. 13 1
      panda/src/pgraph/shaderInput.I

+ 13 - 1
panda/src/pgraph/shaderInput.I

@@ -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;