gallivm,llvmpipe,draw: Support multiple constant buffers.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_tile_image.c
index 7a2cc3e6b5e505d51775e922b8f08170a3d16985..3faf0181183d25c592e35d9af09dbf9b25066e33 100644 (file)
@@ -33,7 +33,8 @@
 
 
 #include "util/u_format.h"
-#include "lp_tile_soa.h"
+#include "util/u_memory.h"
+#include "lp_limits.h"
 #include "lp_tile_image.h"
 
 
@@ -188,25 +189,7 @@ lp_tiled_to_linear(const void *src, void *dst,
       }
    }
    else {
-      /* color image */
-      const uint bpp = 4;
-      const uint tile_w = TILE_SIZE, tile_h = TILE_SIZE;
-      const uint bytes_per_tile = tile_w * tile_h * bpp;
-      uint i, j;
-
-      for (j = 0; j < height; j += tile_h) {
-         for (i = 0; i < width; i += tile_w) {
-            uint ii = i + x, jj = j + y;
-            uint tile_offset = ((jj / tile_h) * tiles_per_row + ii / tile_w);
-            uint byte_offset = tile_offset * bytes_per_tile;
-            const uint8_t *src_tile = (uint8_t *) src + byte_offset;
-
-            lp_tile_write_4ub(format,
-                              src_tile,
-                              dst, dst_stride,
-                              ii, jj, tile_w, tile_h);
-         }
-      }
+      assert(0);
    }
 }
 
@@ -278,24 +261,7 @@ lp_linear_to_tiled(const void *src, void *dst,
       }
    }
    else {
-      const uint bpp = 4;
-      const uint tile_w = TILE_SIZE, tile_h = TILE_SIZE;
-      const uint bytes_per_tile = tile_w * tile_h * bpp;
-      uint i, j;
-
-      for (j = 0; j < height; j += TILE_SIZE) {
-         for (i = 0; i < width; i += TILE_SIZE) {
-            uint ii = i + x, jj = j + y;
-            uint tile_offset = ((jj / tile_h) * tiles_per_row + ii / tile_w);
-            uint byte_offset = tile_offset * bytes_per_tile;
-            uint8_t *dst_tile = (uint8_t *) dst + byte_offset;
-
-            lp_tile_read_4ub(format,
-                             dst_tile,
-                             src, src_stride,
-                             ii, jj, tile_w, tile_h);
-         }
-      }
+      assert(0);
    }
 }
 
@@ -313,7 +279,7 @@ test_tiled_linear_conversion(void *data,
    unsigned wt = (width + TILE_SIZE - 1) / TILE_SIZE;
    unsigned ht = (height + TILE_SIZE - 1) / TILE_SIZE;
 
-   uint8_t *tiled = malloc(wt * ht * TILE_SIZE * TILE_SIZE * 4);
+   uint8_t *tiled = MALLOC(wt * ht * TILE_SIZE * TILE_SIZE * 4);
 
    /*unsigned tiled_stride = wt * TILE_SIZE * TILE_SIZE * 4;*/
 
@@ -323,6 +289,6 @@ test_tiled_linear_conversion(void *data,
    lp_tiled_to_linear(tiled, data, 0, 0, width, height, format,
                       stride, wt);
 
-   free(tiled);
+   FREE(tiled);
 }