mesa: add storageSamples parameter to renderbuffer functions
[mesa.git] / src / mesa / main / ffvertex_prog.c
index 6a022b83bdce48be492598fc31341f40e804eec3..dfb494bd8c186a4fdcbc82ff8c58d19cafd7918f 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 
+#include "main/errors.h"
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
@@ -235,7 +236,8 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
       | ctx->Texture._TexMatEnabled | ctx->Point.CoordReplace;
    while (mask) {
       const int i = u_bit_scan(&mask);
-      struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+      struct gl_fixedfunc_texture_unit *texUnit =
+         &ctx->Texture.FixedFuncUnit[i];
 
       if (ctx->Point.PointSprite)
         if (ctx->Point.CoordReplace & (1u << i))
@@ -412,7 +414,7 @@ static struct ureg register_param5(struct tnl_program *p,
                                   GLint s3,
                                    GLint s4)
 {
-   gl_state_index tokens[STATE_LENGTH];
+   gl_state_index16 tokens[STATE_LENGTH];
    GLint idx;
    tokens[0] = s0;
    tokens[1] = s1;
@@ -1295,12 +1297,14 @@ static void build_fog( struct tnl_program *p )
    struct ureg input;
 
    switch (p->state->fog_distance_mode) {
-   case FDM_EYE_RADIAL: /* Z = sqrt(Xe*Xe + Ye*Ye + Ze*Ze) */
+   case FDM_EYE_RADIAL: { /* Z = sqrt(Xe*Xe + Ye*Ye + Ze*Ze) */
+      struct ureg tmp = get_temp(p);
       input = get_eye_position(p);
-      emit_op2(p, OPCODE_DP3, fog, WRITEMASK_X, input, input);
-      emit_op1(p, OPCODE_RSQ, fog, WRITEMASK_X, fog);
-      emit_op1(p, OPCODE_RCP, fog, WRITEMASK_X, fog);
+      emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, input, input);
+      emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp);
+      emit_op1(p, OPCODE_RCP, fog, WRITEMASK_X, tmp);
       break;
+   }
    case FDM_EYE_PLANE: /* Z = Ze */
       input = get_eye_position_z(p);
       emit_op1(p, OPCODE_MOV, fog, WRITEMASK_X, input);