Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"03-27-12 - DXT is not enough"

5 Comments -

1 – 5 of 5
Blogger ryg said...

So this DXT reorg is literally just switching 32-bit words around, right? (At least for DXT1)

How does your layout look, and when does it run? If you do it after the whole texture has been decoded, then sure, that's gonna hurt (because a full texture probably won't fit inside L1 or L2). But what if you do the reorg on smaller chunks, e.g. 16k/32k blocks? That way you can do the reordering before data drops out of the cache. That's usually the big win.

April 5, 2012 at 9:53 PM

Blogger cbloom said...

The problem is in the decoder.

You need to output something like :

C1I1C2I2C3I3...

C = 32 bits of color
I = 32 bits of index

but your decoder is seeing C1C2C3...I1I2I3....

So when you do the output you have to first write out :

C1..C2..C3..

then go back and fill in the blanks with the indices after you get them.

I guess if you don't gather together all the colors and indices but just gather together 16k/32k chunks so the interleaving can be done in cache, that would fix it, but you would also lose some of the win.

April 5, 2012 at 10:26 PM

Blogger cbloom said...

I suppose the full solution would to have two separate decoder contexts for colors and indices, and then interleave the encoded streams in chunks of 4k or so.

Then the decoder does :

decode 4k worth of colors from context 1
output C1..C2..C3..
decode 4k worth of indices from context 2
output ..I1..I2..I3..

which should be reasonably fast and makes the encoding act as if they were grouped in larger blocks. (eg. by "separate context" I mean LZ matches in the color context go back into the previous chunks of colors, not into the indices)

April 5, 2012 at 10:36 PM

Blogger Jesse James Lactin said...

What's a good public data set to use to compare texture compressors? I found a nice algorithm for BC1 on a blog. I want to compare several metrics across several versions of my compressor (to check for regressions).

October 1, 2018 at 4:21 PM

Blogger cbloom said...

If you're talking about game textures, I don't know of one.

If you just want images in general, there are lots. Kodak, "new test images", etc. But those are not necessarily great reflections of real world game texture content.

October 1, 2018 at 4:43 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.