softpipe: some improvements to texture tile cache
[mesa.git] / src / gallium / drivers / softpipe / sp_quad_colormask.c
index 7fe080990bd05f215589fc5eebad6136f7eecd36..dc90e5d5e996bc91dfd04031e381b78e7c65dda1 100644 (file)
  */
 
 #include "pipe/p_defines.h"
-#include "pipe/p_util.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
 #include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
 #include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
 #include "sp_tile_cache.h"
 
 
@@ -50,19 +51,19 @@ colormask_quad(struct quad_stage *qs, struct quad_header *quad)
    uint cbuf;
 
    /* loop over colorbuffer outputs */
-   for (cbuf = 0; cbuf < softpipe->framebuffer.num_cbufs; cbuf++) {
+   for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
       float dest[4][QUAD_SIZE];
       struct softpipe_cached_tile *tile
          = sp_get_cached_tile(softpipe,
                               softpipe->cbuf_cache[cbuf],
-                              quad->x0, quad->y0);
-      float (*quadColor)[4] = quad->outputs.color[cbuf];
+                              quad->input.x0, quad->input.y0);
+      float (*quadColor)[4] = quad->output.color[cbuf];
       uint i, j;
 
       /* get/swizzle dest colors */
       for (j = 0; j < QUAD_SIZE; j++) {
-         int x = (quad->x0 & (TILE_SIZE-1)) + (j & 1);
-         int y = (quad->y0 & (TILE_SIZE-1)) + (j >> 1);
+         int x = (quad->input.x0 & (TILE_SIZE-1)) + (j & 1);
+         int y = (quad->input.y0 & (TILE_SIZE-1)) + (j >> 1);
          for (i = 0; i < 4; i++) {
             dest[i][j] = tile->data.color[y][x][i];
          }