Henri Verbeet : wined3d: Respect WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER.

Alexandre Julliard julliard at winehq.org
Thu Nov 8 14:47:26 CST 2018


Module: wine
Branch: master
Commit: cdfdfc382b6cc307efcd51d5989eff8bca082e1e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cdfdfc382b6cc307efcd51d5989eff8bca082e1e

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Nov  8 21:47:02 2018 +0330

wined3d: Respect WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 3697b8f..b1a322e 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 499e163..b95623b 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)))




More information about the wine-cvs mailing list