Commit 9575b8c6 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Pack space filler indices as well

parent 72c32771
......@@ -44,6 +44,7 @@ space_bits_4(int i)
* mapping, just with bits twiddled around. */
uint32_t space_filler[16][16];
uint32_t space_filler_packed4[16][4];
unsigned space_filler_one[16];
void
......@@ -55,6 +56,14 @@ trans_generate_space_filler_indices()
space_bits_4(y ^ x) | (space_bits_4(y) << 1);
}
for (int q = 0; q < 4; ++q) {
space_filler_packed4[y][q] =
(space_filler[y][(q*4) + 0] << 0) |
(space_filler[y][(q*4) + 1] << 8) |
(space_filler[y][(q*4) + 2] << 16) |
(space_filler[y][(q*4) + 3] << 24);
}
space_filler_one[y] = space_bits_4(y);
}
}
......@@ -78,12 +87,12 @@ swizzle_bpp1_align16(int width, int height, int source_stride, int block_pitch,
for (int q = 0; q < 4; ++q) {
uint32_t src = src_32[q];
int base = q * 4;
uint32_t spaced = space_filler_packed4[rem_y][q];
block_start_s[space_filler[rem_y][base + 0]] = (src >> 0) & 0xFF;
block_start_s[space_filler[rem_y][base + 1]] = (src >> 8) & 0xFF;
block_start_s[space_filler[rem_y][base + 2]] = (src >> 16) & 0xFF;
block_start_s[space_filler[rem_y][base + 3]] = (src >> 24) & 0xFF;
block_start_s[(spaced >> 0) & 0xFF] = (src >> 0) & 0xFF;
block_start_s[(spaced >> 8) & 0xFF] = (src >> 8) & 0xFF;
block_start_s[(spaced >> 16) & 0xFF] = (src >> 16) & 0xFF;
block_start_s[(spaced >> 24) & 0xFF] = (src >> 24) & 0xFF;
}
}
}
......@@ -160,7 +169,7 @@ trans_swizzled_size(int width, int height, int bytes_per_pixel)
return sz;
}
#if 0
#if 1
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
......
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