diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 44e1e85f..79cd8f58 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -434,7 +434,6 @@ patch_enable_all () enable_wined3d_Accounting="$1" enable_wined3d_CSMT_Helper="$1" enable_wined3d_CSMT_Main="$1" - enable_wined3d_Copy_Resource_Typeless="$1" enable_wined3d_Core_Context="$1" enable_wined3d_DXTn="$1" enable_wined3d_Dual_Source_Blending="$1" @@ -1557,9 +1556,6 @@ patch_enable () wined3d-CSMT_Main) enable_wined3d_CSMT_Main="$2" ;; - wined3d-Copy_Resource_Typeless) - enable_wined3d_Copy_Resource_Typeless="$2" - ;; wined3d-Core_Context) enable_wined3d_Core_Context="$2" ;; @@ -2179,9 +2175,6 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then if test "$enable_wined3d_Accounting" -gt 1; then abort "Patchset wined3d-Accounting disabled, but wined3d-CSMT_Helper depends on that." fi - if test "$enable_wined3d_Copy_Resource_Typeless" -gt 1; then - abort "Patchset wined3d-Copy_Resource_Typeless disabled, but wined3d-CSMT_Helper depends on that." - fi if test "$enable_wined3d_DXTn" -gt 1; then abort "Patchset wined3d-DXTn disabled, but wined3d-CSMT_Helper depends on that." fi @@ -2206,7 +2199,6 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then enable_ntdll_DllRedirects=1 enable_wined3d_1DTextures=1 enable_wined3d_Accounting=1 - enable_wined3d_Copy_Resource_Typeless=1 enable_wined3d_DXTn=1 enable_wined3d_Dual_Source_Blending=1 enable_wined3d_GenerateMips=1 @@ -2216,13 +2208,9 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then fi if test "$enable_wined3d_GenerateMips" -eq 1; then - if test "$enable_wined3d_Copy_Resource_Typeless" -gt 1; then - abort "Patchset wined3d-Copy_Resource_Typeless disabled, but wined3d-GenerateMips depends on that." - fi if test "$enable_wined3d_Dual_Source_Blending" -gt 1; then abort "Patchset wined3d-Dual_Source_Blending disabled, but wined3d-GenerateMips depends on that." fi - enable_wined3d_Copy_Resource_Typeless=1 enable_wined3d_Dual_Source_Blending=1 fi @@ -2240,13 +2228,6 @@ if test "$enable_wined3d_Viewports" -eq 1; then enable_wined3d_Core_Context=1 fi -if test "$enable_wined3d_Copy_Resource_Typeless" -eq 1; then - if test "$enable_wined3d_1DTextures" -gt 1; then - abort "Patchset wined3d-1DTextures disabled, but wined3d-Copy_Resource_Typeless depends on that." - fi - enable_wined3d_1DTextures=1 -fi - if test "$enable_winebuild_Fake_Dlls" -eq 1; then if test "$enable_ntdll_User_Shared_Data" -gt 1; then abort "Patchset ntdll-User_Shared_Data disabled, but winebuild-Fake_Dlls depends on that." @@ -9192,32 +9173,6 @@ if test "$enable_wined3d_Accounting" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-Copy_Resource_Typeless -# | -# | This patchset has the following (direct or indirect) dependencies: -# | * wined3d-1DTextures -# | -# | This patchset fixes the following Wine bugs: -# | * [#43264] Implement copying resources between compatible formats -# | * [#42099] Implement copying resources between compatible formats -# | -# | Modified files: -# | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/directx.c, dlls/wined3d/utils.c, -# | dlls/wined3d/wined3d_gl.h, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Copy_Resource_Typeless" -eq 1; then - patch_apply wined3d-Copy_Resource_Typeless/0001-d3d11-tests-Add-more-advanced-CopySubresourceRegion-.patch - patch_apply wined3d-Copy_Resource_Typeless/0002-wined3d-Add-WINED3DFMT_R8G8B8A8_SNORM-to-WINED3DFMT_.patch - patch_apply wined3d-Copy_Resource_Typeless/0003-wined3d-Implement-copying-sub-resources-between-comp.patch - patch_apply wined3d-Copy_Resource_Typeless/0004-wined3d-Use-wined3d_cs_emit_copy_sub_resource-also-f.patch - ( - printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add more advanced CopySubresourceRegion tests.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "wined3d: Add WINED3DFMT_R8G8B8A8_SNORM to WINED3DFMT_R8G8B8A8_TYPELESS group.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "wined3d: Implement copying sub resources between compatible formats.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "wined3d: Use wined3d_cs_emit_copy_sub_resource also for wined3d_device_copy_resource.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-Core_Context # | # | Modified files: @@ -9269,8 +9224,7 @@ fi # Patchset wined3d-GenerateMips # | # | This patchset has the following (direct or indirect) dependencies: -# | * wined3d-1DTextures, wined3d-Copy_Resource_Typeless, wined3d-Core_Context, wined3d-Viewports, wined3d- -# | Dual_Source_Blending +# | * wined3d-Core_Context, wined3d-Viewports, wined3d-Dual_Source_Blending # | # | Modified files: # | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/texture.c, @@ -9336,9 +9290,8 @@ fi # | # | This patchset has the following (direct or indirect) dependencies: # | * wined3d-1DTextures, d3d11-Deferred_Context, d3d9-Tests, makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll- -# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-Copy_Resource_Typeless, wined3d-DXTn, wined3d- -# | Core_Context, wined3d-Viewports, wined3d-Dual_Source_Blending, wined3d-GenerateMips, wined3d-QUERY_Stubs, wined3d- -# | Silence_FIXMEs, wined3d-UAV_Counters +# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, wined3d-Core_Context, wined3d-Viewports, +# | wined3d-Dual_Source_Blending, wined3d-GenerateMips, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters # | # | Modified files: # | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc @@ -9500,9 +9453,9 @@ fi # | # | This patchset has the following (direct or indirect) dependencies: # | * wined3d-1DTextures, d3d11-Deferred_Context, d3d9-Tests, makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll- -# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-Copy_Resource_Typeless, wined3d-DXTn, wined3d- -# | Core_Context, wined3d-Viewports, wined3d-Dual_Source_Blending, wined3d-GenerateMips, wined3d-QUERY_Stubs, wined3d- -# | Silence_FIXMEs, wined3d-UAV_Counters, wined3d-CSMT_Helper +# | Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting, wined3d-DXTn, wined3d-Core_Context, wined3d-Viewports, +# | wined3d-Dual_Source_Blending, wined3d-GenerateMips, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters, +# | wined3d-CSMT_Helper # | # | This patchset fixes the following Wine bugs: # | * [#11674] Support for CSMT (command stream) to increase graphic performance diff --git a/patches/wined3d-CSMT_Helper/definition b/patches/wined3d-CSMT_Helper/definition index fbc79ad6..64eb79b9 100644 --- a/patches/wined3d-CSMT_Helper/definition +++ b/patches/wined3d-CSMT_Helper/definition @@ -3,7 +3,6 @@ Depends: wined3d-DXTn Depends: wined3d-QUERY_Stubs Depends: wined3d-1DTextures Depends: wined3d-Silence_FIXMEs -Depends: wined3d-Copy_Resource_Typeless Depends: wined3d-UAV_Counters Depends: wined3d-Dual_Source_Blending Depends: wined3d-GenerateMips diff --git a/patches/wined3d-Copy_Resource_Typeless/0001-d3d11-tests-Add-more-advanced-CopySubresourceRegion-.patch b/patches/wined3d-Copy_Resource_Typeless/0001-d3d11-tests-Add-more-advanced-CopySubresourceRegion-.patch deleted file mode 100644 index 5f633cfd..00000000 --- a/patches/wined3d-Copy_Resource_Typeless/0001-d3d11-tests-Add-more-advanced-CopySubresourceRegion-.patch +++ /dev/null @@ -1,180 +0,0 @@ -From 2e62577012d1fae93b3fabf6c4e1ef932b097aa8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 9 Jul 2017 00:58:50 +0200 -Subject: d3d11/tests: Add more advanced CopySubresourceRegion tests. - ---- - dlls/d3d11/tests/d3d11.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 121 insertions(+), 2 deletions(-) - -diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index f15d4873ab1..5a6bd46b905 100644 ---- a/dlls/d3d11/tests/d3d11.c -+++ b/dlls/d3d11/tests/d3d11.c -@@ -10446,6 +10446,7 @@ static void test_copy_subresource_region(void) - struct d3d11_test_context test_context; - ID3D11Buffer *dst_buffer, *src_buffer; - D3D11_SUBRESOURCE_DATA resource_data; -+ D3D11_MAPPED_SUBRESOURCE map_desc; - D3D11_TEXTURE2D_DESC texture_desc; - ID3D11SamplerState *sampler_state; - ID3D11ShaderResourceView *ps_srv; -@@ -10455,7 +10456,7 @@ static void test_copy_subresource_region(void) - struct resource_readback rb; - ID3D11PixelShader *ps; - ID3D11Device *device; -- unsigned int i, j; -+ unsigned int i, j, k; - D3D11_BOX box; - DWORD color; - HRESULT hr; -@@ -10512,13 +10513,19 @@ static void test_copy_subresource_region(void) - 0x0010000a, 0x00000000, 0x0100003e, - }; - static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; -- static const DWORD initial_data[16] = {0}; -+ static const DWORD initial_data[32] = {0}; - static const DWORD bitmap_data[] = - { -+ /* 1. layer */ - 0xff0000ff, 0xff00ffff, 0xff00ff00, 0xffffff00, - 0xffff0000, 0xffff00ff, 0xff000000, 0xff7f7f7f, - 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, - 0xffffffff, 0xff000000, 0xff000000, 0xff000000, -+ /* second layer / mip map level / ... */ -+ 0xffff44ff, 0xff00edd0, 0xfff22fff, 0xff0ccc00, -+ 0xff8f8f8f, 0xff00ffff, 0xff000120, 0xffff1234, -+ 0xff0560ff, 0xffff34ff, 0xff12ff00, 0xffffff00, -+ 0xffff2222, 0xfff1111f, 0xff031200, 0x0ff02200, - }; - static const DWORD expected_colors[] = - { -@@ -10527,6 +10534,34 @@ static void test_copy_subresource_region(void) - 0xff7f7f7f, 0xffff0000, 0xffff00ff, 0xff7f7f7f, - 0xffffffff, 0xffffffff, 0xff000000, 0x00000000, - }; -+ struct -+ { -+ DXGI_FORMAT src_format; -+ DXGI_FORMAT dst_format; -+ UINT width; -+ UINT height; -+ UINT levels; -+ UINT layers; -+ UINT src_sub_index; -+ UINT dst_sub_index; -+ } -+ compatible_formats[] = -+ { -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 4, 4, 1, 1, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_SNORM, 4, 4, 1, 1, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_SINT, 4, 4, 1, 1, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, 4, 1, 1, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UNORM, 4, 4, 1, 1, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 4, 4, 1, 2, 1, 1}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 4, 4, 1, 2, 0, 1}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 0, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 0, 1}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 0, 2}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 0, 3}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 1, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 2, 0}, -+ {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UINT, 2, 2, 2, 2, 3, 0}, -+ }; - - if (!init_test_context(&test_context, NULL)) - return; -@@ -10652,6 +10687,90 @@ static void test_copy_subresource_region(void) - ID3D11Texture2D_Release(dst_texture); - ID3D11Texture2D_Release(src_texture); - -+ /* test copy between compatible formats */ -+ texture_desc.SampleDesc.Count = 1; -+ texture_desc.SampleDesc.Quality = 0; -+ texture_desc.MiscFlags = 0; -+ -+ for (k = 0; k < sizeof(compatible_formats) / sizeof(compatible_formats[0]); k++) -+ { -+ UINT level_src, level_src_width, level_src_height; -+ UINT level_dst, level_dst_width, level_dst_height; -+ D3D11_SUBRESOURCE_DATA src_data[4], dst_data[4]; -+ const DWORD *c_result, *c_expected; -+ DWORD offset = 0; -+ -+ texture_desc.Width = compatible_formats[k].width; -+ texture_desc.Height = compatible_formats[k].height; -+ texture_desc.MipLevels = compatible_formats[k].levels; -+ texture_desc.ArraySize = compatible_formats[k].layers; -+ -+ texture_desc.Usage = D3D11_USAGE_IMMUTABLE; -+ texture_desc.Format = compatible_formats[k].src_format; -+ texture_desc.CPUAccessFlags = 0; -+ texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; -+ -+ for (i = 0; i < texture_desc.MipLevels * texture_desc.ArraySize; i++) -+ { -+ level_src = i % texture_desc.ArraySize; -+ level_src_width = (texture_desc.Width >> level_src); -+ level_src_height = (texture_desc.Height >> level_src); -+ -+ src_data[i].pSysMem = bitmap_data + offset; -+ src_data[i].SysMemPitch = level_src_width * sizeof(*bitmap_data); -+ src_data[i].SysMemSlicePitch = 0; -+ -+ dst_data[i].pSysMem = initial_data + offset; -+ dst_data[i].SysMemPitch = level_src_width * sizeof(*initial_data); -+ dst_data[i].SysMemSlicePitch = 0; -+ -+ offset += level_src_width * level_src_height; -+ } -+ -+ hr = ID3D11Device_CreateTexture2D(device, &texture_desc, src_data, &src_texture); -+ ok(SUCCEEDED(hr), "Failed to create 2d texture for format %#x for test %d, hr %#x.\n", compatible_formats[k].src_format, k, hr); -+ -+ texture_desc.Usage = D3D11_USAGE_STAGING; -+ texture_desc.Format = compatible_formats[k].dst_format; -+ texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; -+ texture_desc.BindFlags = 0; -+ -+ hr = ID3D11Device_CreateTexture2D(device, &texture_desc, dst_data, &dst_texture); -+ ok(SUCCEEDED(hr), "Failed to create 2d texture for format %#x, hr %#x.\n", compatible_formats[k].dst_format, hr); -+ -+ level_src = compatible_formats[k].src_sub_index % texture_desc.ArraySize; -+ level_src_width = (texture_desc.Width >> level_src); -+ level_src_height = (texture_desc.Height >> level_src); -+ -+ level_dst = compatible_formats[k].dst_sub_index % texture_desc.ArraySize; -+ level_dst_width = (texture_desc.Width >> level_dst); -+ level_dst_height = (texture_desc.Height >> level_dst); -+ -+ set_box(&box, 0, 0, 0, min(level_src_width, level_dst_width), min(level_src_height, level_dst_height), 1); -+ ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_texture, compatible_formats[k].dst_sub_index, -+ 0, 0, 0, (ID3D11Resource *)src_texture, compatible_formats[k].src_sub_index, &box); -+ -+ hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)dst_texture, compatible_formats[k].dst_sub_index, D3D11_MAP_READ, 0, &map_desc); -+ ok(SUCCEEDED(hr), "Failed to map 2d texture for test %d, hr %#x.\n", k, hr); -+ -+ c_expected = src_data[compatible_formats[k].src_sub_index].pSysMem; -+ for (i = 0; i < min(level_src_width, level_dst_width); i++) -+ { -+ for (j = 0; j < min(level_src_height, level_dst_height); j++) -+ { -+ c_result = (DWORD*)((char*)map_desc.pData + j * map_desc.RowPitch); -+ todo_wine ok(c_result[i] == c_expected[j * level_src_width + i], -+ "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x for test %u.\n", -+ c_result[i], i, j, c_expected[j * level_src_width + i], k); -+ } -+ } -+ -+ ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)dst_texture, 0); -+ -+ ID3D11Texture2D_Release(dst_texture); -+ ID3D11Texture2D_Release(src_texture); -+ } -+ - ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &ps_srv); - ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler_state); - ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); --- -2.13.1 - diff --git a/patches/wined3d-Copy_Resource_Typeless/0002-wined3d-Add-WINED3DFMT_R8G8B8A8_SNORM-to-WINED3DFMT_.patch b/patches/wined3d-Copy_Resource_Typeless/0002-wined3d-Add-WINED3DFMT_R8G8B8A8_SNORM-to-WINED3DFMT_.patch deleted file mode 100644 index 18c59bff..00000000 --- a/patches/wined3d-Copy_Resource_Typeless/0002-wined3d-Add-WINED3DFMT_R8G8B8A8_SNORM-to-WINED3DFMT_.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a9ecabd2f82e39d94fcbf734241e4291f8c167f4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 9 Jul 2017 01:05:54 +0200 -Subject: wined3d: Add WINED3DFMT_R8G8B8A8_SNORM to - WINED3DFMT_R8G8B8A8_TYPELESS group. - ---- - dlls/wined3d/utils.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index 7462103aeee..1cfc2e82c7f 100644 ---- a/dlls/wined3d/utils.c -+++ b/dlls/wined3d/utils.c -@@ -234,6 +234,7 @@ static const struct wined3d_typed_format_info typed_formats[] = - {WINED3DFMT_R8G8B8A8_SINT, WINED3DFMT_R8G8B8A8_TYPELESS, "IIII"}, - {WINED3DFMT_R8G8B8A8_UNORM_SRGB, WINED3DFMT_R8G8B8A8_TYPELESS, "uuuu"}, - {WINED3DFMT_R8G8B8A8_UNORM, WINED3DFMT_R8G8B8A8_TYPELESS, "uuuu"}, -+ {WINED3DFMT_R8G8B8A8_SNORM, WINED3DFMT_R8G8B8A8_TYPELESS, "iiii"}, - {WINED3DFMT_R16G16_UNORM, WINED3DFMT_R16G16_TYPELESS, "uu"}, - {WINED3DFMT_R16G16_SNORM, WINED3DFMT_R16G16_TYPELESS, "ii"}, - {WINED3DFMT_R16G16_UINT, WINED3DFMT_R16G16_TYPELESS, "UU"}, --- -2.13.1 - diff --git a/patches/wined3d-Copy_Resource_Typeless/0003-wined3d-Implement-copying-sub-resources-between-comp.patch b/patches/wined3d-Copy_Resource_Typeless/0003-wined3d-Implement-copying-sub-resources-between-comp.patch deleted file mode 100644 index 1954476d..00000000 --- a/patches/wined3d-Copy_Resource_Typeless/0003-wined3d-Implement-copying-sub-resources-between-comp.patch +++ /dev/null @@ -1,299 +0,0 @@ -From 04388e5a4fdba61b784a338346f122c97b073ca3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 9 Jul 2017 01:04:33 +0200 -Subject: wined3d: Implement copying sub resources between compatible formats. - ---- - dlls/d3d11/tests/d3d11.c | 2 +- - dlls/wined3d/cs.c | 155 +++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 9 ++- - dlls/wined3d/directx.c | 4 ++ - dlls/wined3d/wined3d_gl.h | 1 + - dlls/wined3d/wined3d_private.h | 3 + - 6 files changed, 170 insertions(+), 4 deletions(-) - -diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index 5fa4d3f9def..df22abb3337 100644 ---- a/dlls/d3d11/tests/d3d11.c -+++ b/dlls/d3d11/tests/d3d11.c -@@ -10133,7 +10133,7 @@ static void test_copy_subresource_region(void) - for (j = 0; j < min(level_src_height, level_dst_height); j++) - { - c_result = (DWORD*)((char*)map_desc.pData + j * map_desc.RowPitch); -- todo_wine ok(c_result[i] == c_expected[j * level_src_width + i], -+ ok(c_result[i] == c_expected[j * level_src_width + i], - "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x for test %u.\n", - c_result[i], i, j, c_expected[j * level_src_width + i], k); - } -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b3b6588ff9b..3666d9f3f7e 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -71,6 +71,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, - WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW, - WINED3D_CS_OP_COPY_UAV_COUNTER, -+ WINED3D_CS_OP_COPY_SUB_RESOURCE, - WINED3D_CS_OP_STOP, - }; - -@@ -426,6 +427,17 @@ struct wined3d_cs_copy_uav_counter - struct wined3d_unordered_access_view *view; - }; - -+struct wined3d_cs_copy_sub_resource -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_resource *dst_resource; -+ unsigned int dst_sub_resource_idx; -+ struct wined3d_box dst_box; -+ struct wined3d_resource *src_resource; -+ unsigned int src_sub_resource_idx; -+ struct wined3d_box src_box; -+}; -+ - struct wined3d_cs_stop - { - enum wined3d_cs_op opcode; -@@ -2296,6 +2308,148 @@ void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buff - cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); - } - -+static void wined3d_cs_exec_copy_sub_resource(struct wined3d_cs *cs, const void *data) -+{ -+ struct wined3d_cs_copy_sub_resource *op = (void*)data; -+ -+ if (op->dst_resource->type == WINED3D_RTYPE_BUFFER) -+ { -+ wined3d_buffer_copy(buffer_from_resource(op->dst_resource), op->dst_box.left, -+ buffer_from_resource(op->src_resource), op->src_box.left, -+ op->src_box.right - op->src_box.left); -+ } -+ else if (op->dst_resource->type == WINED3D_RTYPE_TEXTURE_1D || -+ op->dst_resource->type == WINED3D_RTYPE_TEXTURE_2D || -+ op->dst_resource->type == WINED3D_RTYPE_TEXTURE_3D) -+ { -+ struct wined3d_texture *dst_texture, *src_texture; -+ struct gl_texture *gl_tex_src, *gl_tex_dst; -+ unsigned int update_w, update_h, update_d; -+ const struct wined3d_gl_info *gl_info; -+ unsigned int src_level, src_layer; -+ unsigned int dst_level, dst_layer; -+ struct wined3d_context *context; -+ BOOL partial_update = FALSE; -+ -+ update_w = op->dst_box.right - op->dst_box.left; -+ update_h = op->dst_box.bottom - op->dst_box.top; -+ update_d = op->dst_box.back - op->dst_box.front; -+ -+ dst_texture = texture_from_resource(op->dst_resource); -+ src_texture = texture_from_resource(op->src_resource); -+ -+ context = context_acquire(cs->device, NULL, 0); -+ gl_info = context->gl_info; -+ -+ if (!wined3d_texture_load_location(src_texture, op->src_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB)) -+ { -+ FIXME("Failed to load source sub-resource into WINED3D_LOCATION_TEXTURE_RGB.\n"); -+ context_release(context); -+ goto error; -+ } -+ -+ src_level = op->src_sub_resource_idx % src_texture->level_count; -+ src_layer = op->src_sub_resource_idx / src_texture->level_count; -+ dst_level = op->dst_sub_resource_idx % dst_texture->level_count; -+ dst_layer = op->dst_sub_resource_idx / dst_texture->level_count; -+ -+ switch (op->dst_resource->type) -+ { -+ case WINED3D_RTYPE_TEXTURE_3D: -+ partial_update |= (update_d != wined3d_texture_get_level_depth(dst_texture, dst_level)); -+ case WINED3D_RTYPE_TEXTURE_2D: -+ partial_update |= (update_h != wined3d_texture_get_level_height(dst_texture, dst_level)); -+ case WINED3D_RTYPE_TEXTURE_1D: -+ partial_update |= (update_w != wined3d_texture_get_level_width(dst_texture, dst_level)); -+ default: -+ break; -+ } -+ -+ if (!partial_update) -+ { -+ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -+ } -+ else if (!wined3d_texture_load_location(dst_texture, op->dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB)) -+ { -+ FIXME("Failed to load destination sub-resource.\n"); -+ context_release(context); -+ goto error; -+ } -+ -+ switch (op->dst_resource->type) -+ { -+ case WINED3D_RTYPE_TEXTURE_1D: -+ op->src_box.top = src_layer; -+ op->dst_box.top = dst_layer; -+ break; -+ case WINED3D_RTYPE_TEXTURE_2D: -+ op->src_box.front = src_layer; -+ op->dst_box.front = dst_layer; -+ break; -+ default: -+ break; -+ } -+ -+ gl_tex_src = wined3d_texture_get_gl_texture(src_texture, FALSE); -+ gl_tex_dst = wined3d_texture_get_gl_texture(dst_texture, FALSE); -+ -+ GL_EXTCALL(glCopyImageSubData(gl_tex_src->name, src_texture->target, src_level, -+ op->src_box.left, op->src_box.top, op->src_box.front, -+ gl_tex_dst->name, dst_texture->target, dst_level, -+ op->dst_box.left, op->dst_box.top, op->dst_box.front, -+ update_w, update_h, update_d)); -+ checkGLcall("Copy texture content"); -+ -+ wined3d_texture_validate_location(dst_texture, op->dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); -+ wined3d_texture_invalidate_location(dst_texture, op->dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); -+ -+ context_release(context); -+ } -+ else -+ { -+ FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); -+ } -+ -+error: -+ wined3d_resource_release(op->src_resource); -+ wined3d_resource_release(op->dst_resource); -+} -+ -+void wined3d_cs_emit_copy_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, -+ unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, -+ unsigned int src_sub_resource_idx, const struct wined3d_box *src_box) -+{ -+ const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; -+ struct wined3d_cs_blt_sub_resource *op; -+ -+ if (!gl_info->supported[ARB_TEXTURE_VIEW] && src_resource->format->id != dst_resource->format->id) -+ { -+ FIXME("ARB_TEXTURE_VIEW not supported, cannot copy sub-resource.\n"); -+ return; -+ } -+ -+ if (!gl_info->supported[ARB_COPY_IMAGE]) -+ { -+ wined3d_cs_emit_blt_sub_resource(cs, dst_resource, dst_sub_resource_idx, dst_box, -+ src_resource, src_sub_resource_idx, src_box, 0, NULL, WINED3D_TEXF_POINT); -+ return; -+ } -+ -+ op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); -+ op->opcode = WINED3D_CS_OP_COPY_SUB_RESOURCE; -+ op->dst_resource = dst_resource; -+ op->dst_sub_resource_idx = dst_sub_resource_idx; -+ op->dst_box = *dst_box; -+ op->src_resource = src_resource; -+ op->src_sub_resource_idx = src_sub_resource_idx; -+ op->src_box = *src_box; -+ -+ wined3d_resource_acquire(dst_resource); -+ wined3d_resource_acquire(src_resource); -+ -+ cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); -+} -+ - static void wined3d_cs_emit_stop(struct wined3d_cs *cs) - { - struct wined3d_cs_stop *op; -@@ -2354,6 +2508,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, - /* WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW */ wined3d_cs_exec_clear_unordered_access_view, - /* WINED3D_CS_OP_COPY_UAV_COUNTER */ wined3d_cs_exec_copy_uav_counter, -+ /* WINED3D_CS_OP_COPY_SUB_RESOURCE */ wined3d_cs_exec_copy_sub_resource, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 9f7c6e946a5..9cb12422691 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4106,7 +4106,10 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev - return WINED3DERR_INVALIDCALL; - } - -- if (src_resource->format->id != dst_resource->format->id) -+ if (src_resource->format->id != dst_resource->format->id && -+ (src_resource->format->typeless_id != dst_resource->format->typeless_id || -+ src_resource->format->gl_view_class != dst_resource->format->gl_view_class || -+ !src_resource->format->typeless_id)) - { - WARN("Resource formats (%s / %s) don't match.\n", - debug_d3dformat(dst_resource->format->id), -@@ -4208,8 +4211,8 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev - return WINED3DERR_INVALIDCALL; - } - -- wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, dst_sub_resource_idx, &dst_box, -- src_resource, src_sub_resource_idx, src_box, 0, NULL, WINED3D_TEXF_POINT); -+ wined3d_cs_emit_copy_sub_resource(device->cs, dst_resource, dst_sub_resource_idx, &dst_box, -+ src_resource, src_sub_resource_idx, src_box); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 27d2e13353d..49cb4efa86f 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -117,6 +117,7 @@ static const struct wined3d_extension_map gl_extension_map[] = - {"GL_ARB_compute_shader", ARB_COMPUTE_SHADER }, - {"GL_ARB_conservative_depth", ARB_CONSERVATIVE_DEPTH }, - {"GL_ARB_copy_buffer", ARB_COPY_BUFFER }, -+ {"GL_ARB_copy_image", ARB_COPY_IMAGE }, - {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT }, - {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT }, - {"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP }, -@@ -2703,6 +2704,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) - USE_GL_FUNC(glDispatchComputeIndirect) - /* GL_ARB_copy_buffer */ - USE_GL_FUNC(glCopyBufferSubData) -+ /* GL_ARB_copy_image */ -+ USE_GL_FUNC(glCopyImageSubData) - /* GL_ARB_debug_output */ - USE_GL_FUNC(glDebugMessageCallbackARB) - USE_GL_FUNC(glDebugMessageControlARB) -@@ -3888,6 +3891,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, - - {ARB_CLEAR_BUFFER_OBJECT, MAKEDWORD_VERSION(4, 3)}, - {ARB_COMPUTE_SHADER, MAKEDWORD_VERSION(4, 3)}, -+ {ARB_COPY_IMAGE, MAKEDWORD_VERSION(4, 3)}, - {ARB_DEBUG_OUTPUT, MAKEDWORD_VERSION(4, 3)}, - {ARB_ES3_COMPATIBILITY, MAKEDWORD_VERSION(4, 3)}, - {ARB_FRAGMENT_LAYER_VIEWPORT, MAKEDWORD_VERSION(4, 3)}, -diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index 6ab48474817..ef9cfd8e592 100644 ---- a/dlls/wined3d/wined3d_gl.h -+++ b/dlls/wined3d/wined3d_gl.h -@@ -51,6 +51,7 @@ enum wined3d_gl_extension - ARB_COMPUTE_SHADER, - ARB_CONSERVATIVE_DEPTH, - ARB_COPY_BUFFER, -+ ARB_COPY_IMAGE, - ARB_DEBUG_OUTPUT, - ARB_DEPTH_BUFFER_FLOAT, - ARB_DEPTH_CLAMP, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 84ca09b9415..547d44e5aa5 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -3520,6 +3520,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou - void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int slice_pitch) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_copy_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, -+ unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, -+ unsigned int src_sub_resource_idx, const struct wined3d_box *src_box) DECLSPEC_HIDDEN; - void wined3d_cs_init_object(struct wined3d_cs *cs, - void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; - HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, --- -2.14.1 - diff --git a/patches/wined3d-Copy_Resource_Typeless/0004-wined3d-Use-wined3d_cs_emit_copy_sub_resource-also-f.patch b/patches/wined3d-Copy_Resource_Typeless/0004-wined3d-Use-wined3d_cs_emit_copy_sub_resource-also-f.patch deleted file mode 100644 index 0bd133d2..00000000 --- a/patches/wined3d-Copy_Resource_Typeless/0004-wined3d-Use-wined3d_cs_emit_copy_sub_resource-also-f.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 064e00bdc54c94a29c5c55a5adf9c70565f50d7a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 9 Jul 2017 04:05:54 +0200 -Subject: wined3d: Use wined3d_cs_emit_copy_sub_resource also for - wined3d_device_copy_resource. - ---- - dlls/wined3d/device.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0515317d4f0..42749c7c87a 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4046,7 +4046,10 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, - return; - } - -- if (src_resource->format->id != dst_resource->format->id) -+ if (src_resource->format->id != dst_resource->format->id && -+ (src_resource->format->typeless_id != dst_resource->format->typeless_id || -+ src_resource->format->gl_view_class != dst_resource->format->gl_view_class || -+ !src_resource->format->typeless_id)) - { - WARN("Resource formats (%s / %s) don't match.\n", - debug_d3dformat(dst_resource->format->id), -@@ -4057,8 +4060,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, - if (dst_resource->type == WINED3D_RTYPE_BUFFER) - { - wined3d_box_set(&box, 0, 0, src_resource->size, 1, 0, 1); -- wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, 0, &box, -- src_resource, 0, &box, 0, NULL, WINED3D_TEXF_POINT); -+ wined3d_cs_emit_copy_sub_resource(device->cs, dst_resource, 0, &box, src_resource, 0, &box); - return; - } - -@@ -4084,8 +4086,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, - { - unsigned int idx = j * dst_texture->level_count + i; - -- wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, idx, &box, -- src_resource, idx, &box, 0, NULL, WINED3D_TEXF_POINT); -+ wined3d_cs_emit_copy_sub_resource(device->cs, dst_resource, idx, &box, src_resource, idx, &box); - } - } - } --- -2.13.1 - diff --git a/patches/wined3d-Copy_Resource_Typeless/definition b/patches/wined3d-Copy_Resource_Typeless/definition deleted file mode 100644 index 05b4a543..00000000 --- a/patches/wined3d-Copy_Resource_Typeless/definition +++ /dev/null @@ -1,4 +0,0 @@ -Fixes: [43264] Implement copying resources between compatible formats -Fixes: [42099] Implement copying resources between compatible formats -#Depends: d3d11-Depth_Bias -Depends: wined3d-1DTextures diff --git a/patches/wined3d-GenerateMips/definition b/patches/wined3d-GenerateMips/definition index f79a34bb..b9f0756f 100644 --- a/patches/wined3d-GenerateMips/definition +++ b/patches/wined3d-GenerateMips/definition @@ -1,3 +1,2 @@ Fixes: Support for GenerateMips -Depends: wined3d-Copy_Resource_Typeless Depends: wined3d-Dual_Source_Blending