-----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@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.