Re: [PATCH 2/5] wined3d: Set palettes on the swapchain.
On 15 May 2014 14:33, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index 3f7e2ad..780f068 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -136,8 +136,8 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette, if (resource->type == WINED3D_RTYPE_SURFACE) { struct wined3d_surface *surface = surface_from_resource(resource); - if (surface->palette == palette) - surface->surface_ops->surface_realize_palette(surface); + if (surface->swapchain && surface->swapchain->palette == palette) + surface->swapchain->swapchain_ops->swapchain_realize_palette(surface->swapchain); } }
I don't think this kind of thing should be needed. You should be able to make the palette texture that currently lives in the ARB program shader backend a property of the wined3d palette, and then presents can just make sure the palette texture is current. Something similar, if perhaps slightly more involved, should be possible for the GDI swapchain with GDI palettes.
Am 15.05.2014 um 15:27 schrieb Henri Verbeet <hverbeet(a)gmail.com>:
I don't think this kind of thing should be needed. You should be able to make the palette texture that currently lives in the ARB program shader backend a property of the wined3d palette, and then presents can just make sure the palette texture is current. Something similar, if perhaps slightly more involved, should be possible for the GDI swapchain with GDI palettes. We have to redraw the front buffer when the palette is changed for palette fading to work. We can’t wait for the next present, nor can we initiate a regular present since we want the front buffer redrawn, and not the back buffer.
But yes, the P8 palette should be moved into wined3d_palette. That’s a separate concern IMO.
On 15 May 2014 15:36, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
I don't think this kind of thing should be needed. You should be able to make the palette texture that currently lives in the ARB program shader backend a property of the wined3d palette, and then presents can just make sure the palette texture is current. Something similar, if perhaps slightly more involved, should be possible for the GDI swapchain with GDI palettes. We have to redraw the front buffer when the palette is changed for palette fading to work. We can’t wait for the next present, nor can we initiate a regular present since we want the front buffer redrawn, and not the back buffer.
I should perhaps have explicitly mentioned blits to the front buffer instead of presents as such, but the principle is the same of course. In ddraw, when you call SetEntries() on a palette with DDPCAPS_PRIMARYSURFACE set, you can just call ddraw_surface_update_frontbuffer().
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-05-15 18:16, schrieb Henri Verbeet:
In ddraw, when you call SetEntries() on a palette with DDPCAPS_PRIMARYSURFACE set, you can just call ddraw_surface_update_frontbuffer(). This should work, yeah. I'm not really happy with ddraw controlling such things, but at the moment this seems like the cleanest solution. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTdgNoAAoJEN0/YqbEcdMwN+IP/1fTTLIz2WXvbJzfKyG0gA2a FpdxoN5zoj+NQEYbCYieYjUqU1RdFoOfUoZ5Q0emEmeiZQrPaq8+slXtRg1uNSc4 4SFanBkJmoPhC8qTXfdzV4jWRrfn7oBd5SXMDs04b41QtBSp/IIFdJJbRID0NpoV mlOKi9P5tKmzsqBMzq9HYHBnT3Slo4meV3QEB6+GqSQo6fHnxIFecdY++Gc6UDA8 iS8npM15OgtWgcKSvMRi1lpETrCWZ9PoQnJ+BHOy6J0Cj6fgfUoL5/QxYY52/qD2 4Hojn/Ga1Sx3+KfYhozDcMkeJGIXHStMOhpPgurqAE6owW+ralIT0nCwiRAPGdBy xHxV5VbdrawRRHlpCqJaMaELnWxXI0gabegEKkwUyzVQMmML/UYMlBfVaeIiqzg1 FUod+myxGVbMU8Qq2AMBkDbAmBQHBUVDRS3Um1SETsuYPIwnVPsUBHGmxDDpnrx4 xt1GXDEUWB0Mwae0Xkd7PkpYSHD/yjwpQiQ4ll8tvk1QavPqfapVCDb4OKP5qWgv mo+6lf2ojmhsPIC0cc+9Nx26vjaNlMCPIM3404T2jaG34EEMRXzhDSntrTFYK5bt AKETXlLS/XDh1CkL7foBeTdH2+gqXMyemZvLbmunN0Dxa5yZvZlDfll4cRTgBodq i7iPkE/QQ8AbHuSRgFbZ =mhpt -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger