Rebase against 06c5a9ab55751b1c66ea0847aea4d4a45d8d343c.

This commit is contained in:
Sebastian Lackner 2017-02-10 16:41:25 +01:00
parent 253835e7c3
commit 2b415aff4f
14 changed files with 811 additions and 599 deletions

View File

@ -1,4 +1,4 @@
From ff83c3ee1b422915d690411cda05db19ceacbdf1 Mon Sep 17 00:00:00 2001
From 68c5c27b4867a08482774a506095736107631d38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 3 Jun 2015 22:57:21 +0200
Subject: winex11.drv: Allow changing the opengl pixel format on the desktop
@ -43,10 +43,10 @@ index e1d6d4c97c2..bf6a9a138dd 100644
swapchain = (IDXGISwapChain *)0xdeadbeef;
device = (ID3D10Device1 *)0xdeadbeef;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index ac4393dd3b3..49356b398c1 100644
index 0d473344c2c..a077ce0aaa9 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -1451,10 +1451,22 @@ static void test_create_device(void)
@@ -1517,10 +1517,22 @@ static void test_create_device(void)
hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION,
&swapchain_desc, &swapchain, &device, &feature_level, &immediate_context);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr);
@ -74,10 +74,10 @@ index ac4393dd3b3..49356b398c1 100644
swapchain = (IDXGISwapChain *)0xdeadbeef;
device = (ID3D11Device *)0xdeadbeef;
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index aa266a5186e..986000d0278 100644
index feb1efcb94b..19bfcb5bc3c 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -11401,6 +11401,21 @@ static void test_render_target_device_mismatch(void)
@@ -11506,6 +11506,21 @@ static void test_format_unknown(void)
DestroyWindow(window);
}
@ -99,19 +99,19 @@ index aa266a5186e..986000d0278 100644
START_TEST(device)
{
WNDCLASSA wc = {0};
@@ -11518,6 +11533,7 @@ START_TEST(device)
test_miptree_layout();
@@ -11624,6 +11639,7 @@ START_TEST(device)
test_get_render_target_data();
test_render_target_device_mismatch();
test_format_unknown();
+ test_desktop_window();
UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL));
}
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index d89a19330f7..b5faac56ade 100644
index 3dab687197e..72056adb7c9 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1469,12 +1469,15 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change)
@@ -1473,12 +1473,15 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change)
TRACE("(%p,%d)\n", hdc, format);

View File

@ -1,4 +1,4 @@
From a3c36a9407542059fcab059b071a9cff16840ed9 Mon Sep 17 00:00:00 2001
From 8a9f2fac2659ff9d140aecd553dcdcbc46724154 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 24 Jan 2017 19:18:13 +0800
Subject: kernel32: Replace Peb->BeingDebugged check by
@ -13,18 +13,18 @@ but that doesn't generate exceptions or debug events under Windows.
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 21302407b76..6d0fc74cdf4 100644
index 0cb3d9bdcb7..70c38ebdf0d 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -1087,6 +1087,7 @@ static DWORD WINAPI start_process( PEB *peb )
@@ -1085,6 +1085,7 @@ static inline DWORD call_process_entry( PEB *peb, LPTHREAD_START_ROUTINE entry )
*/
static DWORD WINAPI start_process( LPTHREAD_START_ROUTINE entry )
{
IMAGE_NT_HEADERS *nt;
LPTHREAD_START_ROUTINE entry;
+ BOOL being_debugged;
PEB *peb = NtCurrentTeb()->Peb;
nt = RtlImageNtHeader( peb->ImageBaseAddress );
entry = (LPTHREAD_START_ROUTINE)((char *)peb->ImageBaseAddress +
@@ -1103,8 +1104,11 @@ static DWORD WINAPI start_process( PEB *peb )
if (!entry)
@@ -1098,8 +1099,11 @@ static DWORD WINAPI start_process( LPTHREAD_START_ROUTINE entry )
DPRINTF( "%04x:Starting process %s (entryproc=%p)\n", GetCurrentThreadId(),
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), entry );
@ -38,7 +38,7 @@ index 21302407b76..6d0fc74cdf4 100644
}
diff --git a/include/winbase.h b/include/winbase.h
index eff59724eb0..0a2a3a334fd 100644
index bf14d790f43..92d112455e9 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -1737,6 +1737,7 @@ WINBASEAPI BOOL WINAPI CancelTimerQueueTimer(HANDLE,HANDLE);

View File

@ -1,4 +1,4 @@
From cca0753b28aba33ad72dcb2245a9fb80720b5bb8 Mon Sep 17 00:00:00 2001
From b4d76755b585f32399ae1a81c6166bda9cea355e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 7 Mar 2015 18:09:37 +0100
Subject: ntdll: Process APC calls before starting process.
@ -8,10 +8,10 @@ Subject: ntdll: Process APC calls before starting process.
1 file changed, 5 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index e1444d2..bab4a2f 100644
index cf758505a4c..165121b689d 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2878,6 +2878,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
@@ -3062,6 +3062,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
@ -19,7 +19,7 @@ index e1444d2..bab4a2f 100644
NTSTATUS status;
WINE_MODREF *wm;
LPCWSTR load_path;
@@ -2921,6 +2922,10 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
@@ -3112,6 +3113,10 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
virtual_release_address_space();
virtual_clear_thread_stack();
@ -27,9 +27,9 @@ index e1444d2..bab4a2f 100644
+ timeout.QuadPart = 0;
+ NtDelayExecution( TRUE, &timeout );
+
wine_switch_to_stack( start_process, kernel_start, NtCurrentTeb()->Tib.StackBase );
wine_switch_to_stack( start_process, &start_params, NtCurrentTeb()->Tib.StackBase );
error:
--
2.3.0
2.11.0

View File

@ -1,43 +1,24 @@
From 2f7c047b2c96b4506599e29ea245516d653582db Mon Sep 17 00:00:00 2001
From 7c039b040883bf9cc22050f2dcb8b70cb9a2e5b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 1 Apr 2015 04:34:20 +0200
Subject: ntdll: Load CLI/.NET images in the same way as Windows XP and above.
---
dlls/kernel32/process.c | 11 ++--
dlls/ntdll/loader.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 133 insertions(+), 10 deletions(-)
dlls/ntdll/loader.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 121 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 6d0fc74cdf4..389e056f9f9 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -1083,17 +1083,12 @@ static inline DWORD call_process_entry( PEB *peb, LPTHREAD_START_ROUTINE entry )
*
* Startup routine of a new process. Runs on the new process stack.
*/
-static DWORD WINAPI start_process( PEB *peb )
+static DWORD WINAPI start_process( LPTHREAD_START_ROUTINE entry )
{
- IMAGE_NT_HEADERS *nt;
- LPTHREAD_START_ROUTINE entry;
+ PEB *peb = NtCurrentTeb()->Peb;
BOOL being_debugged;
- nt = RtlImageNtHeader( peb->ImageBaseAddress );
- entry = (LPTHREAD_START_ROUTINE)((char *)peb->ImageBaseAddress +
- nt->OptionalHeader.AddressOfEntryPoint);
-
- if (!nt->OptionalHeader.AddressOfEntryPoint)
+ if (!entry)
{
ERR( "%s doesn't have an entry point, it cannot be executed\n",
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer) );
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index f1ef7ab1bdd..2eae4f76f21 100644
index cf758505a4c..e796e7552b0 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -104,6 +104,10 @@ static UINT tls_module_count; /* number of modules with TLS directory */
@@ -104,12 +104,17 @@ struct start_params
void *kernel_start;
LPTHREAD_START_ROUTINE entry;
};
+static struct start_params start_params;
static HANDLE main_exe_file;
static UINT tls_module_count; /* number of modules with TLS directory */
static IMAGE_TLS_DIRECTORY *tls_dirs; /* array of TLS directories */
LIST_ENTRY tls_links = { &tls_links, &tls_links };
@ -48,7 +29,7 @@ index f1ef7ab1bdd..2eae4f76f21 100644
static RTL_CRITICAL_SECTION loader_section;
static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{
@@ -337,6 +341,78 @@ static inline ULONG_PTR allocate_stub( const char *dll, const char *name ) { ret
@@ -343,6 +348,78 @@ static inline ULONG_PTR allocate_stub( const char *dll, const char *name ) { ret
/*************************************************************************
@ -127,7 +108,7 @@ index f1ef7ab1bdd..2eae4f76f21 100644
* get_modref
*
* Looks for the referenced HMODULE in the current process
@@ -886,6 +962,10 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
@@ -892,6 +969,10 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
if (!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) return STATUS_SUCCESS; /* already done */
wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS;
@ -138,7 +119,7 @@ index f1ef7ab1bdd..2eae4f76f21 100644
wm->ldr.TlsIndex = alloc_tls_slot( &wm->ldr );
if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
@@ -1090,8 +1170,43 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
@@ -1096,8 +1177,47 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
BOOL retv = FALSE;
/* Skip calls for modules loaded with special load flags */
@ -176,6 +157,10 @@ index f1ef7ab1bdd..2eae4f76f21 100644
+ #else
+ wm->ldr.EntryPoint = (char *)module + nt->OptionalHeader.AddressOfEntryPoint;
+ #endif
+
+ if (!(wm->ldr.Flags & LDR_IMAGE_IS_DLL))
+ start_params.entry = wm->ldr.EntryPoint;
+
+ entry = wm->ldr.EntryPoint;
+ }
+ }
@ -183,28 +168,14 @@ index f1ef7ab1bdd..2eae4f76f21 100644
if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason );
if (!entry || !(wm->ldr.Flags & LDR_IMAGE_IS_DLL)) return STATUS_SUCCESS;
@@ -3044,7 +3159,20 @@ static void load_global_options(void)
*/
static void start_process( void *kernel_start )
{
- call_thread_entry_point( kernel_start, NtCurrentTeb()->Peb );
+ IMAGE_NT_HEADERS *nt;
+ LPTHREAD_START_ROUTINE entry;
+ PEB *peb = NtCurrentTeb()->Peb;
+
+ nt = RtlImageNtHeader( peb->ImageBaseAddress );
+ entry = (LPTHREAD_START_ROUTINE)((char *)peb->ImageBaseAddress +
+ nt->OptionalHeader.AddressOfEntryPoint);
+
+#ifdef __x86_64__
+ if (is_cli_only_image( peb->ImageBaseAddress ))
+ entry = (LPTHREAD_START_ROUTINE)p_CorExeMain;
+#endif
+
+ call_thread_entry_point( kernel_start, entry );
}
@@ -3066,7 +3186,6 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
WINE_MODREF *wm;
LPCWSTR load_path;
PEB *peb = NtCurrentTeb()->Peb;
- struct start_params start_params;
if (main_exe_file) NtClose( main_exe_file ); /* at this point the main module is created */
/******************************************************************
--
2.11.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "6bb8ca1e25a9cfc66f396b2ae6bc423a8057929c"
echo "06c5a9ab55751b1c66ea0847aea4d4a45d8d343c"
}
# Show version information
@ -5198,7 +5198,7 @@ fi
# | * [#38661] Implement proper handling of CLI .NET images in Wine library loader
# |
# | Modified files:
# | * dlls/kernel32/process.c, dlls/ntdll/loader.c
# | * dlls/ntdll/loader.c
# |
if test "$enable_ntdll_CLI_Images" -eq 1; then
patch_apply ntdll-CLI_Images/0001-ntdll-Load-CLI-.NET-images-in-the-same-way-as-Window.patch

View File

@ -1,17 +1,17 @@
From b3515e5f92033c1a785e656eddcba4ffa711f0fc Mon Sep 17 00:00:00 2001
From 7697164372445198d05abf7dc616c25a8189cc49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
---
dlls/d3d10core/tests/device.c | 2 +-
dlls/d3d11/tests/d3d11.c | 4 +-
dlls/d3d11/tests/d3d11.c | 42 ++--
dlls/wined3d/context.c | 10 +
dlls/wined3d/cs.c | 484 +++++++++++++++++++++++++++++++++++++----
dlls/wined3d/query.c | 2 +-
dlls/wined3d/wined3d_main.c | 10 +
dlls/wined3d/wined3d_private.h | 34 ++-
7 files changed, 498 insertions(+), 48 deletions(-)
7 files changed, 517 insertions(+), 67 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index c1dbe9e835f..5ca4a14fa6a 100644
@ -27,10 +27,10 @@ index c1dbe9e835f..5ca4a14fa6a 100644
memset(&data, 0xff, sizeof(data));
hr = ID3D10Asynchronous_GetData(query, &data, sizeof(DWORD), 0);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index da2edc5d2d6..61617d147bb 100644
index 2e67b720f56..c1a99ce0ab9 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4767,7 +4767,7 @@ static void test_occlusion_query(void)
@@ -5245,7 +5245,7 @@ static void test_occlusion_query(void)
memset(&data, 0xff, sizeof(data));
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
@ -39,7 +39,7 @@ index da2edc5d2d6..61617d147bb 100644
memset(&data, 0xff, sizeof(data));
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(DWORD), 0);
@@ -8893,7 +8893,7 @@ static void test_draw_uav_only(void)
@@ -9533,7 +9533,7 @@ static void test_draw_uav_only(void)
draw_quad(&test_context);
draw_quad(&test_context);
draw_quad(&test_context);
@ -48,8 +48,130 @@ index da2edc5d2d6..61617d147bb 100644
ID3D11PixelShader_Release(ps);
ID3D11Texture2D_Release(texture);
@@ -13205,12 +13205,12 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 1.0f, 2);
+ todo_wine check_texture_float(texture, 1.0f, 2);
input.x = 0.5f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 0.5f, 2);
+ todo_wine check_texture_float(texture, 0.5f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13218,19 +13218,19 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_CSSetShader(context, NULL, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 0.5f, 2);
+ todo_wine check_texture_float(texture, 0.5f, 2);
hr = ID3D11Device_CreateComputeShader(device, cs_1_group_code, sizeof(cs_1_group_code), NULL, &cs);
ok(SUCCEEDED(hr), "Failed to create compute shader, hr %#x.\n", hr);
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 2.0f, 2);
+ todo_wine check_texture_float(texture, 2.0f, 2);
input.x = 4.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 4.0f, 2);
+ todo_wine check_texture_float(texture, 4.0f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13241,17 +13241,17 @@ static void test_cs_uav_store(void)
input.x = 1.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, texture_desc.Width, texture_desc.Height, 1);
- check_texture_float(texture, 1.0f, 2);
+ todo_wine check_texture_float(texture, 1.0f, 2);
input.x = 0.5f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 16, 32, 1);
SetRect(&rect, 0, 0, 16, 32);
- check_texture_sub_resource_float(texture, 0, &rect, 0.5f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 0.5f, 2);
SetRect(&rect, 0, 32, texture_desc.Width, texture_desc.Height);
- check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
SetRect(&rect, 16, 0, texture_desc.Width, texture_desc.Height);
- check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13263,16 +13263,16 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 15, 15, 1);
SetRect(&rect, 0, 0, 60, 60);
- check_texture_sub_resource_float(texture, 0, &rect, 0.6f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 0.6f, 2);
SetRect(&rect, 0, 60, texture_desc.Width, texture_desc.Height);
- check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
SetRect(&rect, 60, 0, texture_desc.Width, texture_desc.Height);
- check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
input.x = 0.7f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 16, 16, 1);
- check_texture_float(texture, 0.7f, 2);
+ todo_wine check_texture_float(texture, 0.7f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13283,12 +13283,12 @@ static void test_cs_uav_store(void)
input.x = 0.3f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(texture, 0.3f, 2);
+ todo_wine check_texture_float(texture, 0.3f, 2);
input.x = 0.1f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 2, 2, 2);
- check_texture_float(texture, 0.1f, 2);
+ todo_wine check_texture_float(texture, 0.1f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13441,10 +13441,10 @@ static void test_ps_cs_uav_binding(void)
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(cs_texture, 1.0f, 2);
+ todo_wine check_texture_float(cs_texture, 1.0f, 2);
check_texture_float(ps_texture, 0.0f, 2);
draw_quad(&test_context);
- check_texture_float(cs_texture, 1.0f, 2);
+ todo_wine check_texture_float(cs_texture, 1.0f, 2);
check_texture_float(ps_texture, 1.0f, 2);
input.x = 0.5f;
@@ -13463,10 +13463,10 @@ static void test_ps_cs_uav_binding(void)
input.x = 4.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)ps_cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- check_texture_float(cs_texture, 8.0f, 2);
+ todo_wine check_texture_float(cs_texture, 8.0f, 2);
check_texture_float(ps_texture, 2.0f, 2);
draw_quad(&test_context);
- check_texture_float(cs_texture, 8.0f, 2);
+ todo_wine check_texture_float(cs_texture, 8.0f, 2);
check_texture_float(ps_texture, 4.0f, 2);
ID3D11ComputeShader_Release(cs);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index f2168d66a33..3a728162eb4 100644
index 7f3e30b498d..31725b27c88 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1353,6 +1353,9 @@ void context_release(struct wined3d_context *context)
@ -62,7 +184,7 @@ index f2168d66a33..3a728162eb4 100644
if (!--context->level)
{
if (context_restore_pixel_format(context))
@@ -3694,6 +3697,13 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
@@ -3705,6 +3708,13 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
TRACE("device %p, target %p.\n", device, target);
@ -77,7 +199,7 @@ index f2168d66a33..3a728162eb4 100644
current_context = NULL;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 422f3f1e5df..518db143421 100644
index 1d2870e1f95..5b8c060f928 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -18,14 +18,26 @@
@ -121,7 +243,7 @@ index 422f3f1e5df..518db143421 100644
};
struct wined3d_cs_present
@@ -296,6 +311,14 @@ struct wined3d_cs_query_issue
@@ -297,6 +312,14 @@ struct wined3d_cs_query_issue
DWORD flags;
};
@ -136,7 +258,7 @@ index 422f3f1e5df..518db143421 100644
struct wined3d_cs_preload_resource
{
enum wined3d_cs_op opcode;
@@ -327,7 +350,116 @@ struct wined3d_cs_unmap
@@ -328,7 +351,116 @@ struct wined3d_cs_unmap
HRESULT *hr;
};
@ -254,7 +376,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -343,6 +475,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -344,6 +476,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
wined3d_resource_release(&swapchain->back_buffers[i]->resource);
}
@ -263,7 +385,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -368,13 +502,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -369,13 +503,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
cs->ops->submit(cs);
}
@ -279,7 +401,7 @@ index 422f3f1e5df..518db143421 100644
device = cs->device;
state = &device->state;
@@ -393,6 +528,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -394,6 +529,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
}
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_release(state->fb->depth_stencil->resource);
@ -288,25 +410,25 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -491,7 +628,7 @@ static void release_shader_resources(const struct wined3d_state *state, unsigned
@@ -532,7 +669,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
}
}
-static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
{
struct wined3d_state *state = &cs->device->state;
const struct wined3d_cs_dispatch *op = data;
@@ -499,6 +636,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
op->group_count_x, op->group_count_y, op->group_count_z);
release_shader_resources(&cs->device->state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
@@ -543,6 +680,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
release_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE],
state->unordered_access_view[WINED3D_PIPELINE_COMPUTE]);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -517,7 +656,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -564,7 +703,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -315,16 +437,16 @@ index 422f3f1e5df..518db143421 100644
{
struct wined3d_state *state = &cs->device->state;
const struct wined3d_cs_draw *op = data;
@@ -568,6 +707,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(view->resource);
}
}
@@ -602,6 +741,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
release_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL],
state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx,
@@ -625,12 +766,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
@@ -646,12 +787,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
cs->ops->submit(cs);
}
@ -340,7 +462,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
@@ -645,12 +788,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -666,12 +809,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
cs->ops->submit(cs);
}
@ -356,7 +478,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport)
@@ -664,12 +809,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -685,12 +830,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
cs->ops->submit(cs);
}
@ -372,7 +494,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -683,12 +830,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -704,12 +851,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
cs->ops->submit(cs);
}
@ -388,7 +510,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -704,7 +853,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -725,7 +874,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
cs->ops->submit(cs);
}
@ -397,7 +519,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_depth_stencil_view *op = data;
struct wined3d_device *device = cs->device;
@@ -739,6 +888,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -760,6 +909,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -406,7 +528,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
@@ -752,12 +903,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -773,12 +924,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -422,7 +544,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration)
@@ -771,7 +924,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -792,7 +945,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -431,7 +553,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_stream_source *op = data;
struct wined3d_stream_state *stream;
@@ -789,6 +942,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -810,6 +963,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -440,7 +562,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -806,7 +961,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -827,7 +982,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -449,7 +571,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_stream_source_freq *op = data;
struct wined3d_stream_state *stream;
@@ -816,6 +971,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -837,6 +992,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
stream->flags = op->flags;
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -458,7 +580,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
@@ -831,7 +988,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -852,7 +1009,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs->ops->submit(cs);
}
@ -467,7 +589,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_stream_output *op = data;
struct wined3d_stream_output *stream;
@@ -846,6 +1003,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -867,6 +1024,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedIncrement(&op->buffer->resource.bind_count);
if (prev)
InterlockedDecrement(&prev->resource.bind_count);
@ -476,7 +598,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -862,7 +1021,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -883,7 +1042,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -485,7 +607,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_index_buffer *op = data;
struct wined3d_buffer *prev;
@@ -878,6 +1037,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -899,6 +1058,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_INDEXBUFFER);
@ -494,7 +616,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -894,7 +1055,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -915,7 +1076,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs->ops->submit(cs);
}
@ -503,7 +625,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_constant_buffer *op = data;
struct wined3d_buffer *prev;
@@ -908,6 +1069,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -929,6 +1090,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type));
@ -511,7 +633,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -924,7 +1086,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -945,7 +1107,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
cs->ops->submit(cs);
}
@ -520,7 +642,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
@@ -1001,6 +1163,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1022,6 +1184,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
if (new_use_color_key)
device_invalidate_state(cs->device, STATE_COLOR_KEY);
@ -529,7 +651,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
@@ -1015,13 +1179,15 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1036,13 +1200,15 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -545,8 +667,8 @@ index 422f3f1e5df..518db143421 100644
+ return sizeof(*op);
}
void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -1037,7 +1203,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1059,7 +1225,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
cs->ops->submit(cs);
}
@ -555,16 +677,16 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_unordered_access_view *op = data;
struct wined3d_unordered_access_view *prev;
@@ -1051,6 +1217,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
@@ -1073,6 +1239,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
InterlockedDecrement(&prev->resource->bind_count);
device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING);
device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline));
+
+ return sizeof(*op);
}
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1067,12 +1235,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline,
@@ -1089,12 +1257,14 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
cs->ops->submit(cs);
}
@ -580,7 +702,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1089,7 +1259,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1111,7 +1281,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -589,7 +711,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_shader *op = data;
@@ -1097,6 +1267,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1119,6 +1289,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
device_invalidate_state(cs->device, STATE_SHADER(op->type));
if (op->type != WINED3D_SHADER_TYPE_COMPUTE)
device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING);
@ -598,7 +720,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
@@ -1111,12 +1283,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1133,12 +1305,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -614,7 +736,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1131,12 +1305,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1153,12 +1327,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -630,7 +752,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
@@ -1151,12 +1327,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1173,12 +1349,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
cs->ops->submit(cs);
}
@ -646,7 +768,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1173,12 +1351,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1195,12 +1373,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
cs->ops->submit(cs);
}
@ -662,7 +784,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1195,13 +1375,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1217,13 +1397,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
cs->ops->submit(cs);
}
@ -679,7 +801,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state,
@@ -1217,12 +1399,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1239,12 +1421,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
cs->ops->submit(cs);
}
@ -695,7 +817,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
@@ -1237,7 +1421,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1259,7 +1443,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
cs->ops->submit(cs);
}
@ -704,7 +826,7 @@ index 422f3f1e5df..518db143421 100644
{
const struct wined3d_cs_set_color_key *op = data;
struct wined3d_texture *texture = op->texture;
@@ -1298,6 +1482,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -1320,6 +1504,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -713,7 +835,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -1320,12 +1506,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1342,12 +1528,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs);
}
@ -729,7 +851,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material)
@@ -1339,7 +1527,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1361,7 +1549,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
cs->ops->submit(cs);
}
@ -738,7 +860,7 @@ index 422f3f1e5df..518db143421 100644
{
struct wined3d_adapter *adapter = cs->device->adapter;
@@ -1347,6 +1535,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1369,6 +1557,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
memset(&cs->state, 0, sizeof(cs->state));
state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
@ -747,7 +869,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1359,11 +1549,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1381,11 +1571,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -762,7 +884,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object)
@@ -1378,12 +1570,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
@@ -1400,12 +1592,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
cs->ops->submit(cs);
}
@ -778,7 +900,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1398,13 +1592,41 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1420,13 +1614,41 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
@ -821,7 +943,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1420,13 +1642,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1442,13 +1664,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -838,7 +960,7 @@ index 422f3f1e5df..518db143421 100644
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1442,13 +1666,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1464,13 +1688,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -855,7 +977,7 @@ index 422f3f1e5df..518db143421 100644
}
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
@@ -1466,17 +1692,19 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1488,17 +1714,19 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
op->flags = flags;
op->hr = &hr;
@ -877,7 +999,7 @@ index 422f3f1e5df..518db143421 100644
}
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx)
@@ -1490,13 +1718,35 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1512,13 +1740,35 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
op->sub_resource_idx = sub_resource_idx;
op->hr = &hr;
@ -915,7 +1037,7 @@ index 422f3f1e5df..518db143421 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch,
@@ -1528,10 +1778,12 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1550,10 +1800,12 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
/* WINED3D_CS_OP_DESTROY_OBJECT */ wined3d_cs_exec_destroy_object,
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
@ -928,7 +1050,7 @@ index 422f3f1e5df..518db143421 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1605,9 +1857,113 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1627,9 +1879,113 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
{
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
@ -1042,7 +1164,7 @@ index 422f3f1e5df..518db143421 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -1637,12 +1993,64 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1659,12 +2015,64 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -1121,7 +1243,7 @@ index 3bdba105105..abb4a664c1a 100644
if (data)
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index 2085864bc7f..01eb71a89e7 100644
index e7962465279..a8409cfd4b8 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -90,6 +90,7 @@ struct wined3d_settings wined3d_settings =
@ -1151,7 +1273,7 @@ index 2085864bc7f..01eb71a89e7 100644
if (hkey) RegCloseKey( hkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d93befa13bb..2ab0aca10ab 100644
index 09797950295..b2655c381ce 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -306,6 +306,7 @@ struct wined3d_settings
@ -1162,7 +1284,7 @@ index d93befa13bb..2ab0aca10ab 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2730,11 +2731,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2744,11 +2745,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -1174,7 +1296,7 @@ index d93befa13bb..2ab0aca10ab 100644
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
enum wined3d_resource_type type, const struct wined3d_format *format,
@@ -3144,10 +3140,23 @@ enum wined3d_push_constants
@@ -3158,10 +3154,23 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -1198,7 +1320,7 @@ index d93befa13bb..2ab0aca10ab 100644
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants);
};
@@ -3158,11 +3167,22 @@ struct wined3d_cs
@@ -3172,11 +3181,22 @@ struct wined3d_cs
struct wined3d_device *device;
struct wined3d_fb_state fb;
struct wined3d_state state;
@ -1222,7 +1344,7 @@ index d93befa13bb..2ab0aca10ab 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
@@ -3174,10 +3194,12 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -3188,10 +3208,12 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;

View File

@ -1,16 +1,16 @@
From c17d78b9e0ee2ea345d74cfc1bb5b76c97ea4623 Mon Sep 17 00:00:00 2001
From 52baf7a72c18b2949f3a6552ec38ffe7ef1c1451 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
---
dlls/wined3d/cs.c | 78 ++++++++++++++++++++++++++++--------------
dlls/wined3d/cs.c | 76 +++++++++++++++++++++++++++++-------------
dlls/wined3d/device.c | 4 +++
dlls/wined3d/wined3d_private.h | 4 ++-
3 files changed, 60 insertions(+), 26 deletions(-)
3 files changed, 59 insertions(+), 25 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b832b7e0733..e9d238d262f 100644
index 9501609da1f..a0c32dd65f8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -76,6 +76,7 @@ enum wined3d_cs_op
@ -21,7 +21,7 @@ index b832b7e0733..e9d238d262f 100644
WINED3D_CS_OP_STOP,
};
@@ -376,6 +377,12 @@ struct wined3d_cs_push_constants
@@ -377,6 +378,12 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
@ -34,7 +34,7 @@ index b832b7e0733..e9d238d262f 100644
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
@@ -522,7 +529,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -523,7 +530,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
device = cs->device;
@ -43,29 +43,25 @@ index b832b7e0733..e9d238d262f 100644
wined3d_get_draw_rect(state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&device->fb, op->rect_count, op->rects, &draw_rect, op->flags,
@@ -642,10 +649,10 @@ static UINT wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
@@ -681,7 +688,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
static UINT wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
{
- struct wined3d_state *state = &cs->device->state;
+ struct wined3d_state *state = &cs->state;
const struct wined3d_cs_dispatch *op = data;
- dispatch_compute(cs->device, &cs->device->state,
+ dispatch_compute(cs->device, &cs->state,
op->group_count_x, op->group_count_y, op->group_count_z);
- release_shader_resources(&cs->device->state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
+ release_shader_resources(&cs->state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
return sizeof(*op);
}
@@ -668,7 +675,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
dispatch_compute(cs->device, state,
@@ -715,7 +722,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
- struct wined3d_state *state = &cs->device->state;
+ struct wined3d_state *state = &cs->state;
const struct wined3d_cs_draw *op = data;
struct wined3d_shader *shader;
unsigned int i;
@@ -1189,6 +1196,34 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1210,6 +1217,34 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -100,7 +96,7 @@ index b832b7e0733..e9d238d262f 100644
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_shader_resource_view *op = data;
@@ -1854,6 +1889,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1878,6 +1913,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
@ -108,7 +104,7 @@ index b832b7e0733..e9d238d262f 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1998,6 +2034,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2022,6 +2058,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@ -116,7 +112,7 @@ index b832b7e0733..e9d238d262f 100644
if (!(cs->fb.render_targets = wined3d_calloc(gl_info->limits.buffers, sizeof(*cs->fb.render_targets))))
{
@@ -2013,21 +2050,12 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2037,21 +2074,12 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
@ -140,7 +136,7 @@ index b832b7e0733..e9d238d262f 100644
}
if (wined3d_settings.cs_multithreaded)
@@ -2040,17 +2068,19 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2064,17 +2092,19 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
{
ERR("Failed to create wined3d command stream thread.\n");
@ -167,7 +163,7 @@ index b832b7e0733..e9d238d262f 100644
}
void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2075,9 +2105,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2099,9 +2129,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
#endif
}
@ -179,10 +175,10 @@ index b832b7e0733..e9d238d262f 100644
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 831f36c9870..268d1e93857 100644
index df80b784749..35b107306c0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3648,6 +3648,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3662,6 +3662,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
{
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
@ -190,7 +186,7 @@ index 831f36c9870..268d1e93857 100644
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3659,6 +3660,7 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
@@ -3673,6 +3674,7 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
TRACE("device %p, start_vertex %u, vertex_count %u, start_instance %u, instance_count %u.\n",
device, start_vertex, vertex_count, start_instance, instance_count);
@ -198,7 +194,7 @@ index 831f36c9870..268d1e93857 100644
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, start_instance, instance_count, FALSE);
}
@@ -3676,6 +3678,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3690,6 +3692,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL;
}
@ -206,7 +202,7 @@ index 831f36c9870..268d1e93857 100644
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3687,6 +3690,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3701,6 +3704,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
@ -215,10 +211,10 @@ index 831f36c9870..268d1e93857 100644
start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e7437a38023..0085339d6a8 100644
index 03cbdf7daae..1c7f8ecad73 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3124,7 +3124,7 @@ struct wined3d_cs_block
@@ -3163,7 +3163,7 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -227,7 +223,7 @@ index e7437a38023..0085339d6a8 100644
};
struct wined3d_cs_ops
@@ -3182,6 +3182,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -3221,6 +3221,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From c0bc4f7688ba8dbc3458d78237d4b2b998901c40 Mon Sep 17 00:00:00 2001
From 72a55c637885a2362af6c091a82bf9e0b0f313bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@ -6,15 +6,15 @@ Subject: wined3d: Send blits through the command stream.
This needs more work. This patch breaks error handling, and the split
between surface_blt and surface_blt_ugly isn't particularly nice.
---
dlls/d3d11/tests/d3d11.c | 2 +-
dlls/d3d11/tests/d3d11.c | 6 +-
dlls/wined3d/cs.c | 54 +++++++++
dlls/wined3d/device.c | 26 +++++
dlls/wined3d/surface.c | 249 +++++++++++++++++++++++++----------------
dlls/wined3d/wined3d_private.h | 7 ++
5 files changed, 240 insertions(+), 98 deletions(-)
5 files changed, 242 insertions(+), 100 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 40e0241a463..eb67dfc07fd 100644
index c1a99ce0ab9..a05dcb1fae3 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -9533,7 +9533,7 @@ static void test_draw_uav_only(void)
@ -26,8 +26,21 @@ index 40e0241a463..eb67dfc07fd 100644
ID3D11PixelShader_Release(ps);
ID3D11Texture2D_Release(texture);
@@ -13463,10 +13463,10 @@ static void test_ps_cs_uav_binding(void)
input.x = 4.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)ps_cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(cs_texture, 8.0f, 2);
+ check_texture_float(cs_texture, 8.0f, 2);
check_texture_float(ps_texture, 2.0f, 2);
draw_quad(&test_context);
- todo_wine check_texture_float(cs_texture, 8.0f, 2);
+ check_texture_float(cs_texture, 8.0f, 2);
check_texture_float(ps_texture, 4.0f, 2);
ID3D11ComputeShader_Release(cs);
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e738c6ff058..30020d62c0c 100644
index 1fa4fe7eb83..ceef9294cd8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -79,6 +79,7 @@ enum wined3d_cs_op
@ -38,7 +51,7 @@ index e738c6ff058..30020d62c0c 100644
WINED3D_CS_OP_STOP,
};
@@ -398,6 +399,18 @@ struct wined3d_cs_set_light_enable
@@ -399,6 +400,18 @@ struct wined3d_cs_set_light_enable
BOOL enable;
};
@ -57,7 +70,7 @@ index e738c6ff058..30020d62c0c 100644
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
@@ -2028,6 +2041,46 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -2052,6 +2065,46 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
cs->ops->submit(cs);
}
@ -104,7 +117,7 @@ index e738c6ff058..30020d62c0c 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -2072,6 +2125,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2096,6 +2149,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
/* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@ -113,10 +126,10 @@ index e738c6ff058..30020d62c0c 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 71701a816da..e1a02212900 100644
index 07543965df2..5ae2d202c83 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4070,6 +4070,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4084,6 +4084,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
struct wined3d_texture *dst_texture, *src_texture;
RECT dst_rect, src_rect;
HRESULT hr;
@ -124,7 +137,7 @@ index 71701a816da..e1a02212900 100644
TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
"src_resource %p, src_sub_resource_idx %u, src_box %s.\n",
@@ -4157,6 +4158,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4171,6 +4172,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
@ -139,7 +152,7 @@ index 71701a816da..e1a02212900 100644
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4170,6 +4179,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4184,6 +4193,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left),
dst_y + (src_rect.bottom - src_rect.top));
@ -164,10 +177,10 @@ index 71701a816da..e1a02212900 100644
src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3369d8777df..e19f63db4c2 100644
index 4fe16917296..4ddcdcb58b8 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3886,7 +3886,7 @@ const struct blit_shader cpu_blit = {
@@ -3891,7 +3891,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@ -176,7 +189,7 @@ index 3369d8777df..e19f63db4c2 100644
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
@@ -3896,9 +3896,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3901,9 +3901,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
@ -188,7 +201,7 @@ index 3369d8777df..e19f63db4c2 100644
DWORD src_ds_flags, dst_ds_flags;
BOOL scale, convert;
@@ -3911,84 +3910,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3916,84 +3915,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
| WINED3D_BLT_DO_NOT_WAIT
| WINED3D_BLT_ALPHA_TEST;
@ -278,7 +291,7 @@ index 3369d8777df..e19f63db4c2 100644
}
if (!device->d3d_initialized)
@@ -4013,11 +3945,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4018,11 +3950,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
}
@ -290,7 +303,7 @@ index 3369d8777df..e19f63db4c2 100644
dst_swapchain = dst_texture->swapchain;
/* This isn't strictly needed. FBO blits for example could deal with
@@ -4053,22 +3980,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4058,22 +3985,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth))
@ -316,7 +329,7 @@ index 3369d8777df..e19f63db4c2 100644
}
}
else
@@ -4104,7 +4025,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4109,7 +4030,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color)))
@ -325,7 +338,7 @@ index 3369d8777df..e19f63db4c2 100644
}
else
{
@@ -4147,7 +4068,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4152,7 +4073,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context, dst_texture->resource.draw_binding);
context_release(context);
}
@ -334,7 +347,7 @@ index 3369d8777df..e19f63db4c2 100644
}
}
}
@@ -4171,7 +4092,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4176,7 +4097,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -343,7 +356,7 @@ index 3369d8777df..e19f63db4c2 100644
}
if (fbo_blit_supported(&device->adapter->gl_info, blit_op,
@@ -4192,7 +4113,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4197,7 +4118,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
~dst_texture->resource.draw_binding);
@ -352,7 +365,7 @@ index 3369d8777df..e19f63db4c2 100644
}
blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
@@ -4202,7 +4123,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4207,7 +4128,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
{
blitter->blit_surface(device, blit_op, filter, src_surface,
src_rect, dst_surface, dst_rect, color_key);
@ -361,7 +374,7 @@ index 3369d8777df..e19f63db4c2 100644
}
}
}
@@ -4210,9 +4131,143 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4215,9 +4136,143 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
fallback:
/* Special cases for render targets. */
if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter)))
@ -508,10 +521,10 @@ index 3369d8777df..e19f63db4c2 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c28dd691a14..84c592249aa 100644
index d8fcecb82d9..605e2bf50d0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2991,6 +2991,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3030,6 +3030,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@ -521,7 +534,7 @@ index c28dd691a14..84c592249aa 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -3161,6 +3164,10 @@ static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
@@ -3200,6 +3203,10 @@ static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 8a285168481d772c9c1f7be5441359fb16a88505 Mon Sep 17 00:00:00 2001
From b8980974b1117ed0b1b792118e64265d2de984ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:29:42 +0200
Subject: wined3d: Create dummy textures through the CS.
@ -6,13 +6,127 @@ Subject: wined3d: Create dummy textures through the CS.
Hacky version. Just good enough to see if the double context during init is what makes fglrx
crash.
---
dlls/d3d11/tests/d3d11.c | 34 +++++++++++++++++-----------------
dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++
dlls/wined3d/device.c | 10 ++++------
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 34 insertions(+), 6 deletions(-)
4 files changed, 51 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 045e2fa54f2..2e67b720f56 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -13205,12 +13205,12 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 1.0f, 2);
+ check_texture_float(texture, 1.0f, 2);
input.x = 0.5f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 0.5f, 2);
+ check_texture_float(texture, 0.5f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13218,19 +13218,19 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_CSSetShader(context, NULL, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 0.5f, 2);
+ check_texture_float(texture, 0.5f, 2);
hr = ID3D11Device_CreateComputeShader(device, cs_1_group_code, sizeof(cs_1_group_code), NULL, &cs);
ok(SUCCEEDED(hr), "Failed to create compute shader, hr %#x.\n", hr);
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 2.0f, 2);
+ check_texture_float(texture, 2.0f, 2);
input.x = 4.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 4.0f, 2);
+ check_texture_float(texture, 4.0f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13241,17 +13241,17 @@ static void test_cs_uav_store(void)
input.x = 1.0f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, texture_desc.Width, texture_desc.Height, 1);
- todo_wine check_texture_float(texture, 1.0f, 2);
+ check_texture_float(texture, 1.0f, 2);
input.x = 0.5f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 16, 32, 1);
SetRect(&rect, 0, 0, 16, 32);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 0.5f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 0.5f, 2);
SetRect(&rect, 0, 32, texture_desc.Width, texture_desc.Height);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
SetRect(&rect, 16, 0, texture_desc.Width, texture_desc.Height);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13263,16 +13263,16 @@ static void test_cs_uav_store(void)
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 15, 15, 1);
SetRect(&rect, 0, 0, 60, 60);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 0.6f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 0.6f, 2);
SetRect(&rect, 0, 60, texture_desc.Width, texture_desc.Height);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
SetRect(&rect, 60, 0, texture_desc.Width, texture_desc.Height);
- todo_wine check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
+ check_texture_sub_resource_float(texture, 0, &rect, 1.0f, 2);
input.x = 0.7f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 16, 16, 1);
- todo_wine check_texture_float(texture, 0.7f, 2);
+ check_texture_float(texture, 0.7f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13283,12 +13283,12 @@ static void test_cs_uav_store(void)
input.x = 0.3f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(texture, 0.3f, 2);
+ check_texture_float(texture, 0.3f, 2);
input.x = 0.1f;
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
ID3D11DeviceContext_Dispatch(context, 2, 2, 2);
- todo_wine check_texture_float(texture, 0.1f, 2);
+ check_texture_float(texture, 0.1f, 2);
ID3D11ComputeShader_Release(cs);
@@ -13441,10 +13441,10 @@ static void test_ps_cs_uav_binding(void)
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
- todo_wine check_texture_float(cs_texture, 1.0f, 2);
+ check_texture_float(cs_texture, 1.0f, 2);
check_texture_float(ps_texture, 0.0f, 2);
draw_quad(&test_context);
- todo_wine check_texture_float(cs_texture, 1.0f, 2);
+ check_texture_float(cs_texture, 1.0f, 2);
check_texture_float(ps_texture, 1.0f, 2);
input.x = 0.5f;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index abc509b6e3b..4316e1b767b 100644
index 9b267871a37..3a6bfe4d38a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -85,6 +85,7 @@ enum wined3d_cs_op
@ -23,7 +137,7 @@ index abc509b6e3b..4316e1b767b 100644
WINED3D_CS_OP_STOP,
};
@@ -451,6 +452,11 @@ struct wined3d_cs_get_release_dc
@@ -452,6 +453,11 @@ struct wined3d_cs_get_release_dc
HRESULT *hr;
};
@ -35,7 +149,7 @@ index abc509b6e3b..4316e1b767b 100644
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
@@ -2299,6 +2305,27 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2323,6 +2329,27 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -63,7 +177,7 @@ index abc509b6e3b..4316e1b767b 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -2349,6 +2376,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2373,6 +2400,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
@ -72,7 +186,7 @@ index abc509b6e3b..4316e1b767b 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7ad88637f08..f3b74bb5a45 100644
index b62d3ba473f..4f5a45c1f60 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -607,7 +607,7 @@ out:
@ -104,7 +218,7 @@ index 7ad88637f08..f3b74bb5a45 100644
/* Clear the screen */
if (swapchain->back_buffers && swapchain->back_buffers[0])
clear_flags |= WINED3DCLEAR_TARGET;
@@ -4752,7 +4750,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4758,7 +4756,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
swapchain->context[0] = context;
swapchain->num_contexts = 1;
@ -114,10 +228,10 @@ index 7ad88637f08..f3b74bb5a45 100644
context_release(context);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index a2b8a9ebf92..9d8268e8b32 100644
index 1ccb02544ce..e6d349b8186 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2633,6 +2633,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -2672,6 +2672,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN;
@ -125,7 +239,7 @@ index a2b8a9ebf92..9d8268e8b32 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3180,6 +3181,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -3219,6 +3220,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
const struct blit_shader *blitter) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 905a31e15556a725e6ab9ee0e8e32d46474a820b Mon Sep 17 00:00:00 2001
From 089e84881f1704b8280ee66ec74a06d641b07450 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@ -41,7 +41,7 @@ index 85ed462c78d..1191a6d5873 100644
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 3a728162eb4..bc27695c08e 100644
index 31725b27c88..c1cbaa677a0 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1726,6 +1726,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@ -117,7 +117,7 @@ index 3a728162eb4..bc27695c08e 100644
}
static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum)
@@ -3507,7 +3518,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
@@ -3506,7 +3517,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
const struct wined3d_device *device, const struct wined3d_state *state)
{
const struct StateEntry *state_table = context->state_table;
@ -127,10 +127,10 @@ index 3a728162eb4..bc27695c08e 100644
WORD map;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 553a58b7219..947ed482eca 100644
index 4778b73b0dc..6d1ab033b4d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -621,7 +621,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -622,7 +622,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
wined3d_swapchain_set_window(swapchain, op->dst_window_override);
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags,
@ -139,7 +139,7 @@ index 553a58b7219..947ed482eca 100644
InterlockedDecrement(&cs->pending_presents);
@@ -684,19 +684,19 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -685,19 +685,19 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
state = &cs->state;
wined3d_get_draw_rect(state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
@ -163,7 +163,7 @@ index 553a58b7219..947ed482eca 100644
return size;
}
@@ -721,12 +721,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -722,12 +722,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
{
for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i)
{
@ -179,7 +179,7 @@ index 553a58b7219..947ed482eca 100644
cs->ops->submit(cs);
}
@@ -856,11 +856,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -902,11 +902,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
}
for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i)
{
@ -193,9 +193,9 @@ index 553a58b7219..947ed482eca 100644
+ if (state->fb.depth_stencil)
+ wined3d_resource_release(state->fb.depth_stencil->resource);
release_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
if ((shader = state->shader[WINED3D_SHADER_TYPE_PIXEL]))
{
@@ -911,11 +911,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL],
state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]);
@@ -944,11 +944,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
}
for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i)
{
@ -209,9 +209,9 @@ index 553a58b7219..947ed482eca 100644
+ if (state->fb.depth_stencil)
+ wined3d_resource_acquire(state->fb.depth_stencil->resource);
acquire_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
if ((shader = state->shader[WINED3D_SHADER_TYPE_PIXEL]))
{
@@ -1003,7 +1003,7 @@ static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v
acquire_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL],
state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]);
@@ -1024,7 +1024,7 @@ static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v
{
const struct wined3d_cs_set_rendertarget_view *op = data;
@ -220,7 +220,7 @@ index 553a58b7219..947ed482eca 100644
device_invalidate_state(cs->device, STATE_FRAMEBUFFER);
return sizeof(*op);
@@ -1028,7 +1028,7 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -1049,7 +1049,7 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
struct wined3d_device *device = cs->device;
struct wined3d_rendertarget_view *prev;
@ -229,7 +229,7 @@ index 553a58b7219..947ed482eca 100644
{
struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev);
@@ -1040,7 +1040,7 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -1061,7 +1061,7 @@ static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
}
@ -238,7 +238,7 @@ index 553a58b7219..947ed482eca 100644
if (!prev != !op->view)
{
@@ -1699,11 +1699,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1721,11 +1721,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
struct wined3d_adapter *adapter = cs->device->adapter;
@ -254,7 +254,7 @@ index 553a58b7219..947ed482eca 100644
return sizeof(struct wined3d_cs_reset_state);
}
@@ -2793,15 +2795,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2815,15 +2817,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
cs->tls_idx = TLS_OUT_OF_INDEXES;
@ -272,7 +272,7 @@ index 553a58b7219..947ed482eca 100644
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@@ -2834,7 +2834,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2856,7 +2856,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
err:
state_cleanup(&cs->state);
if (cs->tls_idx != TLS_OUT_OF_INDEXES) TlsFree(cs->tls_idx);
@ -280,7 +280,7 @@ index 553a58b7219..947ed482eca 100644
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
@@ -2863,7 +2862,6 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2885,7 +2884,6 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
}
TlsFree(cs->tls_idx);
@ -289,7 +289,7 @@ index 553a58b7219..947ed482eca 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4ae48f5de17..7c6b5052ecf 100644
index c0f6f0421bb..c643b111aa2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -955,7 +955,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@ -389,7 +389,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
return;
if (src_view->resource->type == WINED3D_RTYPE_BUFFER)
{
@@ -3447,6 +3422,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3537,6 +3512,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@ -398,7 +398,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, debug_color(color), depth, stencil);
@@ -3458,7 +3435,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3548,7 +3525,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@ -407,7 +407,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3467,8 +3444,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3557,8 +3534,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -418,7 +418,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3818,8 +3795,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3908,8 +3885,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -429,7 +429,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4254,20 +4231,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4344,20 +4321,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@ -453,7 +453,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4304,13 +4282,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4394,13 +4372,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@ -469,7 +469,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4322,18 +4300,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4412,18 +4390,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -491,7 +491,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4680,10 +4659,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4770,10 +4749,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@ -503,7 +503,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4694,6 +4672,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4784,6 +4762,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (reset_state)
{
@ -515,7 +515,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Enumerating resource %p.\n", resource);
@@ -4858,27 +4841,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4952,27 +4935,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
@ -551,7 +551,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4970,11 +4954,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -5064,11 +5048,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -565,7 +565,7 @@ index 4ae48f5de17..7c6b5052ecf 100644
ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
}
@@ -5100,8 +5084,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5194,8 +5178,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
@ -594,10 +594,10 @@ index 49804131efb..28b4c5a48da 100644
struct wined3d_event_query *ib_query = NULL;
struct wined3d_rendertarget_view *dsv, *rtv;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index bc041179b55..985261b6a73 100644
index 82e9fb7ea30..88dc4ee9cc6 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1612,7 +1612,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1629,7 +1629,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
const struct wined3d_vec4 correction_params =
{
/* Position is relative to the framebuffer, not the viewport. */
@ -607,10 +607,10 @@ index bc041179b55..985261b6a73 100644
0.0f,
0.0f,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 490c985acf1..b84e43d6294 100644
index 814da178862..09ebbfa53c6 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -3219,7 +3219,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
@@ -3231,7 +3231,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
UINT i;
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
@ -620,7 +620,7 @@ index 490c985acf1..b84e43d6294 100644
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 2e556c798fd..66e4eb4fd89 100644
index d1884c8e354..985e24fb2d1 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -152,7 +152,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@ -724,7 +724,7 @@ index 2e556c798fd..66e4eb4fd89 100644
else
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index ed39a15c7be..913d630cf97 100644
index 8221b99977d..3c7b4b8a664 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -431,6 +431,7 @@ void state_unbind_resources(struct wined3d_state *state)
@ -735,8 +735,8 @@ index ed39a15c7be..913d630cf97 100644
unsigned int i, j;
if ((decl = state->vertex_declaration))
@@ -516,6 +517,31 @@ void state_unbind_resources(struct wined3d_state *state)
wined3d_unordered_access_view_decref(uav);
@@ -519,6 +520,31 @@ void state_unbind_resources(struct wined3d_state *state)
}
}
}
+
@ -767,7 +767,7 @@ index ed39a15c7be..913d630cf97 100644
}
void state_cleanup(struct wined3d_state *state)
@@ -540,6 +566,8 @@ void state_cleanup(struct wined3d_state *state)
@@ -543,6 +569,8 @@ void state_cleanup(struct wined3d_state *state)
HeapFree(GetProcessHeap(), 0, light);
}
}
@ -776,7 +776,7 @@ index ed39a15c7be..913d630cf97 100644
}
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
@@ -1254,32 +1282,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1257,32 +1285,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
}
}
@ -837,10 +837,10 @@ index e65630fafc8..c5ad5bd8475 100644
struct wined3d_texture *src_texture;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index d1c5ef51fd5..cffe9f43b42 100644
index dde75a36be5..718808861bc 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4645,7 +4645,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
@@ -4651,7 +4651,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
float y_offset = flip
? (center_offset - (2.0f * y) - h) / h
: (center_offset - (2.0f * y) - h) / -h;
@ -849,7 +849,7 @@ index d1c5ef51fd5..cffe9f43b42 100644
state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f;
float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f;
@@ -5444,7 +5444,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
@@ -5450,7 +5450,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
break;
}
}
@ -859,10 +859,10 @@ index d1c5ef51fd5..cffe9f43b42 100644
|| !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f0777c9bd34..811fb28e2c9 100644
index ad8a3516ac7..8fc67581cf2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1540,6 +1540,36 @@ struct wined3d_timestamp_query
@@ -1552,6 +1552,36 @@ struct wined3d_timestamp_query
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
@ -899,7 +899,7 @@ index f0777c9bd34..811fb28e2c9 100644
struct wined3d_context
{
const struct wined3d_gl_info *gl_info;
@@ -1555,6 +1585,7 @@ struct wined3d_context
@@ -1567,6 +1597,7 @@ struct wined3d_context
DWORD numDirtyEntries;
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
unsigned int dirty_compute_states[STATE_COMPUTE_COUNT / (sizeof(unsigned int) * CHAR_BIT) + 1];
@ -907,7 +907,7 @@ index f0777c9bd34..811fb28e2c9 100644
struct wined3d_device *device;
struct wined3d_swapchain *swapchain;
@@ -1667,12 +1698,6 @@ struct wined3d_context
@@ -1680,12 +1711,6 @@ struct wined3d_context
GLuint dummy_arbfp_prog;
};
@ -920,7 +920,7 @@ index f0777c9bd34..811fb28e2c9 100644
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
@@ -2494,7 +2519,7 @@ struct wined3d_stream_state
@@ -2508,7 +2533,7 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
@ -929,7 +929,7 @@ index f0777c9bd34..811fb28e2c9 100644
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2608,7 +2633,6 @@ struct wined3d_device
@@ -2622,7 +2647,6 @@ struct wined3d_device
struct wine_rb_tree samplers;
/* Render Target Support */
@ -937,7 +937,7 @@ index f0777c9bd34..811fb28e2c9 100644
struct wined3d_rendertarget_view *auto_depth_stencil_view;
/* For rendering to a texture using glCopyTexImage */
@@ -3150,9 +3174,8 @@ struct wined3d_stateblock
@@ -3164,9 +3188,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -949,7 +949,7 @@ index f0777c9bd34..811fb28e2c9 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
enum wined3d_push_constants
@@ -3188,7 +3211,6 @@ struct wined3d_cs
@@ -3202,7 +3225,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@ -1,4 +1,4 @@
From 74653b2cabe0b7abbab5682cbd0bf7e2c9b94d06 Mon Sep 17 00:00:00 2001
From 520d1bc8ae2e65db6244cf3b2c5115d1cfcc519e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 7 Feb 2017 22:37:58 +0100
Subject: wined3d: Map vertex buffers through cs.
@ -10,7 +10,7 @@ Subject: wined3d: Map vertex buffers through cs.
3 files changed, 76 insertions(+), 44 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 36b07d1a54a..4cbab2a91f8 100644
index 359f0ad4645..38e465b8f04 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -94,6 +94,7 @@ enum wined3d_cs_op
@ -21,7 +21,7 @@ index 36b07d1a54a..4cbab2a91f8 100644
WINED3D_CS_OP_STOP,
};
@@ -525,6 +526,13 @@ struct wined3d_cs_delete_gl_contexts
@@ -526,6 +527,13 @@ struct wined3d_cs_delete_gl_contexts
struct wined3d_swapchain *swapchain;
};
@ -35,7 +35,7 @@ index 36b07d1a54a..4cbab2a91f8 100644
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
@@ -2623,6 +2631,70 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3
@@ -2639,6 +2647,70 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3
cs->ops->submit_and_wait(cs);
}
@ -106,7 +106,7 @@ index 36b07d1a54a..4cbab2a91f8 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -2682,6 +2754,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2698,6 +2770,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CREATE_BUFFER_TEXTURE */ wined3d_cs_exec_create_buffer_texture,
/* WINED3D_CS_OP_CREATE_TEXTURE_VIEW */ wined3d_cs_exec_create_texture_view,
/* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts,
@ -115,18 +115,18 @@ index 36b07d1a54a..4cbab2a91f8 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b990682a921..1bafbcac067 100644
index b392878e2f9..44ac8ccef42 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2837,7 +2837,6 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic
wined3d_unordered_access_view_decref(prev);
@@ -2851,7 +2851,6 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic
wined3d_device_set_pipeline_unordered_access_view(device, WINED3D_PIPELINE_GRAPHICS, idx, uav);
}
-/* Context activation is done by the caller. */
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount,
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags,
@@ -3113,14 +3112,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
@@ -3127,14 +3126,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer,
const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
{
@ -141,7 +141,7 @@ index b990682a921..1bafbcac067 100644
TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, "
"dst_buffer %p, declaration %p, flags %#x, dst_fvf %#x.\n",
@@ -3130,47 +3123,11 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
@@ -3144,47 +3137,11 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
if (declaration)
FIXME("Output vertex declaration not implemented yet.\n");
@ -191,10 +191,10 @@ index b990682a921..1bafbcac067 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7035d537604..110fbfde605 100644
index 6063aa7f390..d47aa20d5a4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3316,6 +3316,8 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -3355,6 +3355,8 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN;
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From c612edbd14f4a5911b7900ebeffd8b99841974cc Mon Sep 17 00:00:00 2001
From d72fe8de3a880d62366abaa28dd2b1abc00adffd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 00:12:31 +0100
Subject: wined3d: Introduce a separate priority queue.
@ -9,10 +9,10 @@ Subject: wined3d: Introduce a separate priority queue.
2 files changed, 79 insertions(+), 68 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 31c82b1b68c..2a255060dc4 100644
index 6761e958cb8..dd018fee2cb 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -563,14 +563,16 @@ static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *
@@ -564,14 +564,16 @@ static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *
return LIST_ENTRY(head, struct wined3d_cs_block, entry);
}
@ -31,7 +31,7 @@ index 31c82b1b68c..2a255060dc4 100644
return block;
}
}
@@ -591,7 +593,7 @@ static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wine
@@ -592,7 +594,7 @@ static void wined3d_cs_set_thread_block(const struct wined3d_cs *cs, struct wine
ERR("Failed to set thread block.\n");
}
@ -40,7 +40,7 @@ index 31c82b1b68c..2a255060dc4 100644
{
struct wined3d_cs_block *block;
@@ -605,6 +607,7 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
@@ -606,6 +608,7 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
}
block->pos = 0;
@ -48,7 +48,7 @@ index 31c82b1b68c..2a255060dc4 100644
return block;
}
@@ -624,7 +627,7 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
@@ -625,7 +628,7 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
*signalled = FALSE;
@ -57,7 +57,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_FENCE;
op->signalled = signalled;
}
@@ -659,7 +662,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -660,7 +663,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
unsigned int i;
LONG pending;
@ -66,7 +66,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_PRESENT;
op->dst_window_override = dst_window_override;
op->swapchain = swapchain;
@@ -726,7 +729,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -727,7 +730,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
struct wined3d_cs_clear *op;
unsigned int i;
@ -75,8 +75,8 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -832,7 +835,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
{
@@ -877,7 +880,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_dispatch *op;
- op = cs->ops->require_space(cs, sizeof(*op));
@ -84,7 +84,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_DISPATCH;
op->group_count_x = group_count_x;
op->group_count_y = group_count_y;
@@ -906,7 +909,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
@@ -939,7 +942,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
struct wined3d_cs_draw *op;
unsigned int i;
@ -93,7 +93,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_DRAW;
op->base_vertex_idx = base_vertex_idx;
op->start_idx = start_idx;
@@ -967,7 +970,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -988,7 +991,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
{
struct wined3d_cs_set_predication *op;
@ -102,7 +102,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_PREDICATION;
op->predicate = predicate;
op->value = value;
@@ -989,7 +992,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -1010,7 +1013,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
{
struct wined3d_cs_set_viewport *op;
@ -111,7 +111,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@@ -1010,7 +1013,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -1031,7 +1034,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
{
struct wined3d_cs_set_scissor_rect *op;
@ -120,7 +120,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@@ -1032,7 +1035,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -1053,7 +1056,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
{
struct wined3d_cs_set_rendertarget_view *op;
@ -129,7 +129,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_RENDERTARGET_VIEW;
op->view_idx = view_idx;
op->view = view;
@@ -1083,7 +1086,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -1104,7 +1107,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_depth_stencil_view *op;
@ -138,7 +138,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@@ -1104,7 +1107,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1125,7 +1128,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_vertex_declaration *op;
@ -147,7 +147,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@@ -1138,7 +1141,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1159,7 +1162,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_source *op;
@ -156,7 +156,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1166,7 +1169,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1187,7 +1190,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
{
struct wined3d_cs_set_stream_source_freq *op;
@ -165,7 +165,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ;
op->stream_idx = stream_idx;
op->frequency = frequency;
@@ -1199,7 +1202,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1220,7 +1223,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_output *op;
@ -174,7 +174,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_OUTPUT;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1233,7 +1236,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1254,7 +1257,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
{
struct wined3d_cs_set_index_buffer *op;
@ -183,7 +183,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_INDEX_BUFFER;
op->buffer = buffer;
op->format_id = format_id;
@@ -1264,7 +1267,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1285,7 +1288,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
{
struct wined3d_cs_set_constant_buffer *op;
@ -192,7 +192,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_CONSTANT_BUFFER;
op->type = type;
op->cb_idx = cb_idx;
@@ -1358,7 +1361,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1379,7 +1382,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
{
struct wined3d_cs_set_texture *op;
@ -201,16 +201,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@@ -1381,7 +1384,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i
{
struct wined3d_cs_set_unordered_access_view *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW;
op->view_idx = view_idx;
op->view = view;
@@ -1412,7 +1415,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1403,7 +1406,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
{
struct wined3d_cs_set_shader_resource_view *op;
@ -219,7 +210,16 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW;
op->type = type;
op->view_idx = view_idx;
@@ -1436,7 +1439,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1435,7 +1438,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
{
struct wined3d_cs_set_unordered_access_view *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW;
op->pipeline = pipeline;
op->view_idx = view_idx;
@@ -1459,7 +1462,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_sampler *op;
@ -228,7 +228,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER;
op->type = type;
op->sampler_idx = sampler_idx;
@@ -1460,7 +1463,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1484,7 +1487,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_shader *op;
@ -237,7 +237,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_SHADER;
op->type = type;
op->shader = shader;
@@ -1483,7 +1486,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1507,7 +1510,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
{
struct wined3d_cs_set_rasterizer_state *op;
@ -246,7 +246,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@@ -1504,7 +1507,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1528,7 +1531,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
{
struct wined3d_cs_set_render_state *op;
@ -255,7 +255,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_RENDER_STATE;
op->state = state;
op->value = value;
@@ -1527,7 +1530,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1551,7 +1554,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
{
struct wined3d_cs_set_texture_state *op;
@ -264,7 +264,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE_STATE;
op->stage = stage;
op->state = state;
@@ -1551,7 +1554,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1575,7 +1578,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
{
struct wined3d_cs_set_sampler_state *op;
@ -273,7 +273,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE;
op->sampler_idx = sampler_idx;
op->state = state;
@@ -1576,7 +1579,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1600,7 +1603,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
{
struct wined3d_cs_set_transform *op;
@ -282,7 +282,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_TRANSFORM;
op->state = state;
op->matrix = *matrix;
@@ -1598,7 +1601,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1622,7 +1625,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
{
struct wined3d_cs_set_clip_plane *op;
@ -291,7 +291,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE;
op->plane_idx = plane_idx;
op->plane = *plane;
@@ -1676,7 +1679,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1700,7 +1703,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
{
struct wined3d_cs_set_color_key *op;
@ -300,7 +300,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_COLOR_KEY;
op->texture = texture;
op->flags = flags;
@@ -1705,7 +1708,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1729,7 +1732,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
{
struct wined3d_cs_set_material *op;
@ -309,7 +309,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@@ -1730,7 +1733,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1754,7 +1757,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
{
struct wined3d_cs_reset_state *op;
@ -318,7 +318,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_RESET_STATE;
cs->ops->submit(cs);
@@ -1749,7 +1752,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
@@ -1773,7 +1776,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
{
struct wined3d_cs_destroy_object *op;
@ -327,7 +327,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_DESTROY_OBJECT;
op->callback = callback;
op->object = object;
@@ -1771,7 +1774,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1795,7 +1798,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
{
struct wined3d_cs_query_issue *op;
@ -336,7 +336,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
op->query = query;
op->flags = flags;
@@ -1794,7 +1797,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1818,7 +1821,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
struct wined3d_cs_query_poll *op;
BOOL ret;
@ -345,7 +345,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_QUERY_POLL;
op->query = query;
op->flags = flags;
@@ -1820,7 +1823,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1844,7 +1847,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_preload_resource *op;
@ -354,7 +354,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1844,7 +1847,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1868,7 +1871,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
{
struct wined3d_cs_unload_resource *op;
@ -363,7 +363,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1870,7 +1873,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1894,7 +1897,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
@ -372,7 +372,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_MAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1899,7 +1902,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1923,7 +1926,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
@ -381,7 +381,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_UNMAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1925,7 +1928,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1949,7 +1952,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
{
struct wined3d_cs_finish *op;
@ -390,7 +390,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_GLFINISH;
cs->ops->submit(cs);
@@ -1982,7 +1985,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2006,7 +2009,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
{
struct wined3d_cs_push_constants *op;
@ -399,7 +399,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
op->p = p;
op->start_idx = start_idx;
@@ -2011,7 +2014,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -2035,7 +2038,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
{
struct wined3d_cs_set_primitive_type *op;
@ -408,7 +408,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@@ -2071,7 +2074,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -2095,7 +2098,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
{
struct wined3d_cs_set_light *op;
@ -417,7 +417,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@@ -2160,7 +2163,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -2184,7 +2187,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
{
struct wined3d_cs_set_light_enable *op;
@ -426,7 +426,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
op->idx = idx;
op->enable = enable;
@@ -2190,7 +2193,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -2214,7 +2217,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
{
struct wined3d_cs_blt *op;
@ -435,7 +435,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_BLT;
op->dst_surface = dst_surface;
op->dst_rect = *dst_rect;
@@ -2229,7 +2232,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2253,7 +2256,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
{
struct wined3d_cs_clear_rtv *op;
@ -444,7 +444,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CLEAR_RTV;
op->view = view;
op->rect = *rect;
@@ -2265,7 +2268,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2289,7 +2292,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
{
struct wined3d_cs_update_texture *op;
@ -453,7 +453,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE;
op->src = src;
op->dst = dst;
@@ -2339,7 +2342,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2355,7 +2358,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
{
struct wined3d_cs_update_sub_resource *op;
@ -462,7 +462,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -2368,7 +2371,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
@@ -2384,7 +2387,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -471,7 +471,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_GET_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2394,7 +2397,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2410,7 +2413,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -480,7 +480,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_RELEASE_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2420,7 +2423,7 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs)
@@ -2436,7 +2439,7 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs)
{
struct wined3d_cs_create_dummy_textures *op;
@ -489,7 +489,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CREATE_DUMMY_TEXTURES;
cs->ops->submit_and_wait(cs);
@@ -2440,7 +2443,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
@@ -2456,7 +2459,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
struct wined3d_cs_create_swapchain_context *op;
HRESULT hr;
@ -498,7 +498,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT;
op->swapchain = swapchain;
op->hr = &hr;
@@ -2463,7 +2466,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2479,7 +2482,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
{
struct wined3d_cs_update_swap_interval *op;
@ -507,7 +507,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL;
op->swapchain = swapchain;
@@ -2483,7 +2486,7 @@ void wined3d_cs_emit_sampler_init(struct wined3d_cs *cs, struct wined3d_sampler
@@ -2499,7 +2502,7 @@ void wined3d_cs_emit_sampler_init(struct wined3d_cs *cs, struct wined3d_sampler
{
struct wined3d_cs_sampler_init *op;
@ -516,7 +516,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_SAMPLER_INIT;
op->sampler = sampler;
@@ -2521,7 +2524,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2537,7 +2540,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
if (dirty_region)
WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
@ -525,7 +525,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2551,7 +2554,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
@@ -2567,7 +2570,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
{
struct wined3d_cs_buffer_copy *op;
@ -534,7 +534,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_BUFFER_COPY;
op->dst_buffer = dst_buffer;
op->dst_offset = dst_offset;
@@ -2579,7 +2582,7 @@ void wined3d_cs_emit_create_buffer_texture(struct wined3d_cs *cs, struct wined3d
@@ -2595,7 +2598,7 @@ void wined3d_cs_emit_create_buffer_texture(struct wined3d_cs *cs, struct wined3d
{
struct wined3d_cs_create_buffer_texture *op;
@ -543,7 +543,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CREATE_BUFFER_TEXTURE;
op->view = view;
op->buffer = buffer;
@@ -2603,7 +2606,7 @@ void wined3d_cs_emit_create_texture_view(struct wined3d_cs *cs, struct wined3d_g
@@ -2619,7 +2622,7 @@ void wined3d_cs_emit_create_texture_view(struct wined3d_cs *cs, struct wined3d_g
{
struct wined3d_cs_create_texture_view *op;
@ -552,7 +552,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_CREATE_TEXTURE_VIEW;
op->view = view;
op->view_target = view_target;
@@ -2627,7 +2630,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3
@@ -2643,7 +2646,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_delete_gl_contexts *op;
@ -561,7 +561,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS;
op->swapchain = swapchain;
@@ -2690,7 +2693,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
@@ -2706,7 +2709,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
{
struct wined3d_cs_map_vertex_buffers *op;
@ -570,7 +570,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_MAP_vertex_buffers;
op->src_start_idx = src_start_idx;
op->stream_info = stream_info;
@@ -2760,7 +2763,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2776,7 +2779,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP_vertex_buffers */ wined3d_cs_exec_map_vertex_buffers,
};
@ -579,7 +579,7 @@ index 31c82b1b68c..2a255060dc4 100644
{
if (size > cs->data_size)
{
@@ -2791,9 +2794,10 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2807,9 +2810,10 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -591,7 +591,7 @@ index 31c82b1b68c..2a255060dc4 100644
void *data;
assert(size <= sizeof(block->data));
@@ -2801,8 +2805,11 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
@@ -2817,8 +2821,11 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
if (!block || block->pos + size > sizeof(block->data))
{
if (block)
@ -604,7 +604,7 @@ index 31c82b1b68c..2a255060dc4 100644
wined3d_cs_set_thread_block(cs, block);
}
@@ -2820,7 +2827,7 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs)
@@ -2836,7 +2843,7 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs)
if (cs->thread_id == GetCurrentThreadId())
wined3d_cs_process_block(cs, block);
else
@ -613,7 +613,7 @@ index 31c82b1b68c..2a255060dc4 100644
}
static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2850,7 +2857,7 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
@@ -2866,7 +2873,7 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
assert(cs->thread_id != GetCurrentThreadId());
@ -622,7 +622,7 @@ index 31c82b1b68c..2a255060dc4 100644
op->opcode = WINED3D_CS_OP_STOP;
wined3d_cs_mt_submit(cs);
@@ -2886,7 +2893,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
@@ -2902,7 +2909,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
for (;;)
{
struct wined3d_cs_block *block;
@ -631,7 +631,7 @@ index 31c82b1b68c..2a255060dc4 100644
if (!wined3d_cs_process_block(cs, block))
break;
}
@@ -2930,6 +2937,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2946,6 +2953,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
wined3d_cs_list_init(&cs->free_list);
wined3d_cs_list_init(&cs->exec_list);
@ -639,7 +639,7 @@ index 31c82b1b68c..2a255060dc4 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
{
@@ -2965,6 +2973,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2981,6 +2989,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
/* FIXME: Cleanup the block lists on thread exit. */
#if 0
@ -648,10 +648,10 @@ index 31c82b1b68c..2a255060dc4 100644
wined3d_cs_list_cleanup(&cs->free_list);
#endif
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index a99a4513cef..04241073afe 100644
index a22bca662f5..1d8be3e89d9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3176,12 +3176,13 @@ struct wined3d_cs_block
@@ -3215,12 +3215,13 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -666,7 +666,7 @@ index a99a4513cef..04241073afe 100644
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);
};
@@ -3199,6 +3200,7 @@ struct wined3d_cs
@@ -3238,6 +3239,7 @@ struct wined3d_cs
struct wined3d_cs_list free_list;
struct wined3d_cs_list exec_list;

View File

@ -1,4 +1,4 @@
From 89cc09a36e085038a253e08566bbc170403d058f Mon Sep 17 00:00:00 2001
From e1eaf7bf2dd1a7bfedad34b222aaa83423781191 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 12:32:55 +0100
Subject: wined3d: Do not immediately submit stateblock updates.
@ -8,10 +8,10 @@ Subject: wined3d: Do not immediately submit stateblock updates.
1 file changed, 58 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index dc1dfad5207..da20da75a36 100644
index 6ea1ef1b089..e108ab0bcbc 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1000,8 +1000,6 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -1021,8 +1021,6 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
op->opcode = WINED3D_CS_OP_SET_PREDICATION;
op->predicate = predicate;
op->value = value;
@ -20,7 +20,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -1021,8 +1019,6 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -1042,8 +1040,6 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@ -29,7 +29,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -1042,8 +1038,6 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -1063,8 +1059,6 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@ -38,7 +38,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -1065,8 +1059,6 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -1086,8 +1080,6 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
op->opcode = WINED3D_CS_OP_SET_RENDERTARGET_VIEW;
op->view_idx = view_idx;
op->view = view;
@ -47,7 +47,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -1115,8 +1107,6 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -1136,8 +1128,6 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@ -56,7 +56,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -1136,8 +1126,6 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1157,8 +1147,6 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@ -65,7 +65,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -1173,8 +1161,6 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1194,8 +1182,6 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
op->buffer = buffer;
op->offset = offset;
op->stride = stride;
@ -74,7 +74,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -1200,8 +1186,6 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1221,8 +1207,6 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
op->stream_idx = stream_idx;
op->frequency = frequency;
op->flags = flags;
@ -83,7 +83,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -1233,8 +1217,6 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1254,8 +1238,6 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
op->stream_idx = stream_idx;
op->buffer = buffer;
op->offset = offset;
@ -92,7 +92,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -1267,8 +1249,6 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1288,8 +1270,6 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->buffer = buffer;
op->format_id = format_id;
op->offset = offset;
@ -101,7 +101,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -1298,8 +1278,6 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1319,8 +1299,6 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
op->type = type;
op->cb_idx = cb_idx;
op->buffer = buffer;
@ -110,7 +110,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1391,8 +1369,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1412,8 +1390,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -119,16 +119,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1414,8 +1390,6 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i
op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW;
op->view_idx = view_idx;
op->view = view;
-
- cs->ops->submit(cs);
}
static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data)
@@ -1446,8 +1420,6 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1437,8 +1413,6 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
op->type = type;
op->view_idx = view_idx;
op->view = view;
@ -136,8 +127,17 @@ index dc1dfad5207..da20da75a36 100644
- cs->ops->submit(cs);
}
static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data)
@@ -1469,8 +1443,6 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
op->pipeline = pipeline;
op->view_idx = view_idx;
op->view = view;
-
- cs->ops->submit(cs);
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1470,8 +1442,6 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1493,8 +1465,6 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
op->type = type;
op->sampler_idx = sampler_idx;
op->sampler = sampler;
@ -146,7 +146,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1493,8 +1463,6 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1517,8 +1487,6 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
op->opcode = WINED3D_CS_OP_SET_SHADER;
op->type = type;
op->shader = shader;
@ -155,7 +155,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data)
@@ -1515,8 +1483,6 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1539,8 +1507,6 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@ -164,7 +164,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1537,8 +1503,6 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1561,8 +1527,6 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
op->opcode = WINED3D_CS_OP_SET_RENDER_STATE;
op->state = state;
op->value = value;
@ -173,7 +173,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1561,8 +1525,6 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1585,8 +1549,6 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
op->stage = stage;
op->state = state;
op->value = value;
@ -182,7 +182,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1585,8 +1547,6 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1609,8 +1571,6 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
op->sampler_idx = sampler_idx;
op->state = state;
op->value = value;
@ -191,7 +191,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1609,8 +1569,6 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1633,8 +1593,6 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
op->opcode = WINED3D_CS_OP_SET_TRANSFORM;
op->state = state;
op->matrix = *matrix;
@ -200,7 +200,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1631,8 +1589,6 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1655,8 +1613,6 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE;
op->plane_idx = plane_idx;
op->plane = *plane;
@ -209,7 +209,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1716,8 +1672,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1740,8 +1696,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
}
else
op->set = 0;
@ -218,7 +218,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1737,8 +1691,6 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1761,8 +1715,6 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@ -227,7 +227,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1761,8 +1713,6 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1785,8 +1737,6 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_RESET_STATE;
@ -236,7 +236,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_destroy_object(struct wined3d_cs *cs, const void *data)
@@ -2021,8 +1971,6 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2045,8 +1995,6 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
op->start_idx = start_idx;
op->count = count;
memcpy(op->constants, constants, count * push_constant_info[p].size);
@ -245,7 +245,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -2047,8 +1995,6 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -2071,8 +2019,6 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@ -254,7 +254,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -2107,8 +2053,6 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -2131,8 +2077,6 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@ -263,7 +263,7 @@ index dc1dfad5207..da20da75a36 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -2197,8 +2141,6 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -2221,8 +2165,6 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
op->idx = idx;
op->enable = enable;

File diff suppressed because it is too large Load Diff