Commit f1ae3c4a authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Continue probing at swizzle algorithm

parent d4b61e28
......@@ -62,6 +62,9 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
{
int block_pitch = ALIGN(width, 16) >> 4;
/* Calculate maximum size, overestimating a bit */
uint32_t sz = bytes_per_pixel * 256 * ((height >> 4) + 1) * block_pitch;
for (int y = 0; y < height; ++y) {
int block_y = y >> 4;
int rem_y = y & 0x0F;
......@@ -81,3 +84,28 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
}
}
}
#if 1
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#define TW 800
#define TH 600
void main() {
trans_generate_space_filler_indices();
uint8_t in[TW*TH*4];
for(int i = 0; i < TW*TH*4; ++i) in[i] = i;
uint8_t *out = malloc(TW*TH*4*2);
for (int i = 0; i < 64; ++i) {
trans_texture_swizzle(TW, TH, 4, TW*4, (uint8_t *) in, (uint8_t *) out);
}
uint8_t *reference = malloc(TW*TH*4*2);
trans_texture_swizzle(TW, TH, 4, TW*4, (uint8_t *) in, (uint8_t *) reference);
if(memcmp(reference, out, 40)) printf("XXX\n");
}
#endif
......@@ -155,7 +155,7 @@ int main(int argc, const char **argv)
0, 2,
texs);
for (int i = 0; i < 600; ++i) {
for (int i = 0; i < 60; ++i) {
const struct pipe_rasterizer_state stat = {
.line_width = 10.0f,
.front_ccw = false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment