Rebase against 797c037bff2f7621f5b3d632bd899349529d6b2b.

This commit is contained in:
Sebastian Lackner 2015-07-28 20:47:45 +02:00
parent 2393fd2c7e
commit 74f4d7b45e
13 changed files with 149 additions and 1216 deletions

View File

@ -1,77 +0,0 @@
From 7871b72dcbf44cd8bb63ace950aa69fcfa8adcbe Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 23:23:57 +0200
Subject: ntdll/tests: Add basic tests for RtlQueueWorkItem.
---
dlls/ntdll/tests/threadpool.c | 47 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c
index c69902b..7be3f0d 100644
--- a/dlls/ntdll/tests/threadpool.c
+++ b/dlls/ntdll/tests/threadpool.c
@@ -98,6 +98,51 @@ static BOOL init_threadpool(void)
#undef NTDLL_GET_PROC
+static DWORD CALLBACK rtl_work_cb(void *userdata)
+{
+ HANDLE semaphore = userdata;
+ trace("Running rtl_work callback\n");
+ ReleaseSemaphore(semaphore, 1, NULL);
+ return 0;
+}
+
+static void test_RtlQueueWorkItem(void)
+{
+ HANDLE semaphore;
+ NTSTATUS status;
+ DWORD result;
+
+ semaphore = CreateSemaphoreA(NULL, 0, 1, NULL);
+ ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError());
+
+ status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEDEFAULT);
+ ok(!status, "RtlQueueWorkItem failed with status %x\n", status);
+ result = WaitForSingleObject(semaphore, 1000);
+ ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
+
+ status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINIOTHREAD);
+ ok(!status, "RtlQueueWorkItem failed with status %x\n", status);
+ result = WaitForSingleObject(semaphore, 1000);
+ ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
+
+ status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINPERSISTENTTHREAD);
+ ok(!status, "RtlQueueWorkItem failed with status %x\n", status);
+ result = WaitForSingleObject(semaphore, 1000);
+ ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
+
+ status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTELONGFUNCTION);
+ ok(!status, "RtlQueueWorkItem failed with status %x\n", status);
+ result = WaitForSingleObject(semaphore, 1000);
+ ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
+
+ status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_TRANSFER_IMPERSONATION);
+ ok(!status, "RtlQueueWorkItem failed with status %x\n", status);
+ result = WaitForSingleObject(semaphore, 1000);
+ ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
+
+ CloseHandle(semaphore);
+}
+
static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
{
HANDLE semaphore = userdata;
@@ -1292,6 +1337,8 @@ static void test_tp_multi_wait(void)
START_TEST(threadpool)
{
+ test_RtlQueueWorkItem();
+
if (!init_threadpool())
return;
--
2.4.5

View File

@ -1,220 +0,0 @@
From 9c243efb0149efa8d6b46555e36ab2c3d379769f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 23:24:06 +0200
Subject: ntdll: Reimplement RtlQueueWorkItem on top of new threadpool API.
---
dlls/ntdll/threadpool.c | 143 +++++++++---------------------------------------
1 file changed, 27 insertions(+), 116 deletions(-)
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
index 23091f3..ad4951f 100644
--- a/dlls/ntdll/threadpool.c
+++ b/dlls/ntdll/threadpool.c
@@ -42,44 +42,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(threadpool);
* Old thread pooling API
*/
-#define OLD_WORKER_TIMEOUT 30000 /* 30 seconds */
+struct rtl_work_item
+{
+ PRTL_WORK_ITEM_ROUTINE function;
+ PVOID context;
+};
+
#define EXPIRE_NEVER (~(ULONGLONG)0)
#define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */
-static RTL_CRITICAL_SECTION_DEBUG critsect_debug;
static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug;
static struct
{
- /* threadpool_cs must be held while modifying the following four elements */
- struct list work_item_list;
- LONG num_workers;
- LONG num_busy_workers;
- LONG num_items_processed;
- RTL_CONDITION_VARIABLE threadpool_cond;
- RTL_CRITICAL_SECTION threadpool_cs;
HANDLE compl_port;
RTL_CRITICAL_SECTION threadpool_compl_cs;
}
old_threadpool =
{
- LIST_INIT(old_threadpool.work_item_list), /* work_item_list */
- 0, /* num_workers */
- 0, /* num_busy_workers */
- 0, /* num_items_processed */
- RTL_CONDITION_VARIABLE_INIT, /* threadpool_cond */
- { &critsect_debug, -1, 0, 0, 0, 0 }, /* threadpool_cs */
NULL, /* compl_port */
{ &critsect_compl_debug, -1, 0, 0, 0, 0 }, /* threadpool_compl_cs */
};
-static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
-{
- 0, 0, &old_threadpool.threadpool_cs,
- { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_cs") }
-};
-
static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug =
{
0, 0, &old_threadpool.threadpool_compl_cs,
@@ -87,13 +71,6 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug =
0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_compl_cs") }
};
-struct work_item
-{
- struct list entry;
- PRTL_WORK_ITEM_ROUTINE function;
- PVOID context;
-};
-
struct wait_work_item
{
HANDLE Object;
@@ -364,47 +341,14 @@ static inline LONG interlocked_dec( PLONG dest )
return interlocked_xchg_add( dest, -1 ) - 1;
}
-static void WINAPI worker_thread_proc(void * param)
+static void CALLBACK process_rtl_work_item( TP_CALLBACK_INSTANCE *instance, void *userdata )
{
- struct list *item;
- struct work_item *work_item_ptr, work_item;
- LARGE_INTEGER timeout;
- timeout.QuadPart = -(OLD_WORKER_TIMEOUT * (ULONGLONG)10000);
-
- RtlEnterCriticalSection( &old_threadpool.threadpool_cs );
- old_threadpool.num_workers++;
-
- for (;;)
- {
- if ((item = list_head( &old_threadpool.work_item_list )))
- {
- work_item_ptr = LIST_ENTRY( item, struct work_item, entry );
- list_remove( &work_item_ptr->entry );
- old_threadpool.num_busy_workers++;
- old_threadpool.num_items_processed++;
- RtlLeaveCriticalSection( &old_threadpool.threadpool_cs );
-
- /* copy item to stack and do the work */
- work_item = *work_item_ptr;
- RtlFreeHeap( GetProcessHeap(), 0, work_item_ptr );
- TRACE("executing %p(%p)\n", work_item.function, work_item.context);
- work_item.function( work_item.context );
-
- RtlEnterCriticalSection( &old_threadpool.threadpool_cs );
- old_threadpool.num_busy_workers--;
- }
- else if (RtlSleepConditionVariableCS( &old_threadpool.threadpool_cond,
- &old_threadpool.threadpool_cs, &timeout ) != STATUS_SUCCESS)
- {
- break;
- }
- }
+ struct rtl_work_item *item = userdata;
- old_threadpool.num_workers--;
- RtlLeaveCriticalSection( &old_threadpool.threadpool_cs );
- RtlExitUserThread( 0 );
+ TRACE("executing %p(%p)\n", item->function, item->context);
+ item->function( item->context );
- /* never reached */
+ RtlFreeHeap( GetProcessHeap(), 0, item );
}
/***********************************************************************
@@ -413,9 +357,9 @@ static void WINAPI worker_thread_proc(void * param)
* Queues a work item into a thread in the thread pool.
*
* PARAMS
- * Function [I] Work function to execute.
- * Context [I] Context to pass to the work function when it is executed.
- * Flags [I] Flags. See notes.
+ * function [I] Work function to execute.
+ * context [I] Context to pass to the work function when it is executed.
+ * flags [I] Flags. See notes.
*
* RETURNS
* Success: STATUS_SUCCESS.
@@ -429,59 +373,26 @@ static void WINAPI worker_thread_proc(void * param)
*|WT_EXECUTELONGFUNCTION - Hints that the execution can take a long time.
*|WT_TRANSFER_IMPERSONATION - Executes the function with the current access token.
*/
-NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE Function, PVOID Context, ULONG Flags)
+NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context, ULONG flags )
{
- HANDLE thread;
+ TP_CALLBACK_ENVIRON environment;
+ struct rtl_work_item *item;
NTSTATUS status;
- LONG items_processed;
- struct work_item *work_item = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(struct work_item));
- if (!work_item)
+ item = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*item) );
+ if (!item)
return STATUS_NO_MEMORY;
- work_item->function = Function;
- work_item->context = Context;
-
- if (Flags & ~WT_EXECUTELONGFUNCTION)
- FIXME("Flags 0x%x not supported\n", Flags);
-
- RtlEnterCriticalSection( &old_threadpool.threadpool_cs );
- list_add_tail( &old_threadpool.work_item_list, &work_item->entry );
- status = (old_threadpool.num_workers > old_threadpool.num_busy_workers) ?
- STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
- items_processed = old_threadpool.num_items_processed;
- RtlLeaveCriticalSection( &old_threadpool.threadpool_cs );
-
- /* FIXME: tune this algorithm to not be as aggressive with creating threads
- * if WT_EXECUTELONGFUNCTION isn't specified */
- if (status == STATUS_SUCCESS)
- RtlWakeConditionVariable( &old_threadpool.threadpool_cond );
- else
- {
- status = RtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, NULL, 0, 0,
- worker_thread_proc, NULL, &thread, NULL );
+ memset( &environment, 0, sizeof(environment) );
+ environment.Version = 1;
+ environment.u.s.LongFunction = (flags & WT_EXECUTELONGFUNCTION) != 0;
+ environment.u.s.Persistent = (flags & WT_EXECUTEINPERSISTENTTHREAD) != 0;
- /* NOTE: we don't care if we couldn't create the thread if there is at
- * least one other available to process the request */
- if (status == STATUS_SUCCESS)
- NtClose( thread );
- else
- {
- RtlEnterCriticalSection( &old_threadpool.threadpool_cs );
- if (old_threadpool.num_workers > 0 ||
- old_threadpool.num_items_processed != items_processed)
- {
- status = STATUS_SUCCESS;
- }
- else
- list_remove( &work_item->entry );
- RtlLeaveCriticalSection( &old_threadpool.threadpool_cs );
-
- if (status != STATUS_SUCCESS)
- RtlFreeHeap( GetProcessHeap(), 0, work_item );
- }
- }
+ item->function = function;
+ item->context = context;
+ status = TpSimpleTryPost( process_rtl_work_item, item, &environment );
+ if (status) RtlFreeHeap( GetProcessHeap(), 0, item );
return status;
}
--
2.4.5

View File

@ -55,7 +55,7 @@ version()
echo "Copyright (C) 2014-2015 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
echo " commit 4e6e9a14852298fe8c17f2666a16d5484cbe50b3"
echo " commit 797c037bff2f7621f5b3d632bd899349529d6b2b"
echo ""
}
@ -176,7 +176,6 @@ patch_enable_all ()
enable_ntdll_ThreadQuerySetWin32StartAddress="$1"
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
enable_ntdll_Threadpool_Cleanup="$1"
enable_ntdll_User_Shared_Data="$1"
enable_ntdll_WRITECOPY="$1"
enable_ntdll_WinSqm="$1"
@ -605,9 +604,6 @@ patch_enable ()
ntdll-Threading)
enable_ntdll_Threading="$2"
;;
ntdll-Threadpool_Cleanup)
enable_ntdll_Threadpool_Cleanup="$2"
;;
ntdll-User_Shared_Data)
enable_ntdll_User_Shared_Data="$2"
;;
@ -2000,6 +1996,23 @@ if test "$enable_Staging" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
# | * [#15980] GetSecurityInfo returns NULL DACL for process object
# |
# | Modified files:
# | * dlls/advapi32/tests/security.c, server/process.c, server/security.h, server/token.c
# |
if test "$enable_server_Misc_ACL" -eq 1; then
patch_apply server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch
patch_apply server-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch
(
echo '+ { "Erich E. Hoover", "server: Add default security descriptor ownership for processes.", 1 },';
echo '+ { "Erich E. Hoover", "server: Add default security descriptor DACL for processes.", 1 },';
) >> "$patchlist"
fi
# Patchset server-CreateProcess_ACLs
# |
# | This patchset fixes the following Wine bugs:
@ -2019,23 +2032,6 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
# | * [#15980] GetSecurityInfo returns NULL DACL for process object
# |
# | Modified files:
# | * dlls/advapi32/tests/security.c, server/process.c, server/security.h, server/token.c
# |
if test "$enable_server_Misc_ACL" -eq 1; then
patch_apply server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch
patch_apply server-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch
(
echo '+ { "Erich E. Hoover", "server: Add default security descriptor ownership for processes.", 1 },';
echo '+ { "Erich E. Hoover", "server: Add default security descriptor DACL for processes.", 1 },';
) >> "$patchlist"
fi
# Patchset advapi32-LsaLookupSids
# |
# | Modified files:
@ -3733,20 +3729,6 @@ if test "$enable_ntdll_Threading" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-Threadpool_Cleanup
# |
# | Modified files:
# | * dlls/ntdll/tests/threadpool.c, dlls/ntdll/threadpool.c
# |
if test "$enable_ntdll_Threadpool_Cleanup" -eq 1; then
patch_apply ntdll-Threadpool_Cleanup/0001-ntdll-tests-Add-basic-tests-for-RtlQueueWorkItem.patch
patch_apply ntdll-Threadpool_Cleanup/0002-ntdll-Reimplement-RtlQueueWorkItem-on-top-of-new-thr.patch
(
echo '+ { "Sebastian Lackner", "ntdll/tests: Add basic tests for RtlQueueWorkItem.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: Reimplement RtlQueueWorkItem on top of new threadpool API.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-User_Shared_Data
# |
# | Modified files:
@ -4688,21 +4670,9 @@ fi
# | dlls/vcomp90/vcomp90.spec
# |
if test "$enable_vcomp_Functions" -eq 1; then
patch_apply vcomp-Functions/0001-vcomp-Implement-32-bit-atomic-integer-functions.patch
patch_apply vcomp-Functions/0002-vcomp-tests-Add-tests-for-32-bit-atomic-integer-func.patch
patch_apply vcomp-Functions/0003-vcomp-Implement-atomic-float-functions.patch
patch_apply vcomp-Functions/0004-vcomp-tests-Add-tests-for-atomic-float-functions.patch
patch_apply vcomp-Functions/0005-vcomp-Implement-atomic-double-functions.patch
patch_apply vcomp-Functions/0006-vcomp-tests-Add-tests-for-atomic-double-functions.patch
patch_apply vcomp-Functions/0007-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch
patch_apply vcomp-Functions/0008-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch
patch_apply vcomp-Functions/0001-vcomp-Implement-_vcomp_for_dynamic_init-and-_vcomp_f.patch
patch_apply vcomp-Functions/0002-vcomp-tests-Add-tests-for-_vcomp_for_dynamic_init.patch
(
echo '+ { "Sebastian Lackner", "vcomp: Implement 32-bit atomic integer functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for 32-bit atomic integer functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp: Implement atomic float functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for atomic float functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp: Implement atomic double functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for atomic double functions.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp: Implement _vcomp_for_dynamic_init and _vcomp_for_dynamic_next.", 1 },';
echo '+ { "Sebastian Lackner", "vcomp/tests: Add tests for _vcomp_for_dynamic_init.", 1 },';
) >> "$patchlist"

View File

@ -1,166 +0,0 @@
From 6f3f0538fc92bc42e942353a446df3afdb395a19 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 01:53:56 +0200
Subject: vcomp: Implement 32-bit atomic integer functions.
---
dlls/vcomp/main.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
dlls/vcomp/vcomp.spec | 22 ++++++++---------
2 files changed, 76 insertions(+), 11 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index ae5623b..6f0caf6 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -22,6 +22,7 @@
*/
#include "config.h"
+#include "wine/port.h"
#include <stdarg.h>
#include <assert.h>
@@ -221,6 +222,70 @@ static void vcomp_free_thread_data(void)
vcomp_set_thread_data(NULL);
}
+void CDECL _vcomp_atomic_add_i4(int *dest, int val)
+{
+ interlocked_xchg_add(dest, val);
+}
+
+void CDECL _vcomp_atomic_and_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old & val, old) != old);
+}
+
+void CDECL _vcomp_atomic_div_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old / val, old) != old);
+}
+
+void CDECL _vcomp_atomic_div_ui4(unsigned int *dest, unsigned int val)
+{
+ unsigned int old;
+ do old = *dest; while (interlocked_cmpxchg((int *)dest, old / val, old) != old);
+}
+
+void CDECL _vcomp_atomic_mul_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old * val, old) != old);
+}
+
+void CDECL _vcomp_atomic_or_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old | val, old) != old);
+}
+
+void CDECL _vcomp_atomic_shl_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old << val, old) != old);
+}
+
+void CDECL _vcomp_atomic_shr_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old >> val, old) != old);
+}
+
+void CDECL _vcomp_atomic_shr_ui4(unsigned int *dest, unsigned int val)
+{
+ unsigned int old;
+ do old = *dest; while (interlocked_cmpxchg((int *)dest, old >> val, old) != old);
+}
+
+void CDECL _vcomp_atomic_sub_i4(int *dest, int val)
+{
+ interlocked_xchg_add(dest, -val);
+}
+
+void CDECL _vcomp_atomic_xor_i4(int *dest, int val)
+{
+ int old;
+ do old = *dest; while (interlocked_cmpxchg(dest, old ^ val, old) != old);
+}
+
int CDECL omp_get_dynamic(void)
{
TRACE("stub\n");
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index 7083ce4..768daef 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -1,54 +1,54 @@
@ stub _vcomp_atomic_add_i1
@ stub _vcomp_atomic_add_i2
-@ stub _vcomp_atomic_add_i4
+@ cdecl _vcomp_atomic_add_i4(ptr long)
@ stub _vcomp_atomic_add_i8
@ stub _vcomp_atomic_add_r4
@ stub _vcomp_atomic_add_r8
@ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2
-@ stub _vcomp_atomic_and_i4
+@ cdecl _vcomp_atomic_and_i4(ptr long)
@ stub _vcomp_atomic_and_i8
@ stub _vcomp_atomic_div_i1
@ stub _vcomp_atomic_div_i2
-@ stub _vcomp_atomic_div_i4
+@ cdecl _vcomp_atomic_div_i4(ptr long)
@ stub _vcomp_atomic_div_i8
@ stub _vcomp_atomic_div_r4
@ stub _vcomp_atomic_div_r8
@ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2
-@ stub _vcomp_atomic_div_ui4
+@ cdecl _vcomp_atomic_div_ui4(ptr long)
@ stub _vcomp_atomic_div_ui8
@ stub _vcomp_atomic_mul_i1
@ stub _vcomp_atomic_mul_i2
-@ stub _vcomp_atomic_mul_i4
+@ cdecl _vcomp_atomic_mul_i4(ptr long)
@ stub _vcomp_atomic_mul_i8
@ stub _vcomp_atomic_mul_r4
@ stub _vcomp_atomic_mul_r8
@ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2
-@ stub _vcomp_atomic_or_i4
+@ cdecl _vcomp_atomic_or_i4(ptr long)
@ stub _vcomp_atomic_or_i8
@ stub _vcomp_atomic_shl_i1
@ stub _vcomp_atomic_shl_i2
-@ stub _vcomp_atomic_shl_i4
+@ cdecl _vcomp_atomic_shl_i4(ptr long)
@ stub _vcomp_atomic_shl_i8
@ stub _vcomp_atomic_shr_i1
@ stub _vcomp_atomic_shr_i2
-@ stub _vcomp_atomic_shr_i4
+@ cdecl _vcomp_atomic_shr_i4(ptr long)
@ stub _vcomp_atomic_shr_i8
@ stub _vcomp_atomic_shr_ui1
@ stub _vcomp_atomic_shr_ui2
-@ stub _vcomp_atomic_shr_ui4
+@ cdecl _vcomp_atomic_shr_ui4(ptr long)
@ stub _vcomp_atomic_shr_ui8
@ stub _vcomp_atomic_sub_i1
@ stub _vcomp_atomic_sub_i2
-@ stub _vcomp_atomic_sub_i4
+@ cdecl _vcomp_atomic_sub_i4(ptr long)
@ stub _vcomp_atomic_sub_i8
@ stub _vcomp_atomic_sub_r4
@ stub _vcomp_atomic_sub_r8
@ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2
-@ stub _vcomp_atomic_xor_i4
+@ cdecl _vcomp_atomic_xor_i4(ptr long)
@ stub _vcomp_atomic_xor_i8
@ cdecl _vcomp_barrier()
@ stub _vcomp_copyprivate_broadcast
--
2.4.5

View File

@ -1,168 +0,0 @@
From 48fc0019e5f426177b420c0115bf813f989fd1e8 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 01:56:05 +0200
Subject: vcomp/tests: Add tests for 32-bit atomic integer functions.
---
dlls/vcomp/tests/vcomp.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 124 insertions(+)
diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c
index 17b37f2..6405f1d 100644
--- a/dlls/vcomp/tests/vcomp.c
+++ b/dlls/vcomp/tests/vcomp.c
@@ -31,6 +31,17 @@ static BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*);
static BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR);
static VOID (WINAPI *pReleaseActCtx)(HANDLE);
+static void (CDECL *p_vcomp_atomic_add_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_and_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_div_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_div_ui4)(unsigned int *dest, unsigned int val);
+static void (CDECL *p_vcomp_atomic_mul_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_or_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_shl_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_shr_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_shr_ui4)(unsigned int *dest, unsigned int val);
+static void (CDECL *p_vcomp_atomic_sub_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val);
static void (CDECL *p_vcomp_barrier)(void);
static void (CDECL *p_vcomp_for_static_end)(void);
static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops,
@@ -175,6 +186,17 @@ static BOOL init_vcomp(void)
return FALSE;
}
+ VCOMP_GET_PROC(_vcomp_atomic_add_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_and_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_div_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_div_ui4);
+ VCOMP_GET_PROC(_vcomp_atomic_mul_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_or_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_shl_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_shr_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_shr_ui4);
+ VCOMP_GET_PROC(_vcomp_atomic_sub_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_xor_i4);
VCOMP_GET_PROC(_vcomp_barrier);
VCOMP_GET_PROC(_vcomp_for_static_end);
VCOMP_GET_PROC(_vcomp_for_static_init);
@@ -849,6 +871,106 @@ static void test_vcomp_for_static_init(void)
pomp_set_num_threads(max_threads);
}
+static void test_atomic_int32(void)
+{
+ int val;
+
+ val = 0x11223344;
+ p_vcomp_atomic_add_i4(&val, 0x77665544);
+ ok(val == -0x77777778, "expected val == -0x77777778, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_and_i4(&val, 0x77665544);
+ ok(val == 0x11221144, "expected val == 0x11221144, got %d\n", val);
+
+ val = 0x77665544;
+ p_vcomp_atomic_div_i4(&val, 0x11223344);
+ ok(val == 6, "expected val == 6, got %d\n", val);
+
+ val = 0x77665544;
+ p_vcomp_atomic_div_i4(&val, -0x11223344);
+ ok(val == -6, "expected val == -6, got %d\n", val);
+
+if (0)
+{
+ /* crashes on Windows */
+ val = 0x11223344;
+ p_vcomp_atomic_div_i4(&val, 0);
+}
+
+ val = 0x11223344;
+ p_vcomp_atomic_mul_i4(&val, 0x77665544);
+ ok(val == -0xecccdf0, "expected val == -0xecccdf0, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_mul_i4(&val, -0x77665544);
+ ok(val == 0xecccdf0, "expected val == 0xecccdf0, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_or_i4(&val, 0x77665544);
+ ok(val == 0x77667744, "expected val == 0x77667744, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_shl_i4(&val, 3);
+ ok(val == -0x76ee65e0, "expected val == -0x76ee65e0, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_shl_i4(&val, 35);
+ ok(val == -0x76ee65e0, "expected val == -0x76ee65e0, got %d\n", val);
+
+ val = -0x11223344;
+ p_vcomp_atomic_shl_i4(&val, 3);
+ ok(val == 0x76ee65e0, "expected val == 0x76ee65e0, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_shr_i4(&val, 3);
+ ok(val == 0x2244668, "expected val == 0x2244668, got %d\n", val);
+
+ val = -0x11223344;
+ p_vcomp_atomic_shr_i4(&val, 3);
+ ok(val == -0x2244669, "expected val == -0x2244669, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_sub_i4(&val, 0x77665544);
+ ok(val == -0x66442200, "expected val == -0x66442200, got %d\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_xor_i4(&val, 0x77665544);
+ ok(val == 0x66446600, "expected val == 0x66446600, got %d\n", val);
+}
+
+static void test_atomic_uint32(void)
+{
+ unsigned int val;
+
+ val = 0x77665544;
+ p_vcomp_atomic_div_ui4(&val, 0x11223344);
+ ok(val == 6, "expected val == 6, got %u\n", val);
+
+ val = 0x77665544;
+ p_vcomp_atomic_div_ui4(&val, 0xeeddccbc);
+ ok(val == 0, "expected val == 6, got %u\n", val);
+
+if (0)
+{
+ /* crashes on Windows */
+ val = 0x11223344;
+ p_vcomp_atomic_div_ui4(&val, 0);
+}
+
+ val = 0x11223344;
+ p_vcomp_atomic_shr_ui4(&val, 3);
+ ok(val == 0x2244668, "expected val == 0x2244668, got %u\n", val);
+
+ val = 0x11223344;
+ p_vcomp_atomic_shr_ui4(&val, 35);
+ ok(val == 0x2244668, "expected val == 0x2244668, got %u\n", val);
+
+ val = -0x11223344;
+ p_vcomp_atomic_shr_ui4(&val, 3);
+ ok(val == 0x1ddbb997, "expected val == 0x1ddbb997, got %u\n", val);
+}
+
START_TEST(vcomp)
{
if (!init_vcomp())
@@ -860,6 +982,8 @@ START_TEST(vcomp)
test_vcomp_sections_init();
test_vcomp_for_static_simple_init();
test_vcomp_for_static_init();
+ test_atomic_int32();
+ test_atomic_uint32();
release_vcomp();
}
--
2.4.5

View File

@ -1,4 +1,4 @@
From 95b19ecbd1cc556939bc6bd8d0b7d2ce71669fb0 Mon Sep 17 00:00:00 2001
From 6c4782b340f4cd6c9262cda2a4023f3d472e380e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Jul 2015 01:05:02 +0200
Subject: vcomp/tests: Add tests for _vcomp_for_dynamic_init.
@ -8,7 +8,7 @@ Subject: vcomp/tests: Add tests for _vcomp_for_dynamic_init.
1 file changed, 68 insertions(+)
diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c
index 0c7f8ba..8dab83a 100644
index f021a72..faa7bd1 100644
--- a/dlls/vcomp/tests/vcomp.c
+++ b/dlls/vcomp/tests/vcomp.c
@@ -51,6 +51,9 @@ static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val);
@ -30,8 +30,8 @@ index 0c7f8ba..8dab83a 100644
VCOMP_GET_PROC(_vcomp_for_static_end);
VCOMP_GET_PROC(_vcomp_for_static_init);
VCOMP_GET_PROC(_vcomp_for_static_simple_init);
@@ -1029,6 +1034,68 @@ static void test_atomic_double(void)
ok(24.9999 < val && val < 25.0001, "expected val == 25.0, got %f\n", val);
@@ -991,6 +996,68 @@ static void test_atomic_double(void)
}
}
+static void CDECL for_dynamic_cb(LONG *a, LONG *b, LONG *c)
@ -99,14 +99,14 @@ index 0c7f8ba..8dab83a 100644
START_TEST(vcomp)
{
if (!init_vcomp())
@@ -1040,6 +1107,7 @@ START_TEST(vcomp)
@@ -1002,6 +1069,7 @@ START_TEST(vcomp)
test_vcomp_sections_init();
test_vcomp_for_static_simple_init();
test_vcomp_for_static_init();
+ test_vcomp_for_dynamic_init();
test_atomic_int32();
test_atomic_uint32();
test_atomic_integer32();
test_atomic_float();
test_atomic_double();
--
2.4.5

View File

@ -1,108 +0,0 @@
From 0fc6d292b2874ddfb7d11d0adfb1796e0ce1ad02 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 01:59:14 +0200
Subject: vcomp: Implement atomic float functions.
---
dlls/vcomp/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
dlls/vcomp/vcomp.spec | 8 ++++----
2 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index 6f0caf6..92c8eaf 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -286,6 +286,50 @@ void CDECL _vcomp_atomic_xor_i4(int *dest, int val)
do old = *dest; while (interlocked_cmpxchg(dest, old ^ val, old) != old);
}
+void CDECL _vcomp_atomic_add_r4(float *dest, float val)
+{
+ int old, new;
+ do
+ {
+ old = *(int *)dest;
+ *(float *)&new = *(float *)&old + val;
+ }
+ while (interlocked_cmpxchg((int *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_div_r4(float *dest, float val)
+{
+ int old, new;
+ do
+ {
+ old = *(int *)dest;
+ *(float *)&new = *(float *)&old / val;
+ }
+ while (interlocked_cmpxchg((int *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_mul_r4(float *dest, float val)
+{
+ int old, new;
+ do
+ {
+ old = *(int *)dest;
+ *(float *)&new = *(float *)&old * val;
+ }
+ while (interlocked_cmpxchg((int *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_sub_r4(float *dest, float val)
+{
+ int old, new;
+ do
+ {
+ old = *(int *)dest;
+ *(float *)&new = *(float *)&old - val;
+ }
+ while (interlocked_cmpxchg((int *)dest, new, old) != old);
+}
+
int CDECL omp_get_dynamic(void)
{
TRACE("stub\n");
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index 768daef..bc963cb 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -2,7 +2,7 @@
@ stub _vcomp_atomic_add_i2
@ cdecl _vcomp_atomic_add_i4(ptr long)
@ stub _vcomp_atomic_add_i8
-@ stub _vcomp_atomic_add_r4
+@ cdecl _vcomp_atomic_add_r4(ptr float)
@ stub _vcomp_atomic_add_r8
@ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2
@@ -12,7 +12,7 @@
@ stub _vcomp_atomic_div_i2
@ cdecl _vcomp_atomic_div_i4(ptr long)
@ stub _vcomp_atomic_div_i8
-@ stub _vcomp_atomic_div_r4
+@ cdecl _vcomp_atomic_div_r4(ptr float)
@ stub _vcomp_atomic_div_r8
@ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2
@@ -22,7 +22,7 @@
@ stub _vcomp_atomic_mul_i2
@ cdecl _vcomp_atomic_mul_i4(ptr long)
@ stub _vcomp_atomic_mul_i8
-@ stub _vcomp_atomic_mul_r4
+@ cdecl _vcomp_atomic_mul_r4(ptr float)
@ stub _vcomp_atomic_mul_r8
@ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2
@@ -44,7 +44,7 @@
@ stub _vcomp_atomic_sub_i2
@ cdecl _vcomp_atomic_sub_i4(ptr long)
@ stub _vcomp_atomic_sub_i8
-@ stub _vcomp_atomic_sub_r4
+@ cdecl _vcomp_atomic_sub_r4(ptr float)
@ stub _vcomp_atomic_sub_r8
@ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2
--
2.4.5

View File

@ -1,92 +0,0 @@
From 520f89435a4d23962fc9acf1438a41e0d8a6f350 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 02:00:04 +0200
Subject: vcomp/tests: Add tests for atomic float functions.
---
dlls/vcomp/tests/vcomp.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c
index 6405f1d..ddb691c 100644
--- a/dlls/vcomp/tests/vcomp.c
+++ b/dlls/vcomp/tests/vcomp.c
@@ -32,15 +32,19 @@ static BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR);
static VOID (WINAPI *pReleaseActCtx)(HANDLE);
static void (CDECL *p_vcomp_atomic_add_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_add_r4)(float *dest, float val);
static void (CDECL *p_vcomp_atomic_and_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_div_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_div_r4)(float *dest, float val);
static void (CDECL *p_vcomp_atomic_div_ui4)(unsigned int *dest, unsigned int val);
static void (CDECL *p_vcomp_atomic_mul_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_mul_r4)(float *dest, float val);
static void (CDECL *p_vcomp_atomic_or_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shl_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shr_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shr_ui4)(unsigned int *dest, unsigned int val);
static void (CDECL *p_vcomp_atomic_sub_i4)(int *dest, int val);
+static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val);
static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val);
static void (CDECL *p_vcomp_barrier)(void);
static void (CDECL *p_vcomp_for_static_end)(void);
@@ -187,15 +191,19 @@ static BOOL init_vcomp(void)
}
VCOMP_GET_PROC(_vcomp_atomic_add_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_add_r4);
VCOMP_GET_PROC(_vcomp_atomic_and_i4);
VCOMP_GET_PROC(_vcomp_atomic_div_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_div_r4);
VCOMP_GET_PROC(_vcomp_atomic_div_ui4);
VCOMP_GET_PROC(_vcomp_atomic_mul_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_mul_r4);
VCOMP_GET_PROC(_vcomp_atomic_or_i4);
VCOMP_GET_PROC(_vcomp_atomic_shl_i4);
VCOMP_GET_PROC(_vcomp_atomic_shr_i4);
VCOMP_GET_PROC(_vcomp_atomic_shr_ui4);
VCOMP_GET_PROC(_vcomp_atomic_sub_i4);
+ VCOMP_GET_PROC(_vcomp_atomic_sub_r4);
VCOMP_GET_PROC(_vcomp_atomic_xor_i4);
VCOMP_GET_PROC(_vcomp_barrier);
VCOMP_GET_PROC(_vcomp_for_static_end);
@@ -971,6 +979,27 @@ if (0)
ok(val == 0x1ddbb997, "expected val == 0x1ddbb997, got %u\n", val);
}
+static void test_atomic_float(void)
+{
+ float val;
+
+ val = 42.0;
+ p_vcomp_atomic_add_r4(&val, 17.0);
+ ok(58.9999 < val && val < 59.0001, "expected val == 59.0, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_div_r4(&val, 17.0);
+ ok(2.4705 < val && val < 2.4707, "expected val == 2.4706, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_mul_r4(&val, 17.0);
+ ok(713.9999 < val && val < 714.0001, "expected val == 714.0, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_sub_r4(&val, 17.0);
+ ok(24.9999 < val && val < 25.0001, "expected val == 25.0, got %f\n", val);
+}
+
START_TEST(vcomp)
{
if (!init_vcomp())
@@ -984,6 +1013,7 @@ START_TEST(vcomp)
test_vcomp_for_static_init();
test_atomic_int32();
test_atomic_uint32();
+ test_atomic_float();
release_vcomp();
}
--
2.4.5

View File

@ -1,108 +0,0 @@
From 932eec0d4c46b47bace34f1bcee0483be0b450e0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 02:01:17 +0200
Subject: vcomp: Implement atomic double functions.
---
dlls/vcomp/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
dlls/vcomp/vcomp.spec | 8 ++++----
2 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index 92c8eaf..301370c 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -330,6 +330,50 @@ void CDECL _vcomp_atomic_sub_r4(float *dest, float val)
while (interlocked_cmpxchg((int *)dest, new, old) != old);
}
+void CDECL _vcomp_atomic_add_r8(double *dest, double val)
+{
+ LONG64 old, new;
+ do
+ {
+ old = *(LONG64 *)dest;
+ *(double *)&new = *(double *)&old + val;
+ }
+ while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_div_r8(double *dest, double val)
+{
+ LONG64 old, new;
+ do
+ {
+ old = *(LONG64 *)dest;
+ *(double *)&new = *(double *)&old / val;
+ }
+ while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_mul_r8(double *dest, double val)
+{
+ LONG64 old, new;
+ do
+ {
+ old = *(LONG64 *)dest;
+ *(double *)&new = *(double *)&old * val;
+ }
+ while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old);
+}
+
+void CDECL _vcomp_atomic_sub_r8(double *dest, double val)
+{
+ LONG64 old, new;
+ do
+ {
+ old = *(LONG64 *)dest;
+ *(double *)&new = *(double *)&old - val;
+ }
+ while (interlocked_cmpxchg64((LONG64 *)dest, new, old) != old);
+}
+
int CDECL omp_get_dynamic(void)
{
TRACE("stub\n");
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index bc963cb..3a709df 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -3,7 +3,7 @@
@ cdecl _vcomp_atomic_add_i4(ptr long)
@ stub _vcomp_atomic_add_i8
@ cdecl _vcomp_atomic_add_r4(ptr float)
-@ stub _vcomp_atomic_add_r8
+@ cdecl _vcomp_atomic_add_r8(ptr double)
@ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2
@ cdecl _vcomp_atomic_and_i4(ptr long)
@@ -13,7 +13,7 @@
@ cdecl _vcomp_atomic_div_i4(ptr long)
@ stub _vcomp_atomic_div_i8
@ cdecl _vcomp_atomic_div_r4(ptr float)
-@ stub _vcomp_atomic_div_r8
+@ cdecl _vcomp_atomic_div_r8(ptr double)
@ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2
@ cdecl _vcomp_atomic_div_ui4(ptr long)
@@ -23,7 +23,7 @@
@ cdecl _vcomp_atomic_mul_i4(ptr long)
@ stub _vcomp_atomic_mul_i8
@ cdecl _vcomp_atomic_mul_r4(ptr float)
-@ stub _vcomp_atomic_mul_r8
+@ cdecl _vcomp_atomic_mul_r8(ptr double)
@ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2
@ cdecl _vcomp_atomic_or_i4(ptr long)
@@ -45,7 +45,7 @@
@ cdecl _vcomp_atomic_sub_i4(ptr long)
@ stub _vcomp_atomic_sub_i8
@ cdecl _vcomp_atomic_sub_r4(ptr float)
-@ stub _vcomp_atomic_sub_r8
+@ cdecl _vcomp_atomic_sub_r8(ptr double)
@ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2
@ cdecl _vcomp_atomic_xor_i4(ptr long)
--
2.4.5

View File

@ -1,98 +0,0 @@
From 3858848a1e3057ad9c1edc8d92f8d6f4e614261e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 26 Jul 2015 02:02:23 +0200
Subject: vcomp/tests: Add tests for atomic double functions.
---
dlls/vcomp/tests/vcomp.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c
index ddb691c..0c7f8ba 100644
--- a/dlls/vcomp/tests/vcomp.c
+++ b/dlls/vcomp/tests/vcomp.c
@@ -33,18 +33,22 @@ static VOID (WINAPI *pReleaseActCtx)(HANDLE);
static void (CDECL *p_vcomp_atomic_add_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_add_r4)(float *dest, float val);
+static void (CDECL *p_vcomp_atomic_add_r8)(double *dest, double val);
static void (CDECL *p_vcomp_atomic_and_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_div_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_div_r4)(float *dest, float val);
+static void (CDECL *p_vcomp_atomic_div_r8)(double *dest, double val);
static void (CDECL *p_vcomp_atomic_div_ui4)(unsigned int *dest, unsigned int val);
static void (CDECL *p_vcomp_atomic_mul_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_mul_r4)(float *dest, float val);
+static void (CDECL *p_vcomp_atomic_mul_r8)(double *dest, double val);
static void (CDECL *p_vcomp_atomic_or_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shl_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shr_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_shr_ui4)(unsigned int *dest, unsigned int val);
static void (CDECL *p_vcomp_atomic_sub_i4)(int *dest, int val);
static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val);
+static void (CDECL *p_vcomp_atomic_sub_r8)(double *dest, double val);
static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val);
static void (CDECL *p_vcomp_barrier)(void);
static void (CDECL *p_vcomp_for_static_end)(void);
@@ -192,18 +196,22 @@ static BOOL init_vcomp(void)
VCOMP_GET_PROC(_vcomp_atomic_add_i4);
VCOMP_GET_PROC(_vcomp_atomic_add_r4);
+ VCOMP_GET_PROC(_vcomp_atomic_add_r8);
VCOMP_GET_PROC(_vcomp_atomic_and_i4);
VCOMP_GET_PROC(_vcomp_atomic_div_i4);
VCOMP_GET_PROC(_vcomp_atomic_div_r4);
+ VCOMP_GET_PROC(_vcomp_atomic_div_r8);
VCOMP_GET_PROC(_vcomp_atomic_div_ui4);
VCOMP_GET_PROC(_vcomp_atomic_mul_i4);
VCOMP_GET_PROC(_vcomp_atomic_mul_r4);
+ VCOMP_GET_PROC(_vcomp_atomic_mul_r8);
VCOMP_GET_PROC(_vcomp_atomic_or_i4);
VCOMP_GET_PROC(_vcomp_atomic_shl_i4);
VCOMP_GET_PROC(_vcomp_atomic_shr_i4);
VCOMP_GET_PROC(_vcomp_atomic_shr_ui4);
VCOMP_GET_PROC(_vcomp_atomic_sub_i4);
VCOMP_GET_PROC(_vcomp_atomic_sub_r4);
+ VCOMP_GET_PROC(_vcomp_atomic_sub_r8);
VCOMP_GET_PROC(_vcomp_atomic_xor_i4);
VCOMP_GET_PROC(_vcomp_barrier);
VCOMP_GET_PROC(_vcomp_for_static_end);
@@ -1000,6 +1008,27 @@ static void test_atomic_float(void)
ok(24.9999 < val && val < 25.0001, "expected val == 25.0, got %f\n", val);
}
+static void test_atomic_double(void)
+{
+ double val;
+
+ val = 42.0;
+ p_vcomp_atomic_add_r8(&val, 17.0);
+ ok(58.9999 < val && val < 59.0001, "expected val == 59.0, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_div_r8(&val, 17.0);
+ ok(2.4705 < val && val < 2.4707, "expected val == 2.4706, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_mul_r8(&val, 17.0);
+ ok(713.9999 < val && val < 714.0001, "expected val == 714.0, got %f\n", val);
+
+ val = 42.0;
+ p_vcomp_atomic_sub_r8(&val, 17.0);
+ ok(24.9999 < val && val < 25.0001, "expected val == 25.0, got %f\n", val);
+}
+
START_TEST(vcomp)
{
if (!init_vcomp())
@@ -1014,6 +1043,7 @@ START_TEST(vcomp)
test_atomic_int32();
test_atomic_uint32();
test_atomic_float();
+ test_atomic_double();
release_vcomp();
}
--
2.4.5

View File

@ -1,4 +1,4 @@
From cac0838d345702dec114c18ff6d38222b8bf5747 Mon Sep 17 00:00:00 2001
From 53a49004741dbe3d7cf1b9e79ed0a5b021bef51a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 6 Jun 2015 06:53:34 +0200
Subject: wined3d: Use real values for memory accounting on NVIDIA cards.
@ -10,7 +10,7 @@ Subject: wined3d: Use real values for memory accounting on NVIDIA cards.
3 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 56cf325..8f62570 100644
index c746d18..f33b313 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1181,8 +1181,31 @@ void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
@ -46,7 +46,7 @@ index 56cf325..8f62570 100644
wine_dbgstr_longlong(device->adapter->vram_bytes),
wine_dbgstr_longlong(device->adapter->vram_bytes_used),
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 61c3059..97c7f36 100644
index ce23c47..af7a63b 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -220,6 +220,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
@ -57,7 +57,7 @@ index 61c3059..97c7f36 100644
/* SGI */
{"GL_SGIS_generate_mipmap", SGIS_GENERATE_MIPMAP },
@@ -1392,7 +1393,8 @@ static const struct gpu_description *get_gpu_description(enum wined3d_pci_vendor
@@ -1395,7 +1396,8 @@ static const struct gpu_description *get_gpu_description(enum wined3d_pci_vendor
return NULL;
}
@ -67,7 +67,7 @@ index 61c3059..97c7f36 100644
enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
{
OSVERSIONINFOW os_version;
@@ -1501,6 +1503,16 @@ static void init_driver_info(struct wined3d_driver_info *driver_info,
@@ -1504,6 +1506,16 @@ static void init_driver_info(struct wined3d_driver_info *driver_info,
driver = DRIVER_UNKNOWN;
}
@ -84,15 +84,15 @@ index 61c3059..97c7f36 100644
if (wined3d_settings.emulated_textureram)
{
TRACE("Overriding amount of video memory with 0x%s bytes.\n",
@@ -3801,7 +3813,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
@@ -3804,7 +3816,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
}
fixup_extensions(gl_info, gl_renderer_str, gl_vendor, card_vendor, device);
- init_driver_info(driver_info, card_vendor, device);
+ init_driver_info(gl_info, driver_info, card_vendor, device);
add_gl_compat_wrappers(gl_info);
return TRUE;
gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info)
| adapter->fragment_pipe->get_emul_mask(gl_info);
if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 8c07ed1..3007516 100644
--- a/dlls/wined3d/wined3d_gl.h

View File

@ -1099,7 +1099,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3523,7 +3523,11 @@
@@ -3626,7 +3626,11 @@
float y_offset = context->render_offscreen
? (center_offset - (2.0f * y) - h) / h
: (center_offset - (2.0f * y) - h) / -h;
@ -1111,7 +1111,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
float z_scale = zenable ? 2.0f : 0.0f;
float z_offset = zenable ? -1.0f : 0.0f;
@@ -3646,6 +3650,7 @@
@@ -3749,6 +3753,7 @@
/* case WINED3D_TTFF_COUNT1: Won't ever get here. */
case WINED3D_TTFF_COUNT2:
mat._13 = mat._23 = mat._33 = mat._43 = 0.0f;
@ -1119,7 +1119,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
/* OpenGL divides the first 3 vertex coord by the 4th by default,
* which is essentially the same as D3DTTFF_PROJECTED. Make sure that
* the 4th coord evaluates to 1.0 to eliminate that.
@@ -3658,6 +3663,20 @@
@@ -3761,6 +3766,20 @@
* A more serious problem occurs if the app passes 4 coordinates in, and the
* 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow
* or a replacement shader. */
@ -1140,7 +1140,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
default:
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
}
@@ -4113,7 +4132,11 @@
@@ -4216,7 +4235,11 @@
unsigned int i;
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
@ -1211,7 +1211,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
shader_arb_ps_local_constants(compiled, context, state, rt_height);
}
@@ -7821,7 +7829,11 @@
@@ -7827,7 +7835,11 @@
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -1223,7 +1223,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
== WINED3D_LOCATION_DRAWABLE
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
@@ -7851,6 +7863,7 @@
@@ -7857,6 +7869,7 @@
/* Leave the opengl state valid for blitting */
arbfp_blit_unset(context->gl_info);
@ -1231,7 +1231,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
if (wined3d_settings.cs_multithreaded)
context->gl_info->gl_ops.gl.p_glFinish();
else if (wined3d_settings.strict_draw_ordering
@@ -7862,6 +7875,17 @@
@@ -7868,6 +7881,17 @@
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
@ -1833,7 +1833,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
@@ -1425,8 +1480,12 @@
@@ -1430,8 +1485,12 @@
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN;
BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device,
UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN;
@ -1846,7 +1846,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info,
@@ -1983,7 +2042,11 @@
@@ -2002,7 +2061,11 @@
struct wined3d_state
{
DWORD flags;
@ -1858,7 +1858,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2028,6 +2091,7 @@
@@ -2047,6 +2110,7 @@
DWORD render_states[WINEHIGHEST_RENDER_STATE + 1];
};
@ -1866,7 +1866,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_gl_bo
{
GLuint name;
@@ -2036,6 +2100,7 @@
@@ -2055,6 +2119,7 @@
UINT size;
};
@ -1874,7 +1874,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0U
/* Multithreaded flag. Removed from the public header to signal that
@@ -2091,11 +2156,23 @@
@@ -2110,11 +2175,23 @@
struct wined3d_rendertarget_view *back_buffer_view;
struct wined3d_swapchain **swapchains;
UINT swapchain_count;
@ -1898,7 +1898,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* For rendering to a texture using glCopyTexImage */
GLuint depth_blt_texture;
@@ -2106,6 +2183,9 @@
@@ -2125,6 +2202,9 @@
UINT xScreenSpace;
UINT yScreenSpace;
UINT cursorWidth, cursorHeight;
@ -1908,7 +1908,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HCURSOR hardwareCursor;
/* The Wine logo texture */
@@ -2137,6 +2217,7 @@
@@ -2156,6 +2236,7 @@
UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -1916,7 +1916,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
@@ -2148,6 +2229,11 @@
@@ -2167,6 +2248,11 @@
void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_delete_opengl_contexts_cs(struct wined3d_device *device,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -1928,7 +1928,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2164,9 +2250,11 @@
@@ -2183,9 +2269,11 @@
ULONG (*resource_incref)(struct wined3d_resource *resource);
ULONG (*resource_decref)(struct wined3d_resource *resource);
void (*resource_unload)(struct wined3d_resource *resource);
@ -1940,7 +1940,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_resource
@@ -2191,6 +2279,7 @@
@@ -2210,6 +2298,7 @@
UINT depth;
UINT size;
DWORD priority;
@ -1948,7 +1948,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data;
UINT custom_row_pitch, custom_slice_pitch;
struct wined3d_gl_bo *buffer, *map_buffer;
@@ -2198,6 +2287,11 @@
@@ -2217,6 +2306,11 @@
DWORD locations;
LONG access_fence;
BOOL unmap_dirtify;
@ -1960,7 +1960,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *parent;
const struct wined3d_parent_ops *parent_ops;
@@ -2222,6 +2316,7 @@
@@ -2241,6 +2335,7 @@
void *parent, const struct wined3d_parent_ops *parent_ops,
const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN;
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -1968,7 +1968,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_changed(struct wined3d_resource *resource,
@@ -2268,6 +2363,15 @@
@@ -2287,6 +2382,15 @@
{
while(InterlockedCompareExchange(&resource->access_fence, 0, 0));
}
@ -1984,7 +1984,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
@@ -2352,7 +2456,9 @@
@@ -2371,7 +2475,9 @@
void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
@ -1994,7 +1994,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
@@ -2386,9 +2492,16 @@
@@ -2405,9 +2511,16 @@
struct wined3d_resource resource;
struct wined3d_texture *container;
@ -2011,7 +2011,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
@@ -2396,6 +2509,7 @@
@@ -2415,6 +2528,7 @@
return CONTAINING_RECORD(resource, struct wined3d_volume, resource);
}
@ -2019,7 +2019,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN;
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
@@ -2408,6 +2522,23 @@
@@ -2427,6 +2541,23 @@
struct wined3d_surface_dib
{
HBITMAP DIBsection;
@ -2043,7 +2043,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
UINT bitmap_size;
};
@@ -2433,7 +2564,11 @@
@@ -2452,7 +2583,11 @@
struct wined3d_surface_ops
{
HRESULT (*surface_private_setup)(struct wined3d_surface *surface);
@ -2055,7 +2055,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_surface
@@ -2441,12 +2576,25 @@
@@ -2460,12 +2595,25 @@
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
@ -2081,7 +2081,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
GLuint rb_multisample;
GLuint rb_resolved;
GLenum texture_target;
@@ -2490,10 +2638,19 @@
@@ -2509,10 +2657,19 @@
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
@ -2101,7 +2101,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_prepare_rb(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
@@ -2505,6 +2662,7 @@
@@ -2524,6 +2681,7 @@
const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN;
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
@ -2109,7 +2109,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
@@ -2523,6 +2681,21 @@
@@ -2542,6 +2700,21 @@
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;
void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
@ -2131,7 +2131,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Surface flags: */
#define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */
@@ -2570,8 +2743,10 @@
@@ -2589,8 +2762,10 @@
BOOL half_float_conv_needed;
};
@ -2142,7 +2142,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_saved_states
{
DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1];
@@ -2639,6 +2814,7 @@
@@ -2658,6 +2833,7 @@
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2150,7 +2150,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
@@ -2689,6 +2865,32 @@
@@ -2708,6 +2884,32 @@
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context,
struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
@ -2183,7 +2183,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
@@ -2738,6 +2940,7 @@
@@ -2757,6 +2959,7 @@
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
@ -2191,7 +2191,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants,
UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -2797,6 +3000,7 @@
@@ -2816,6 +3019,7 @@
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@ -2199,7 +2199,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
@@ -2811,8 +3015,12 @@
@@ -2830,8 +3034,12 @@
struct wined3d_query_ops
{
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
@ -2212,7 +2212,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_query
@@ -2826,12 +3034,16 @@
@@ -2845,12 +3053,16 @@
enum wined3d_query_type type;
DWORD data_size;
void *extendedData;
@ -2229,7 +2229,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
@@ -2858,7 +3070,9 @@
@@ -2877,7 +3089,9 @@
GLenum buffer_object_usage;
GLenum buffer_type_hint;
DWORD flags;
@ -2239,7 +2239,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *map_ptr;
struct wined3d_map_range *maps;
@@ -2883,11 +3097,15 @@
@@ -2902,11 +3116,15 @@
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN;
void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2255,7 +2255,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_rendertarget_view
{
@@ -2926,8 +3144,10 @@
@@ -2945,8 +3163,10 @@
return surface_from_resource(resource);
}
@ -2266,7 +2266,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_shader_resource_view
{
LONG refcount;
@@ -2940,8 +3160,12 @@
@@ -2959,8 +3179,12 @@
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect,
@ -2279,7 +2279,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_swapchain
@@ -2981,8 +3205,10 @@
@@ -3000,8 +3224,10 @@
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -2290,7 +2290,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/*****************************************************************************
* Utility function prototypes
@@ -3186,7 +3412,9 @@
@@ -3205,7 +3431,9 @@
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
@ -3418,7 +3418,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -1436,6 +1615,16 @@
@@ -1435,6 +1614,16 @@
TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n",
light->range, light->falloff, light->theta, light->phi);
@ -3435,7 +3435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Save away the information. */
object->OriginalParms = *light;
@@ -1515,9 +1704,11 @@
@@ -1514,9 +1703,11 @@
FIXME("Unrecognized light type %#x.\n", light->type);
}
@ -3447,7 +3447,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -1590,6 +1781,14 @@
@@ -1589,6 +1780,14 @@
{
if (light_info->glIndex != -1)
{
@ -3462,7 +3462,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->update_state->lights[light_info->glIndex] = NULL;
light_info->glIndex = -1;
}
@@ -1631,11 +1830,23 @@
@@ -1630,11 +1829,23 @@
WARN("Too many concurrently active lights\n");
return WINED3D_OK;
}
@ -3486,7 +3486,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -1810,9 +2021,11 @@
@@ -1809,9 +2020,11 @@
TRACE("device %p, base_index %d.\n", device, base_index);
device->update_state->base_vertex_index = base_index;
@ -3498,7 +3498,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device)
@@ -1857,7 +2070,11 @@
@@ -1856,7 +2069,11 @@
|| !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
surface = surface_from_resource(texture->sub_resources[0]);
@ -3510,7 +3510,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return;
wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT);
@@ -2177,7 +2394,11 @@
@@ -2176,7 +2393,11 @@
return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx];
}
@ -3522,7 +3522,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
UINT i;
@@ -2210,8 +2431,12 @@
@@ -2209,8 +2430,12 @@
}
else
{
@ -3535,7 +3535,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2258,8 +2483,12 @@
@@ -2257,8 +2482,12 @@
}
else
{
@ -3548,7 +3548,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2310,8 +2539,13 @@
@@ -2309,8 +2538,13 @@
memset(device->recording->changed.vertexShaderConstantsF + start_register, 1,
sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count);
else
@ -3562,7 +3562,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -2446,8 +2680,12 @@
@@ -2445,8 +2679,12 @@
}
else
{
@ -3575,7 +3575,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2494,8 +2732,12 @@
@@ -2493,8 +2731,12 @@
}
else
{
@ -3588,7 +3588,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2547,8 +2789,12 @@
@@ -2546,8 +2788,12 @@
memset(device->recording->changed.pixelShaderConstantsF + start_register, 1,
sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count);
else
@ -3601,7 +3601,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -2708,6 +2954,7 @@
@@ -2707,6 +2953,7 @@
return hr;
}
@ -3609,7 +3609,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_settings.cs_multithreaded)
{
FIXME("Waiting for cs.\n");
@@ -2715,6 +2962,7 @@
@@ -2714,6 +2961,7 @@
device->cs->ops->finish(device->cs);
}
@ -3617,7 +3617,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat);
wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat);
wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat);
@@ -3216,6 +3464,10 @@
@@ -3215,6 +3463,10 @@
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
{
@ -3628,7 +3628,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p.\n", device);
if (!device->inScene)
@@ -3224,6 +3476,15 @@
@@ -3223,6 +3475,15 @@
return WINED3DERR_INVALIDCALL;
}
@ -3644,7 +3644,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->inScene = FALSE;
return WINED3D_OK;
}
@@ -3249,8 +3510,10 @@
@@ -3248,8 +3509,10 @@
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)
{
@ -3655,7 +3655,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil);
@@ -3259,12 +3522,19 @@
@@ -3258,12 +3521,19 @@
WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects);
return WINED3D_OK;
}
@ -3675,7 +3675,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3273,8 +3543,13 @@
@@ -3272,8 +3542,13 @@
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -3689,7 +3689,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3320,6 +3595,9 @@
@@ -3319,6 +3594,9 @@
enum wined3d_primitive_type primitive_type)
{
GLenum gl_primitive_type, prev;
@ -3699,7 +3699,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
@@ -3327,8 +3605,13 @@
@@ -3326,8 +3604,13 @@
device->update_state->gl_primitive_type = gl_primitive_type;
if (device->recording)
device->recording->changed.primitive_type = TRUE;
@ -3713,7 +3713,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
@@ -3351,6 +3634,14 @@
@@ -3350,6 +3633,14 @@
return WINED3DERR_INVALIDCALL;
}
@ -3728,7 +3728,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3367,6 +3658,10 @@
@@ -3366,6 +3657,10 @@
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
{
@ -3739,7 +3739,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
if (!device->state.index_buffer)
@@ -3385,6 +3680,15 @@
@@ -3384,6 +3679,15 @@
return WINED3DERR_INVALIDCALL;
}
@ -3755,7 +3755,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3400,6 +3704,7 @@
@@ -3399,6 +3703,7 @@
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
@ -3763,7 +3763,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
static void device_update_volume(struct wined3d_context *context,
struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
{
@@ -3435,6 +3740,88 @@
@@ -3434,6 +3739,88 @@
{
enum wined3d_resource_type type = src_texture->resource.type;
unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0;
@ -3852,7 +3852,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
level_count = min(wined3d_texture_get_level_count(src_texture),
wined3d_texture_get_level_count(dst_texture));
@@ -3453,7 +3840,13 @@
@@ -3452,7 +3839,13 @@
}
/* Make sure that the destination texture is loaded. */
@ -3866,7 +3866,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Update every surface level of the texture. */
switch (type)
@@ -3468,7 +3861,16 @@
@@ -3467,7 +3860,16 @@
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture,
i + src_skip_levels));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -3883,7 +3883,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
break;
}
@@ -3488,7 +3890,16 @@
@@ -3487,7 +3889,16 @@
i * src_levels + j + src_skip_levels));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture,
i * dst_levels + j));
@ -3900,7 +3900,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -3498,6 +3909,7 @@
@@ -3497,6 +3908,7 @@
{
for (i = 0; i < level_count; ++i)
{
@ -3908,7 +3908,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device_update_volume(context,
volume_from_resource(wined3d_texture_get_sub_resource(src_texture,
i + src_skip_levels)),
@@ -3546,6 +3958,25 @@
@@ -3545,6 +3957,25 @@
}
wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
@ -3934,7 +3934,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -3608,8 +4039,13 @@
@@ -3607,8 +4038,13 @@
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -3948,7 +3948,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -3706,6 +4142,7 @@
@@ -3705,6 +4141,7 @@
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const POINT *dst_point)
{
@ -3956,7 +3956,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
const struct wined3d_format *src_format = src_surface->resource.format;
const struct wined3d_format *dst_format = dst_surface->resource.format;
UINT update_w, update_h;
@@ -3713,6 +4150,7 @@
@@ -3712,6 +4149,7 @@
RECT r, dst_rect;
POINT p;
@ -3964,7 +3964,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n",
device, src_surface, wine_dbgstr_rect(src_rect),
dst_surface, wine_dbgstr_point(dst_point));
@@ -3724,6 +4162,7 @@
@@ -3723,6 +4161,7 @@
return WINED3DERR_INVALIDCALL;
}
@ -3972,7 +3972,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (src_format->id != dst_format->id)
{
WARN("Source and destination surfaces should have the same format.\n");
@@ -3786,6 +4225,9 @@
@@ -3785,6 +4224,9 @@
wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point);
return WINED3D_OK;
@ -3982,7 +3982,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
@@ -3961,8 +4403,14 @@
@@ -3960,8 +4402,14 @@
rect = &r;
}
@ -3997,7 +3997,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
@@ -3976,6 +4424,7 @@
@@ -3975,6 +4423,7 @@
return NULL;
}
@ -4005,7 +4005,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return device->state.fb.render_targets[view_idx];
}
@@ -3991,6 +4440,22 @@
@@ -3990,6 +4439,22 @@
{
struct wined3d_rendertarget_view *prev;
struct wined3d_fb_state *fb = &device->state.fb;
@ -4028,7 +4028,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4030,6 +4495,7 @@
@@ -4029,6 +4494,7 @@
}
@ -4036,7 +4036,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
prev = fb->render_targets[view_idx];
if (view == prev)
return WINED3D_OK;
@@ -4037,6 +4503,15 @@
@@ -4036,6 +4502,15 @@
if (view)
wined3d_rendertarget_view_incref(view);
fb->render_targets[view_idx] = view;
@ -4052,7 +4052,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
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. */
@@ -4048,6 +4523,7 @@
@@ -4047,6 +4522,7 @@
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -4060,7 +4060,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_fb_state *fb = &device->state.fb;
struct wined3d_rendertarget_view *prev;
@@ -4072,6 +4548,79 @@
@@ -4071,6 +4547,79 @@
{
TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n",
device, x_hotspot, y_hotspot, cursor_image);
@ -4140,7 +4140,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image)
{
@@ -4107,8 +4656,16 @@
@@ -4106,8 +4655,16 @@
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. */
@ -4157,7 +4157,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->cursorWidth = cursor_image->resource.width;
device->cursorHeight = cursor_image->resource.height;
@@ -4208,6 +4765,12 @@
@@ -4207,6 +4764,12 @@
else
SetCursor(NULL);
}
@ -4170,7 +4170,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return oldVisible;
}
@@ -4218,8 +4781,10 @@
@@ -4217,8 +4780,10 @@
TRACE("device %p.\n", device);
@ -4181,7 +4181,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Checking resource %p for eviction.\n", resource);
@@ -4227,6 +4792,7 @@
@@ -4226,6 +4791,7 @@
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
{
TRACE("Evicting %p.\n", resource);
@ -4189,7 +4189,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_evict_resource(device->cs, resource);
}
}
@@ -4247,6 +4813,37 @@
@@ -4246,6 +4812,37 @@
gl_info = context->gl_info;
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
@ -4227,7 +4227,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (device->depth_blt_texture)
{
@@ -4267,6 +4864,7 @@
@@ -4266,6 +4863,7 @@
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
@ -4235,7 +4235,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
swapchain->num_contexts = 0;
}
@@ -4286,6 +4884,14 @@
@@ -4285,6 +4883,14 @@
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
@ -4250,7 +4250,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4302,6 +4908,7 @@
@@ -4301,6 +4907,7 @@
return hr;
}
@ -4258,7 +4258,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
if (FAILED(hr))
{
@@ -4312,6 +4919,34 @@
@@ -4311,6 +4918,34 @@
}
wined3d_cs_emit_create_dummy_textures(device->cs);
@ -4293,7 +4293,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -4332,8 +4967,10 @@
@@ -4331,8 +4966,10 @@
unsigned int i;
TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback);
@ -4304,7 +4304,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
{
@@ -4349,9 +4986,21 @@
@@ -4348,9 +4985,21 @@
wined3d_texture_decref(device->logo_texture);
device->logo_texture = NULL;
}
@ -4326,7 +4326,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4360,6 +5009,7 @@
@@ -4359,6 +5008,7 @@
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -4334,7 +4334,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (reset_state)
{
state_unbind_resources(&device->state);
@@ -4369,6 +5019,12 @@
@@ -4368,6 +5018,12 @@
{
wined3d_surface_decref(device->cs->onscreen_depth_stencil);
device->cs->onscreen_depth_stencil = NULL;
@ -4347,7 +4347,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (reset_state)
@@ -4381,6 +5037,7 @@
@@ -4380,6 +5036,7 @@
}
}
@ -4355,7 +4355,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Free implicit resources and wait for the command stream before modifying
* swapchain parameters. After modifying the swapchain parameters a new GL
* context may be acquired by the worker thread. This causes problems in the
@@ -4402,6 +5059,7 @@
@@ -4401,6 +5058,7 @@
}
device->cs->ops->finish(device->cs);
@ -4363,7 +4363,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Is it necessary to recreate the gl context? Actually every setting can be changed
* on an existing gl context, so there's no real need for recreation.
*
@@ -4543,6 +5201,13 @@
@@ -4542,6 +5200,13 @@
}
}
@ -4377,7 +4377,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.enable_auto_depth_stencil)
{
struct wined3d_resource_desc surface_desc;
@@ -4580,6 +5245,13 @@
@@ -4579,6 +5244,13 @@
wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view);
}
@ -4391,7 +4391,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface(
surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)),
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
@@ -4662,12 +5334,20 @@
@@ -4661,12 +5333,20 @@
}
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(&device->state);
@ -4412,7 +4412,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4676,6 +5356,7 @@
@@ -4675,6 +5355,7 @@
}
else if (device->back_buffer_view)
{
@ -4420,7 +4420,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_state *state = &device->state;
wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE);
@@ -4691,6 +5372,24 @@
@@ -4690,6 +5371,24 @@
state->scissor_rect.left = 0;
state->scissor_rect.right = swapchain->desc.backbuffer_width;
state->scissor_rect.bottom = swapchain->desc.backbuffer_height;
@ -4445,7 +4445,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4769,6 +5468,10 @@
@@ -4768,6 +5467,10 @@
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
@ -4456,7 +4456,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
switch (type)
{
case WINED3D_RTYPE_SURFACE:
@@ -4779,6 +5482,7 @@
@@ -4778,6 +5481,7 @@
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -4464,7 +4464,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface)
{
ERR("Surface %p is still in use as render target %u.\n", surface, i);
@@ -4790,6 +5494,19 @@
@@ -4789,6 +5493,19 @@
{
ERR("Surface %p is still in use as depth/stencil buffer.\n", surface);
device->state.fb.depth_stencil = NULL;
@ -4484,7 +4484,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -4952,7 +5669,11 @@
@@ -4951,7 +5668,11 @@
device->blitter = adapter->blitter;
@ -4496,7 +4496,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
@@ -5051,6 +5772,7 @@
@@ -5050,6 +5771,7 @@
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@ -4504,7 +4504,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Context activation is done by the caller */
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
@@ -5104,3 +5826,4 @@
@@ -5103,3 +5825,4 @@
wined3d_device_destroy_bo(device, context, bo);
}
@ -9614,7 +9614,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5478,9 +5478,15 @@
@@ -5486,9 +5486,15 @@
DebugBreak();
}