st/mesa: Remove unneeded texture format terminators.
[mesa.git] / src / mesa / state_tracker / st_atom_pixeltransfer.c
index 081b6b3e233b60345d6d1ca27f50a37b1ba51fcd..95b706cb96c7ca1f42aea545097ef64b13d89c72 100644 (file)
@@ -69,7 +69,7 @@ struct state_key
 };
 
 static void
-make_state_key(GLcontext *ctx,  struct state_key *key)
+make_state_key(struct gl_context *ctx,  struct state_key *key)
 {
    memset(key, 0, sizeof(*key));
 
@@ -85,7 +85,7 @@ make_state_key(GLcontext *ctx,  struct state_key *key)
 
 
 static struct pipe_resource *
-create_color_map_texture(GLcontext *ctx)
+create_color_map_texture(struct gl_context *ctx)
 {
    struct st_context *st = st_context(ctx);
    struct pipe_context *pipe = st->pipe;
@@ -99,7 +99,7 @@ create_color_map_texture(GLcontext *ctx)
 
    /* create texture for color map/table */
    pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0,
-                          texSize, texSize, 1, PIPE_BIND_SAMPLER_VIEW);
+                          texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW);
    return pt;
 }
 
@@ -108,7 +108,7 @@ create_color_map_texture(GLcontext *ctx)
  * Update the pixelmap texture with the contents of the R/G/B/A pixel maps.
  */
 static void
-load_color_map_texture(GLcontext *ctx, struct pipe_resource *pt)
+load_color_map_texture(struct gl_context *ctx, struct pipe_resource *pt)
 {
    struct st_context *st = st_context(ctx);
    struct pipe_context *pipe = st->pipe;
@@ -121,9 +121,9 @@ load_color_map_texture(GLcontext *ctx, struct pipe_resource *pt)
    uint *dest;
    uint i, j;
 
-   transfer = pipe_get_transfer(st_context(ctx)->pipe,
-                                            pt, 0, 0, 0, PIPE_TRANSFER_WRITE,
-                                            0, 0, texSize, texSize);
+   transfer = pipe_get_transfer(pipe,
+                                pt, 0, 0, PIPE_TRANSFER_WRITE,
+                                0, 0, texSize, texSize);
    dest = (uint *) pipe_transfer_map(pipe, transfer);
 
    /* Pack four 1D maps into a 2D texture:
@@ -157,7 +157,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_resource *pt)
  * Returns a fragment program which implements the current pixel transfer ops.
  */
 static struct gl_fragment_program *
-get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key)
+get_pixel_transfer_program(struct gl_context *ctx, const struct state_key *key)
 {
    struct st_context *st = st_context(ctx);
    struct prog_instruction inst[MAX_INST];
@@ -187,7 +187,7 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key)
    inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
    ic++;
    fp->Base.InputsRead = (1 << FRAG_ATTRIB_TEX0);
-   fp->Base.OutputsWritten = (1 << FRAG_RESULT_COLOR);
+   fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
    fp->Base.SamplersUsed = 0x1;  /* sampler 0 (bit 0) is used */
 
    if (key->scaleAndBias) {
@@ -195,18 +195,8 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key)
          { STATE_INTERNAL, STATE_PT_SCALE, 0, 0, 0 };
       static const gl_state_index bias_state[STATE_LENGTH] =
          { STATE_INTERNAL, STATE_PT_BIAS, 0, 0, 0 };
-      GLfloat scale[4], bias[4];
       GLint scale_p, bias_p;
 
-      scale[0] = ctx->Pixel.RedScale;
-      scale[1] = ctx->Pixel.GreenScale;
-      scale[2] = ctx->Pixel.BlueScale;
-      scale[3] = ctx->Pixel.AlphaScale;
-      bias[0] = ctx->Pixel.RedBias;
-      bias[1] = ctx->Pixel.GreenBias;
-      bias[2] = ctx->Pixel.BlueBias;
-      bias[3] = ctx->Pixel.AlphaBias;
-
       scale_p = _mesa_add_state_reference(params, scale_state);
       bias_p = _mesa_add_state_reference(params, bias_state);
 
@@ -320,7 +310,7 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key)
 static void
 update_pixel_transfer(struct st_context *st)
 {
-   GLcontext *ctx = st->ctx;
+   struct gl_context *ctx = st->ctx;
    struct state_key key;
    struct gl_fragment_program *fp;