[4/4] wined3d: Don't allow fbo blits to frontbuffers that need fixups.

Stefan Dösinger stefan at codeweavers.com
Wed Oct 12 10:56:21 CDT 2011

On Wednesday 12 October 2011 11:35:48 Henri Verbeet wrote:
> On 11 October 2011 22:31, Stefan Dösinger <stefan at codeweavers.com> wrote:
> >  static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info,
> >  enum wined3d_blit_op blit_op,
> >  
> >          const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool,
> >          const struct wined3d_format *src_format,
> > 
> > -        const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool,
> > const struct wined3d_format *dst_format) +        const RECT *dst_rect,
> > DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format
> > *dst_format, +        const struct wined3d_surface *dst_surface)
> I don't think we want this. Does this actually ever happen?
I had to double-check this. It used to be a problem before you introduced the 
shadow ddraw frontbuffer. Now it works by luck because the shadow frontbuffer 
has a palette set and is converted on upload time, so it is a RGB surface that 
doesn't need read-time conversion.

There are two things that make the fbo blit work correctly although it should 
be broken:
*) The offscreen P8 surfaces should be converted with the destination's 
palette. The palette happens to be the same for the shadow frontbuffer, but for 
no other surface.
*) The shadow frontbuffer has SFLAG_CONVERTED set. Thus blits to it happen in 
software, otherwise we'd write P8 data to it that had no palette when it was 
converted to RGB(the ERR in d3dfmt_p8_init_palette).

So in the end we never happen to have a P8 surface that only has GL_ALPHA8 
data right now. No surface uses COMPLEX_FIXUP_P8 right now.

It will be a problem again once we load offscreen surfaces(render target or 
just offscreenplain) with GL_ALPHA8 textures that require COMPLEX_FIXUP_P8. 
I'll send the patch again with the patchset that re-enables shader P8 

And yeah, we don't actually want to pass the destination surface to 
fbo_blit_supported. It can go away again once we have the shadow frontbuffers 
in wined3d instead of ddraw.

The ARB and FFP blitter have a similar problem when blitting to onscreen P8 
surfaces, but unlike the FBO blitter they can do the palette lookup. They can 
accept the blit no matter what the destination is, but they have to make sure 
to select the right color fixup and palette.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20111012/0c0968aa/attachment.pgp>

More information about the wine-devel mailing list