Put preshader opcode switch in numeric order. Makes missing values obvious.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 30 May 2011 19:34:03 -0400
changeset 1031 e6be730725d7
parent 1030 a407c516e325
child 1032 464f38a2fb70
Put preshader opcode switch in numeric order. Makes missing values obvious.
mojoshader.c
--- a/mojoshader.c	Mon May 30 16:41:22 2011 -0400
+++ b/mojoshader.c	Mon May 30 19:34:03 2011 -0400
@@ -7261,27 +7261,27 @@
         switch ((opcodetok >> 16) & 0xFFFF)
         {
             case 0x1000: opcode = MOJOSHADER_PRESHADEROP_MOV; break;
-            case 0x3000: opcode = MOJOSHADER_PRESHADEROP_CMP; break;
-            case 0x5000: opcode = MOJOSHADER_PRESHADEROP_DOT; break;
-            case 0xD000: opcode = MOJOSHADER_PRESHADEROP_DOT_SCALAR; break;
             case 0x1010: opcode = MOJOSHADER_PRESHADEROP_NEG; break;
-            case 0x2010: opcode = MOJOSHADER_PRESHADEROP_MAX; break;
-            case 0xA010: opcode = MOJOSHADER_PRESHADEROP_MAX_SCALAR; break;
-            case 0x2020: opcode = MOJOSHADER_PRESHADEROP_CMPLT; break;
-            case 0xA020: opcode = MOJOSHADER_PRESHADEROP_CMPLT_SCALAR; break;
-            case 0x2030: opcode = MOJOSHADER_PRESHADEROP_CMPGE; break;
-            case 0xA030: opcode = MOJOSHADER_PRESHADEROP_CMPGE_SCALAR; break;
             case 0x1030: opcode = MOJOSHADER_PRESHADEROP_RCP; break;
             case 0x1040: opcode = MOJOSHADER_PRESHADEROP_FRC; break;
             case 0x1050: opcode = MOJOSHADER_PRESHADEROP_EXP; break;
-            case 0x2040: opcode = MOJOSHADER_PRESHADEROP_ADD; break;
-            case 0xA040: opcode = MOJOSHADER_PRESHADEROP_ADD_SCALAR; break;
-            case 0x2050: opcode = MOJOSHADER_PRESHADEROP_MUL; break;
-            case 0xA050: opcode = MOJOSHADER_PRESHADEROP_MUL_SCALAR; break;
             case 0x1060: opcode = MOJOSHADER_PRESHADEROP_LOG; break;
             case 0x1070: opcode = MOJOSHADER_PRESHADEROP_RSQ; break;
             case 0x1080: opcode = MOJOSHADER_PRESHADEROP_SIN; break;
             case 0x1090: opcode = MOJOSHADER_PRESHADEROP_COS; break;
+            case 0x2010: opcode = MOJOSHADER_PRESHADEROP_MAX; break;
+            case 0x2020: opcode = MOJOSHADER_PRESHADEROP_CMPLT; break;
+            case 0x2030: opcode = MOJOSHADER_PRESHADEROP_CMPGE; break;
+            case 0x2040: opcode = MOJOSHADER_PRESHADEROP_ADD; break;
+            case 0x2050: opcode = MOJOSHADER_PRESHADEROP_MUL; break;
+            case 0x3000: opcode = MOJOSHADER_PRESHADEROP_CMP; break;
+            case 0x5000: opcode = MOJOSHADER_PRESHADEROP_DOT; break;
+            case 0xA010: opcode = MOJOSHADER_PRESHADEROP_MAX_SCALAR; break;
+            case 0xA020: opcode = MOJOSHADER_PRESHADEROP_CMPLT_SCALAR; break;
+            case 0xA030: opcode = MOJOSHADER_PRESHADEROP_CMPGE_SCALAR; break;
+            case 0xA040: opcode = MOJOSHADER_PRESHADEROP_ADD_SCALAR; break;
+            case 0xA050: opcode = MOJOSHADER_PRESHADEROP_MUL_SCALAR; break;
+            case 0xD000: opcode = MOJOSHADER_PRESHADEROP_DOT_SCALAR; break;
             default: fail(ctx, "Unknown preshader opcode."); break;
         } // switch