[PATCH 1/6] wined3d: Respect WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER.

Henri Verbeet hverbeet at codeweavers.com
Thu Nov 8 11:59:02 CST 2018


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/device.c    | 5 +++++
 dlls/wined3d/swapchain.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3697b8f0005..b1a322e33de 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -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
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 499e1631f18..b95623be7ca 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -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)))
-- 
2.11.0




More information about the wine-devel mailing list