[PATCH 2/5] d3d9/tests: Add a test for 2D D3DFMT_V16U16 textures.

Stefan Dösinger stefandoesinger at gmail.com
Fri Feb 20 06:59:29 CST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 2015-02-20 um 13:50 schrieb Matteo Bruni:
> Yes, I've noticed that too. I haven't really looked into it but
> the float-to-signed conversion has always been a bit tricky. In
> OpenGL AFAIK the conversion formula changed at some point (e.g. see
> table 2.9 in the 2.1 spec vs paragraph 2.3.5.1 in the 4.5 spec), it
> might be we have to use one instead of the other in our fallback
> conversion functions too. No idea if something like that applies to
> Windows drivers too.
Well, one problem we have in e.g. L6V5U5 is that we simply left-shift
by 3. So the input value 15 / 0xf, which is the highest possible value
for the signed channels becomes 120 (0x78). This doesn't give the same
float result.

The code Henri uses in convert_s1_uint_d15_unorm looks reasonable, but
I did not find a textbook explanation for it. Repeating the high bits
in the extra space seems reasonable, but I'm not sure what the reason
for ORing the least significant bit is.

Also I'm not sure what the correct handling of negative ranges is. I
*think* it's enough to just left-shift them, but I am not sure.

Also, as the OpenGL spec says, representing zero is an issue.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJU5y+xAAoJEN0/YqbEcdMwzYEP/30SOtzipbgTFGyU9i5uvAl2
wnDxoteqdBQjk8UwIqM933uHDsuDBXZBLzEvtG7lWq83Sf/n7qWkQf69n/Ek5vuh
EWgdxN2jVXa3jboBHdSWAagcS0uBlj4Z5BHewiXXdNHHbPOO34aKHOztK+j8B1Sp
PhcHR4LT1XZy6KkXS4nh6L3V9vyB8U0FADmDuumy47RcZ0b+cGsghpk/AZ5ULb4K
uck1XwjOVWV+i9j9YErxzoCBzDooKG2oUYuQti2N2G5ae4pqGc9H8dTvQJ2l/Pt4
MxT0R/wa05mPSLCNl+u9qHWRlZ677g8JlvWD5diqgeD2k09dvlS2aahMSveFreu9
33uBil2eRP8hKioafCVNJ/efDnFCKcayi/UmUTfISpwZ3gwI3V/aNKaoN6CGtlAm
DtTGn25lDWZrPOt/h2zon+NoYBLFMkW+ZOnEIrVVB6OBtRrAnJDKVkj2CE7XMJkz
Vzw9xozGRJ+nHi2RdsEOqT4dcAzKvZgdtVL2+jgKehNzAagOKPTjfhmf+kcyOu05
V3cNwowaZmagvrknxDWaMzI0TM530UTimqEkXhY7oIwpHV3qT40GOFyjQM/hu1nB
ZvMLB7978IK0fMLAhZi8KuM7eFTsHWgOtTyf2AvxzIZnSADJkGs2FlKXvOkTCnaP
Dmbwu+WVecEXL/3xRAdK
=Kr2P
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list