2015-02-11 10:46 GMT+01:00 Stefan Dösinger stefandoesinger@gmail.com:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-02-10 um 22:05 schrieb Henri Verbeet:
What's a bit awkward about this is that if the pitch isn't a multiple of the pixel byte width it's still not going to work. But I guess this is the best we can do.
Does this ever happen? D3D9 doesn't allow specifying a manual pitch, and ddraw has at most 4 byte pixels and enforces a pitch alignment of 4 according to our tests.
Technically 24-bit RGB8 can have a misaligned pitch, but that isn't supported anywhere.
It looks like that's correct WRT the client APIs but not for formats used internally by wined3d. I tried to set GL_UNPACK_ALIGNMENT to 1 in context_create and that fails volume_v16u16_test in d3d9:visual on Mesa. It fails because we're using GL_RGB16 to emulate D3DFMT_V16U16 when NV_texture_shader isn't supported (and the texture is 1x2x2 which luckily triggers the bug). I think conversions are the only cases where we can currently get pitches non multiple of the pixel byte width and we can fix those by either using a different pitch (we're free to choose it anyway) or avoiding those 3-channels formats altogether. The attached patch takes the former approach.
Otherwise I can still go ahead with this patch but it would be a bit cumbersome to have to set UNPACK_ALIGNMENT every time when once per context should be enough (unless I'm missing something).