-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-05-12 16:44, schrieb Henri Verbeet:
On 12 May 2014 15:12, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
@@ -1458,8 +1457,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct int src_pitch = 0; int dst_pitch = 0;
- /* In case of P8 the index is stored in the alpha component if the primary render target uses P8. */ - if (format->id == WINED3DFMT_P8_UINT && swapchain_is_p8(surface->resource.device->swapchains[0])) + if (format->id == WINED3DFMT_P8_UINT) { gl_format = GL_ALPHA; gl_type = GL_UNSIGNED_BYTE; This branch is pretty pointless, the format / type for WINED3DFMT_P8_UINT is always GL_ALPHA / GL_UNSIGNED_BYTE. (If ARB_fragment_program is supported, and the format is supported at all anyway.) Not exactly. We load P8 GL textures for the front buffer when ARB_fragment_program is unsupported (and thus the format in theory is unsupported). So we might end up reading back the texture even though the format table doesn't contain data for P8.
Currently we never read back P8 data due to the ddraw front buffer and because we never load a GL P8 texture for offscreen surfaces (unless this changed at some point and I missed it). This doesn't make testing this easier. (And that's how the goto error thing didn't fail during testing.) I'll see if I can make the P8 line in the GL format table unconditional, that would make things easier. I'd prefer not to detour too much into a P8 GL handling cleanup though.
+ return (BYTE)((color->a * 255.0f) + 0.5f); So this could just use the table now, right? Right.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTceKHAAoJEN0/YqbEcdMwMLcP/1uDNi+e4e3wenb7mcmxjs3t J7R7w/8ojIT6hLrSghP3d1QaECp+bQxTBVpUfuZ6lSu4sMEPb/kYu50+okFyjlIT dJNkJvNEwyCrSyx7pq6nY8nQRB9YzaqgOExfMEix9X+z1NqzB9JSSInSZu/Cqy3l Wg9oKJwSWSSbfoKzXXKKR/1TAVvE/ReZ2iJaefl+BfH3oSDm1X+s8TYfsqlD4HfM 1IoOB2iuhkyykLUdNmKe8tbzPw5Ql/xVdGeQBc7r4Rgv+O1Rz/qHClTxqapAYbZe n5YKPYSPTiaNjl9yBXAQjm72XlJXwNFMUxO7j+XnWr8EkAmwiLRptiy1sR89vFO4 HGpOX/3U58mRTRKZCAmQIzTiuJFXudLosK2Od+J9ZfzPUhIf0vPAly6evtgDxK/V kV3SGtla/cWS77GVPTWpoiSdY7Vfgzkjn/Ww3QXQ5rg3FBfqCNKbYrPSKU+SG000 Q+u/ul3/ro8lGpFofGRymfTGC4xgyUH5Zl9DM08DNh8JoNcsJCNVyvr06xa6RHV3 IJfjooqdjVGUhCVWbyISNSPnEBWjdRv8U2nge9SHRrNPshBjyRJq6PY8cawbzkAN 4/4JjI4pCcrjh0dKHiiW9iI7PfF6rjZ2k9H611eZJIObzsT1+mnTFdTHa3sfDYGg Ni7LabYC0LThIyZLG4TQ =bPJW -----END PGP SIGNATURE-----