[v2 2/4] wined3d: make wined3d_device_get_front_buffer_data work with wined3d_texture and sub_resource_index

Henri Verbeet hverbeet at gmail.com
Thu Oct 15 06:54:19 CDT 2015

On 15 October 2015 at 13:30, Riccardo Bortolato <rikyz619 at gmail.com> wrote:
> Hi Henri,
> in a later patch I modified wined3d_swapchain_get_front_buffer_data()
> to work with texture + sub index (and that semplifies
> wined3d_device_get_front_buffer_data() as well).
> However the issue you mentioned still stands, would something like:
>     if (!sub_resource || sub_resource->type ==
> wined3d_device_get_swapchain(device, swapchain_idx)))
>         return WINED3DERR_INVALIDCALL;
> be ok for you?
Well, that one doesn't work, you either need to check "sub_resource"
against WINED3D_RTYPE_SURFACE, or "texture" against
WINED3D_RTYPE_VOLUME_TEXTURE. But conceptually, sure, you can just
check the resource type.

> Or I could just submit a patch that calls directly the updated
> wined3d_swapchain_get_front_buffer_data() while removing the
> wined3d_device_get_front_buffer_data() function (either that or first
> modify  wined3d_swapchain_get_front_buffer_data() and then remove
> wined3d_device_get_front_buffer_data()). The check would be on the
> same grounds though (check sub_resource type be a volume texture)
I'd first get rid of wined3d_device_get_front_buffer_data(), then
modify wined3d_swapchain_get_front_buffer_data().

More information about the wine-devel mailing list