You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It suggests the expectation is that lock offsets are aligned to 16-bits between cube faces (mip levels are continuous just like in a regular texture). Currently we luck out with formats that are natively aligned, such as L8 and A8, but return shifted offsets for faces > 0 with D3DFMT_A8R8G8B8... which is a rather common format.
Though I've been able to largely ascertain the problem, I'm afraid it's a bit beyond my brainpower to come up with a proper fix.
I have confirmed that messing with the offset in D3D9DeviceEx::LockImage can indeed make the test pass, for example if I shift the offset for all D3DFMT_A8R8G8B8 face 1 mips by 8, that will pass the validations for that face, but getting everything aligned as per expectations is beyond me.
The text was updated successfully, but these errors were encountered:
Currently we luck out with formats that are natively aligned, such as L8 and A8, but return shifted offsets for faces > 0 with D3DFMT_A8R8G8B8
Not sure I follow, how can it be possible for a smaller format to naturally meet stricter alignment requirements than a larger format?
I don't really understand what the test is testing either, does this mean that cube array layers need to be padded to start at 16 byte boundaries or something?
Not sure I follow, how can it be possible for a smaller format to naturally meet stricter alignment requirements than a larger format?
Not entirely sure either to be honest (otherwise I might have known what to do in order to fix it 🐸), but the point was L8 and A8 go through the same tests and pass them.
I don't really understand what the test is testing either, does this mean that cube array layers need to be padded to start at 16 byte boundaries or something?
Face boundaries within those arrays need to be, yes. The tests pass with flying colors on native at least.
Additionally, we also fail other things within the test_miptree_layout Wine test with ATI1/2 textures, but I'd treat that as a separate problem as it looks like we get a lot more than the alignment wrong here.
Wine has the following test that is shared between d3d8 and d3d9: https://github.com/wine-mirror/wine/blob/7b57598dcfc9198aa9cf6ac4ce17e2328db1379d/dlls/d3d8/tests/device.c#L9111-L9143
It suggests the expectation is that lock offsets are aligned to 16-bits between cube faces (mip levels are continuous just like in a regular texture). Currently we luck out with formats that are natively aligned, such as L8 and A8, but return shifted offsets for faces > 0 with D3DFMT_A8R8G8B8... which is a rather common format.
Though I've been able to largely ascertain the problem, I'm afraid it's a bit beyond my brainpower to come up with a proper fix.
I have confirmed that messing with the offset in
D3D9DeviceEx::LockImage
can indeed make the test pass, for example if I shift the offset for all D3DFMT_A8R8G8B8 face 1 mips by 8, that will pass the validations for that face, but getting everything aligned as per expectations is beyond me.The text was updated successfully, but these errors were encountered: