[PATCH 2/2] wined3d: Fix calculation of pitch for ATI2N format

Henri Verbeet hverbeet at gmail.com
Sun Feb 21 15:53:23 CST 2010

2010/2/21 Stefan Dösinger <stefandoesinger at gmx.at>:
> I may be a bit dizzy from playing games for 2 days, but I don't understand how you get to an offset of 2160 with the normal surface calculation. According to our table in utils.c ATI2N has 1 byte per pixel, so the offset would be * 1(bpp) * (128(width) * 60(yoffset) + 60(xoffset)) = 7740 bytes.
> Following the formula given in the GL_EXT_texture_compression_latc spec I'd get
> 16[blocksize in bytes] * (128[width]/4 * 60[y] / 4 + 60[x] / 4) = 7920
You get 2160 when you use correct block sizes, but a broken pitch. I.e.
60[yoffest]/4[bh] * 128[broken_pitch] + 60[xoffset]/4[bw] * 16[block_size]

I don't see how that will result in working locks though, so I'm
curious if this test actually passes on native Windows.

More information about the wine-devel mailing list