fix stores to vertex state program registers
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 4 Feb 2004 15:44:53 +0000 (15:44 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 4 Feb 2004 15:44:53 +0000 (15:44 +0000)
src/mesa/main/nvvertexec.c
src/mesa/main/nvvertparse.c

index fd1519e9a87681f3520658612069500acdc1d649..9663b38157df1de60c754b704fc925cf69bcea98 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.0
+ * Version:  6.0.1
  *
  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
@@ -326,8 +326,16 @@ store_vector4( const struct vp_dst_register *dest,
       case PROGRAM_OUTPUT:
          dst = state->Outputs[dest->Index];
          break;
+      case PROGRAM_ENV_PARAM:
+         {
+            /* a slight hack */
+            GET_CURRENT_CONTEXT(ctx);
+            dst = ctx->VertexProgram.Parameters[dest->Index];
+         }
+         break;
       default:
-         _mesa_problem(NULL, "Invalid register file in fetch_vector1(vp)");
+         _mesa_problem(NULL, "Invalid register file in store_vector4(file=%d)",
+                       dest->File);
          return;
    }
 
index 15451adc71f149b267ad1875847ce8a0aed62698..bacf5a5af3ba90d443fbfbf350adfec5ab2e4e37 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.0.1
  *
- * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -578,8 +578,10 @@ Parse_MaskedDstReg(struct parse_state *parseState, struct vp_dst_register *dstRe
       if (!Parse_OutputReg(parseState, &dstReg->Index))
          RETURN_ERROR;
    }
-   else if (parseState->isStateProgram && token[0] == 'c') {
+   else if (parseState->isStateProgram && token[0] == 'c' &&
+            parseState->isStateProgram) {
       /* absolute program parameter register */
+      /* Only valid for vertex state programs */
       dstReg->File = PROGRAM_ENV_PARAM;
       if (!Parse_AbsParamReg(parseState, &dstReg->Index))
          RETURN_ERROR;