change the behaviour of enter and local_addr instructions
authorMichal Krol <mjkrol@gmail.org>
Wed, 25 May 2005 13:20:59 +0000 (13:20 +0000)
committerMichal Krol <mjkrol@gmail.org>
Wed, 25 May 2005 13:20:59 +0000 (13:20 +0000)
src/mesa/shader/slang/slang_execute.c

index e2bdd246e376b1d88ffcc70825f229497576c9eb..9e82ef580bf7738937f58a8a607f4525af10ef7d 100644 (file)
@@ -116,10 +116,10 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
                fprintf (f, "addr_deref");\r
                break;\r
        case slang_asm_addr_add:\r
-               fprintf (f, "address_add");\r
+               fprintf (f, "addr_add");\r
                break;\r
        case slang_asm_addr_multiply:\r
-               fprintf (f, "address_multiply");\r
+               fprintf (f, "addr_multiply");\r
                break;\r
        case slang_asm_jump:\r
                fprintf (f, "jump\t%u", a->param[0]);\r
@@ -155,7 +155,7 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
                fprintf (f, "exit");\r
                break;\r
        default:\r
-          break;\r
+               break;\r
        }\r
 \r
        fprintf (f, "\n");\r
@@ -306,7 +306,7 @@ fflush (f);
                case slang_asm_enter:\r
                        mach.sp--;\r
                        mach.stack._addr[mach.sp] = mach.bp;\r
-                       mach.bp = mach.sp + a->param[0] / 4 + 1;\r
+                       mach.bp = mach.sp + a->param[0] / 4;\r
                        break;\r
                case slang_asm_leave:\r
                        mach.bp = mach.stack._addr[mach.sp];\r
@@ -321,7 +321,7 @@ fflush (f);
                case slang_asm_local_addr:\r
                        mach.sp--;\r
                        mach.stack._addr[mach.sp] = (GLuint) mach.stack._addr + mach.bp * 4 -\r
-                               (a->param[0] + a->param[1]);\r
+                               (a->param[0] + a->param[1]) + 4;\r
                        break;\r
                case slang_asm_call:\r
                        mach.sp--;\r