mojoshader.c
branchtrunk
changeset 186 1658e8ce74ac
parent 185 ea719ad60d81
child 187 1c709f65cf1b
--- a/mojoshader.c	Tue Apr 22 05:36:03 2008 -0400
+++ b/mojoshader.c	Tue Apr 22 06:07:36 2008 -0400
@@ -3524,6 +3524,9 @@
 {
     const RegisterType regtype = ctx->dest_arg.regtype;
     const int regnum = ctx->dest_arg.regnum;
+
+    ctx->instruction_count--;  // these don't increase your instruction count.
+
     switch (regtype)
     {
         case REG_TYPE_CONST:
@@ -3542,6 +3545,9 @@
 {
     const RegisterType regtype = ctx->dest_arg.regtype;
     const int regnum = ctx->dest_arg.regnum;
+
+    ctx->instruction_count--;  // these don't increase your instruction count.
+
     if (regtype != REG_TYPE_CONSTINT)
         fail(ctx, "DEFI token using invalid register");
     else
@@ -3552,6 +3558,9 @@
 {
     const RegisterType regtype = ctx->dest_arg.regtype;
     const int regnum = ctx->dest_arg.regnum;
+
+    ctx->instruction_count--;  // these don't increase your instruction count.
+
     if (regtype != REG_TYPE_CONSTBOOL)
         fail(ctx, "DEFB token using invalid register");
     else
@@ -3564,6 +3573,8 @@
     const RegisterType regtype = arg->regtype;
     const int regnum = arg->regnum;
 
+    ctx->instruction_count--;  // these don't increase your instruction count.
+
     // parse_args_DCL() does a lot of state checking before we get here.
 
     // !!! FIXME: fail if DCL opcode comes after real instructions.