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

Fix cache issue with space_filler lookup

parent 73d7e00e
......@@ -42,14 +42,14 @@ space_bits_4(int i)
/* Generate lookup table for the space filler curve. Note this is a 1:1
* mapping, just with bits twiddled around. */
int space_filler[16][16];
uint8_t space_filler[16][16];
void
trans_generate_space_filler_indices()
{
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < 16; ++y) {
space_filler[x][y] =
for (int y = 0; y < 16; ++y) {
for (int x = 0; x < 16; ++x) {
space_filler[y][x] =
space_bits_4(y ^ x) | (space_bits_4(y) << 1);
}
}
......@@ -72,7 +72,7 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
int block_x_s = (x >> 4) * 256;
int rem_x = x & 0x0F;
int index = space_filler[rem_x][rem_y];
int index = space_filler[rem_y][rem_x];
const uint8_t *source = &pixels[source_start + bytes_per_pixel * x];
uint8_t *dest = ldest + bytes_per_pixel * (block_start_s + block_x_s + index);
......
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