wined3d: Respect WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-11-08 21:29:02 +03:30 committed by Alexandre Julliard
parent e4ffe65899
commit cdfdfc382b
2 changed files with 8 additions and 0 deletions

View file

@ -4756,6 +4756,11 @@ static void update_swapchain_flags(struct wined3d_texture *texture)
{
unsigned int flags = texture->swapchain->desc.flags;
if (flags & WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER)
texture->resource.access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
else
texture->resource.access &= ~(WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W);
if (flags & WINED3D_SWAPCHAIN_GDI_COMPATIBLE)
texture->flags |= WINED3D_TEXTURE_GET_DC;
else

View file

@ -838,6 +838,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
texture_desc.usage |= WINED3DUSAGE_OWNDC;
texture_desc.bind_flags = 0;
texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
if (swapchain->desc.flags & WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER)
texture_desc.access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
texture_desc.width = swapchain->desc.backbuffer_width;
texture_desc.height = swapchain->desc.backbuffer_height;
texture_desc.depth = 1;
@ -947,6 +949,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
texture_desc.format = swapchain->desc.auto_depth_stencil_format;
texture_desc.usage = 0;
texture_desc.bind_flags = WINED3D_BIND_DEPTH_STENCIL;
texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent,
device->device_parent, &texture_desc, 0, &ds)))