From 5e623ee4d9919b32e4d7a7eaa86036511e07d8b5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 21 Jan 2017 23:56:59 +0100 Subject: [PATCH] Added patch to implement semi-stub for d3d11 context ResolveSubresource method. --- ...ResolveSubresource-by-copying-sub-re.patch | 41 +++++++++++++++++++ patches/d3d11-ResolveSubresource/definition | 1 + patches/patchinstall.sh | 16 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 patches/d3d11-ResolveSubresource/0001-d3d11-Implement-ResolveSubresource-by-copying-sub-re.patch create mode 100644 patches/d3d11-ResolveSubresource/definition diff --git a/patches/d3d11-ResolveSubresource/0001-d3d11-Implement-ResolveSubresource-by-copying-sub-re.patch b/patches/d3d11-ResolveSubresource/0001-d3d11-Implement-ResolveSubresource-by-copying-sub-re.patch new file mode 100644 index 00000000..addddd73 --- /dev/null +++ b/patches/d3d11-ResolveSubresource/0001-d3d11-Implement-ResolveSubresource-by-copying-sub-re.patch @@ -0,0 +1,41 @@ +From d16a0f5f4bde197dbdda7b61d8c6b69bbc9be128 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 21 Jan 2017 22:43:12 +0100 +Subject: d3d11: Implement ResolveSubresource by copying sub resource (there is + no multisample texture support yet). + +--- + dlls/d3d11/device.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c +index 777146d717e..9ad2b2ecaa5 100644 +--- a/dlls/d3d11/device.c ++++ b/dlls/d3d11/device.c +@@ -1120,10 +1120,22 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D + ID3D11Resource *src_resource, UINT src_subresource_idx, + DXGI_FORMAT format) + { +- FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, " ++ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); ++ struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; ++ ++ TRACE("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, " + "format %s stub!\n", + iface, dst_resource, dst_subresource_idx, src_resource, src_subresource_idx, + debug_dxgi_format(format)); ++ ++ wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); ++ wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); ++ ++ /* Multisampled textures are not supported yet, so simply copy the sub resource */ ++ wined3d_mutex_lock(); ++ wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, ++ 0, 0, 0, wined3d_src_resource, src_subresource_idx, NULL); ++ wined3d_mutex_unlock(); + } + + static void STDMETHODCALLTYPE d3d11_immediate_context_ExecuteCommandList(ID3D11DeviceContext *iface, +-- +2.11.0 + diff --git a/patches/d3d11-ResolveSubresource/definition b/patches/d3d11-ResolveSubresource/definition new file mode 100644 index 00000000..3efd1da3 --- /dev/null +++ b/patches/d3d11-ResolveSubresource/definition @@ -0,0 +1 @@ +Fixes: Implement semi-stub for d3d11 context ResolveSubresource method. diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index d339efa2..e5201810 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -112,6 +112,7 @@ patch_enable_all () enable_d3d10_1_Forwards="$1" enable_d3d11_Deferred_Context="$1" enable_d3d11_ID3D11Texture1D="$1" + enable_d3d11_ResolveSubresource="$1" enable_d3d8_ValidateShader="$1" enable_d3d9_DesktopWindow="$1" enable_d3d9_DrawIndexedPrimitiveUP="$1" @@ -557,6 +558,9 @@ patch_enable () d3d11-ID3D11Texture1D) enable_d3d11_ID3D11Texture1D="$2" ;; + d3d11-ResolveSubresource) + enable_d3d11_ResolveSubresource="$2" + ;; d3d8-ValidateShader) enable_d3d8_ValidateShader="$2" ;; @@ -3406,6 +3410,18 @@ if test "$enable_d3d11_ID3D11Texture1D" -eq 1; then ) >> "$patchlist" fi +# Patchset d3d11-ResolveSubresource +# | +# | Modified files: +# | * dlls/d3d11/device.c +# | +if test "$enable_d3d11_ResolveSubresource" -eq 1; then + patch_apply d3d11-ResolveSubresource/0001-d3d11-Implement-ResolveSubresource-by-copying-sub-re.patch + ( + printf '%s\n' '+ { "Michael Müller", "d3d11: Implement ResolveSubresource by copying sub resource (there is no multisample texture support yet).", 1 },'; + ) >> "$patchlist" +fi + # Patchset d3d8-ValidateShader # | # | This patchset fixes the following Wine bugs: