Rebase against c3165b4c96a021a96dc6dd8a0b8e1030682dd6e5

This commit is contained in:
Alistair Leslie-Hughes 2020-03-13 10:16:13 +11:00
parent d14250ab03
commit 4d65ec9456
10 changed files with 78 additions and 509 deletions

View File

@ -1,17 +1,17 @@
From 357104aee69fd26cf997692ba26a5e8bda1111de Mon Sep 17 00:00:00 2001
From 303c5e3a975e5add6d1d7ef431753697beb92c8e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 5 Aug 2017 03:39:23 +0200
Subject: ntdll: Use fast CS functions for heap locking.
Subject: [PATCH] ntdll: Use fast CS functions for heap locking.
---
dlls/ntdll/heap.c | 52 ++++++++++++++++++++++++++--------------------------
dlls/ntdll/heap.c | 52 +++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index f4ddd7bd68a..f17356c740e 100644
index af2a489b727..a83370f20a8 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -1527,7 +1527,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
@@ -1338,7 +1338,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
flags |= heapPtr->flags;
/* calling HeapLock may result in infinite recursion, so do the critsect directly */
if (!(flags & HEAP_NO_SERIALIZE))
@ -20,25 +20,25 @@ index f4ddd7bd68a..f17356c740e 100644
if (block) /* only check this single memory block */
{
@@ -1550,7 +1550,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
ret = HEAP_ValidateInUseArena( subheap, arena, quiet );
if (!(flags & HEAP_NO_SERIALIZE))
- RtlLeaveCriticalSection( &heapPtr->critSection );
+ leave_critical_section( &heapPtr->critSection );
return ret;
@@ -1356,7 +1356,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
}
else ret = validate_large_arena( heapPtr, large_arena, quiet );
}
- else ret = HEAP_ValidateInUseArena( subheap, arena, quiet );
+ else ret = validate_large_arena( subheap, arena, quiet );
goto done;
}
@@ -1582,7 +1582,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
LIST_FOR_EACH_ENTRY( large_arena, &heapPtr->large_list, ARENA_LARGE, entry )
if (!(ret = validate_large_arena( heapPtr, large_arena, quiet ))) break;
@@ -1384,7 +1384,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
ret = TRUE;
done:
- if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveCriticalSection( &heapPtr->critSection );
+ if (!(flags & HEAP_NO_SERIALIZE)) leave_critical_section( &heapPtr->critSection );
return ret;
}
@@ -1756,9 +1756,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
@@ -1558,9 +1558,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
if (processHeap)
{
HEAP *heapPtr = subheap->heap;
@ -50,7 +50,7 @@ index f4ddd7bd68a..f17356c740e 100644
}
else if (!addr)
{
@@ -1796,9 +1796,9 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
@@ -1598,9 +1598,9 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
if (heap == processHeap) return heap; /* cannot delete the main process heap */
/* remove it from the per-process list */
@ -62,7 +62,7 @@ index f4ddd7bd68a..f17356c740e 100644
heapPtr->critSection.DebugInfo->Spare[0] = 0;
RtlDeleteCriticalSection( &heapPtr->critSection );
@@ -1871,12 +1871,12 @@ PVOID WINAPI RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_T size )
@@ -1673,12 +1673,12 @@ void * WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_
}
if (rounded_size < HEAP_MIN_DATA_SIZE) rounded_size = HEAP_MIN_DATA_SIZE;
@ -77,7 +77,7 @@ index f4ddd7bd68a..f17356c740e 100644
if (!ret && (flags & HEAP_GENERATE_EXCEPTIONS)) RtlRaiseStatus( STATUS_NO_MEMORY );
TRACE("(%p,%08x,%08lx): returning %p\n", heap, flags, size, ret );
return ret;
@@ -1888,7 +1888,7 @@ PVOID WINAPI RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_T size )
@@ -1690,7 +1690,7 @@ void * WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_
{
TRACE("(%p,%08x,%08lx): returning NULL\n",
heap, flags, size );
@ -86,7 +86,7 @@ index f4ddd7bd68a..f17356c740e 100644
if (flags & HEAP_GENERATE_EXCEPTIONS) RtlRaiseStatus( STATUS_NO_MEMORY );
return NULL;
}
@@ -1914,7 +1914,7 @@ PVOID WINAPI RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_T size )
@@ -1716,7 +1716,7 @@ void * WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE heap, ULONG flags, SIZE_
notify_alloc( pInUse + 1, size, flags & HEAP_ZERO_MEMORY );
initialize_block( pInUse + 1, size, pInUse->unused_bytes, flags );
@ -95,7 +95,7 @@ index f4ddd7bd68a..f17356c740e 100644
TRACE("(%p,%08x,%08lx): returning %p\n", heap, flags, size, pInUse + 1 );
return pInUse + 1;
@@ -1954,7 +1954,7 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
@@ -1756,7 +1756,7 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE heap, ULONG flags, void *pt
flags &= HEAP_NO_SERIALIZE;
flags |= heapPtr->flags;
@ -104,7 +104,7 @@ index f4ddd7bd68a..f17356c740e 100644
/* Inform valgrind we are trying to free memory, so it can throw up an error message */
notify_free( ptr );
@@ -1968,12 +1968,12 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
@@ -1770,12 +1770,12 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE heap, ULONG flags, void *pt
else
HEAP_MakeInUseBlockFree( subheap, pInUse );
@ -119,7 +119,7 @@ index f4ddd7bd68a..f17356c740e 100644
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER );
TRACE("(%p,%08x,%p): returning FALSE\n", heap, flags, ptr );
return FALSE;
@@ -2015,7 +2015,7 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
@@ -1817,7 +1817,7 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
flags &= HEAP_GENERATE_EXCEPTIONS | HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY |
HEAP_REALLOC_IN_PLACE_ONLY;
flags |= heapPtr->flags;
@ -128,7 +128,7 @@ index f4ddd7bd68a..f17356c740e 100644
rounded_size = ROUND_SIZE(size) + HEAP_TAIL_EXTRA_SIZE(flags);
if (rounded_size < size) goto oom; /* overflow */
@@ -2109,19 +2109,19 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
@@ -1911,19 +1911,19 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
ret = pArena + 1;
done:
@ -151,7 +151,7 @@ index f4ddd7bd68a..f17356c740e 100644
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER );
TRACE("(%p,%08x,%p,%08lx): returning NULL\n", heap, flags, ptr, size );
return NULL;
@@ -2167,7 +2167,7 @@ BOOLEAN WINAPI RtlLockHeap( HANDLE heap )
@@ -1969,7 +1969,7 @@ BOOLEAN WINAPI RtlLockHeap( HANDLE heap )
{
HEAP *heapPtr = HEAP_GetPtr( heap );
if (!heapPtr) return FALSE;
@ -160,7 +160,7 @@ index f4ddd7bd68a..f17356c740e 100644
return TRUE;
}
@@ -2188,7 +2188,7 @@ BOOLEAN WINAPI RtlUnlockHeap( HANDLE heap )
@@ -1990,7 +1990,7 @@ BOOLEAN WINAPI RtlUnlockHeap( HANDLE heap )
{
HEAP *heapPtr = HEAP_GetPtr( heap );
if (!heapPtr) return FALSE;
@ -169,7 +169,7 @@ index f4ddd7bd68a..f17356c740e 100644
return TRUE;
}
@@ -2224,7 +2224,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
@@ -2026,7 +2026,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
}
flags &= HEAP_NO_SERIALIZE;
flags |= heapPtr->flags;
@ -178,7 +178,7 @@ index f4ddd7bd68a..f17356c740e 100644
pArena = (const ARENA_INUSE *)ptr - 1;
if (!validate_block_pointer( heapPtr, &subheap, pArena ))
@@ -2241,7 +2241,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
@@ -2043,7 +2043,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE heap, ULONG flags, const void *ptr )
{
ret = (pArena->size & ARENA_SIZE_MASK) - pArena->unused_bytes;
}
@ -187,7 +187,7 @@ index f4ddd7bd68a..f17356c740e 100644
TRACE("(%p,%08x,%p): returning %08lx\n", heap, flags, ptr, ret );
return ret;
@@ -2288,7 +2288,7 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
@@ -2090,7 +2090,7 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
if (!heapPtr || !entry) return STATUS_INVALID_PARAMETER;
@ -196,7 +196,7 @@ index f4ddd7bd68a..f17356c740e 100644
/* FIXME: enumerate large blocks too */
@@ -2393,7 +2393,7 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
@@ -2195,7 +2195,7 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
if (TRACE_ON(heap)) HEAP_DumpEntry(entry);
HW_end:
@ -205,7 +205,7 @@ index f4ddd7bd68a..f17356c740e 100644
return ret;
}
@@ -2416,7 +2416,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
@@ -2218,7 +2218,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
ULONG total = 1; /* main heap */
struct list *ptr;
@ -214,7 +214,7 @@ index f4ddd7bd68a..f17356c740e 100644
LIST_FOR_EACH( ptr, &processHeap->entry ) total++;
if (total <= count)
{
@@ -2424,7 +2424,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
@@ -2226,7 +2226,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
LIST_FOR_EACH( ptr, &processHeap->entry )
*heaps++ = LIST_ENTRY( ptr, HEAP, entry );
}
@ -224,5 +224,5 @@ index f4ddd7bd68a..f17356c740e 100644
}
--
2.13.1
2.17.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "4dfd5f22f4032efdc283adf861d82e43c3b08d42"
echo "c3165b4c96a021a96dc6dd8a0b8e1030682dd6e5"
}
# Show version information
@ -314,7 +314,6 @@ patch_enable_all ()
enable_wined3d_SWVP_shaders="$1"
enable_wined3d_Silence_FIXMEs="$1"
enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$1"
enable_wined3d_WINED3D_TEXF_ANISOTROPIC="$1"
enable_wined3d_mesa_texture_download="$1"
enable_wined3d_unset_flip_gdi="$1"
enable_wined3d_wined3d_guess_gl_vendor="$1"
@ -1053,9 +1052,6 @@ patch_enable ()
wined3d-WINED3DFMT_B8G8R8X8_UNORM)
enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$2"
;;
wined3d-WINED3D_TEXF_ANISOTROPIC)
enable_wined3d_WINED3D_TEXF_ANISOTROPIC="$2"
;;
wined3d-mesa_texture_download)
enable_wined3d_mesa_texture_download="$2"
;;
@ -6654,21 +6650,6 @@ if test "$enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-WINED3D_TEXF_ANISOTROPIC
# |
# | This patchset fixes the following Wine bugs:
# | * [#41929] wined3d: Multiple games need WINED3D_TEXF_ANISOTROPIC filter mode
# |
# | Modified files:
# | * dlls/wined3d/surface.c
# |
if test "$enable_wined3d_WINED3D_TEXF_ANISOTROPIC" -eq 1; then
patch_apply wined3d-WINED3D_TEXF_ANISOTROPIC/0001-wined3d-Multiple-games-need-WINED3D_TEXF_ANISOTROPIC.patch
(
printf '%s\n' '+ { "Józef Kucia", "wined3d: Multiple games need WINED3D_TEXF_ANISOTROPIC filter mode.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-mesa_texture_download
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,4 +1,4 @@
From aeb6a6b0251a2b9cadea14ec97cb5a3889dadba0 Mon Sep 17 00:00:00 2001
From 3bafbe9d52d8189439b4969c091324d56c2462ed Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 17 Apr 2014 16:07:46 -0600
Subject: [PATCH] server: Unify the storage of security attributes for files
@ -11,7 +11,7 @@ Subject: [PATCH] server: Unify the storage of security attributes for files
3 files changed, 30 insertions(+), 51 deletions(-)
diff --git a/server/change.c b/server/change.c
index dee48ce..12c6976 100644
index 1c384310d59..1e27e266fc1 100644
--- a/server/change.c
+++ b/server/change.c
@@ -373,48 +373,15 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd,
@ -70,10 +70,10 @@ index dee48ce..12c6976 100644
static struct change_record *get_first_change_record( struct dir *dir )
diff --git a/server/file.c b/server/file.c
index fa96ca7..83b8d5e 100644
index af080ffc5fb..34da2168643 100644
--- a/server/file.c
+++ b/server/file.c
@@ -557,18 +557,13 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
@@ -562,18 +562,13 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
return new_mode;
}
@ -96,7 +96,7 @@ index fa96ca7..83b8d5e 100644
if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return 1;
@@ -595,10 +590,10 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
@@ -600,10 +595,10 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
if (set_info & DACL_SECURITY_INFORMATION)
{
/* keep the bits that we don't map to access rights in the ACL */
@ -110,7 +110,7 @@ index fa96ca7..83b8d5e 100644
{
file_set_error();
return 0;
@@ -640,6 +635,21 @@ static struct list *file_get_kernel_obj_list( struct object *obj )
@@ -645,6 +640,21 @@ static struct list *file_get_kernel_obj_list( struct object *obj )
return &file->kernel_object;
}
@ -133,18 +133,18 @@ index fa96ca7..83b8d5e 100644
{
struct file *file = (struct file *)obj;
diff --git a/server/file.h b/server/file.h
index d532294..19d7ddc 100644
index 69b2b368aed..d241927ebbd 100644
--- a/server/file.h
+++ b/server/file.h
@@ -150,6 +150,8 @@ extern void file_set_error(void);
extern struct object_type *file_get_type( struct object *obj );
@@ -151,6 +151,8 @@ extern struct object_type *file_get_type( struct object *obj );
extern struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID *group );
extern mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner );
extern int is_file_executable( const char *name );
+extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
+ const struct security_descriptor *sd, unsigned int set_info );
/* file mapping functions */
--
1.9.1
2.17.1

View File

@ -1,8 +1,8 @@
From b09247d54146c50abd7cd9e7c44e88f341bd5a13 Mon Sep 17 00:00:00 2001
From a258817a0a1caaa20d552447e1db0f3c55ebf246 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 17 Apr 2014 16:07:50 -0600
Subject: server: Unify the retrieval of security attributes for files and
directories. (try 7)
Subject: [PATCH] server: Unify the retrieval of security attributes for files
and directories. (try 7)
---
server/change.c | 32 +++++---------------------------
@ -11,10 +11,10 @@ Subject: server: Unify the retrieval of security attributes for files and
3 files changed, 28 insertions(+), 38 deletions(-)
diff --git a/server/change.c b/server/change.c
index c2fe428..29a48b3 100644
index 1e27e266fc1..77c9ff8bc2d 100644
--- a/server/change.c
+++ b/server/change.c
@@ -281,39 +281,17 @@ static struct fd *dir_get_fd( struct object *obj )
@@ -333,39 +333,17 @@ static struct fd *dir_get_fd( struct object *obj )
return (struct fd *)grab_object( dir->fd );
}
@ -60,10 +60,10 @@ index c2fe428..29a48b3 100644
}
diff --git a/server/file.c b/server/file.c
index fed2e45..58906c0 100644
index 34da2168643..60a47106da4 100644
--- a/server/file.c
+++ b/server/file.c
@@ -428,23 +428,19 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
@@ -450,23 +450,19 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
return sd;
}
@ -92,7 +92,7 @@ index fed2e45..58906c0 100644
return obj->sd;
sd = mode_to_sd( st.st_mode,
@@ -452,13 +448,27 @@ static struct security_descriptor *file_get_sd( struct object *obj )
@@ -474,13 +470,27 @@ static struct security_descriptor *file_get_sd( struct object *obj )
token_get_primary_group( current->process->token ));
if (!sd) return obj->sd;
@ -123,11 +123,11 @@ index fed2e45..58906c0 100644
{
mode_t mode = 0;
diff --git a/server/file.h b/server/file.h
index d1365b0..c866312 100644
index d241927ebbd..acabcc875b7 100644
--- a/server/file.h
+++ b/server/file.h
@@ -126,6 +126,8 @@ extern struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, con
extern mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner );
@@ -153,6 +153,8 @@ extern mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner
extern int is_file_executable( const char *name );
extern int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
const struct security_descriptor *sd, unsigned int set_info );
+extern struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode,
@ -136,5 +136,5 @@ index d1365b0..c866312 100644
/* file mapping functions */
--
2.3.5
2.17.1

View File

@ -1,4 +1,4 @@
From 528dd87710b847e1811acaa4fe8761310b735572 Mon Sep 17 00:00:00 2001
From da342d0e5f8dc030eb819102f7aea264fc13b91c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Mon, 30 Mar 2015 13:04:23 +0200
Subject: [PATCH] server: Store file security attributes with extended file
@ -10,10 +10,10 @@ Subject: [PATCH] server: Store file security attributes with extended file
2 files changed, 37 insertions(+)
diff --git a/include/wine/port.h b/include/wine/port.h
index 4bbf999..5204807 100644
index 49dd8cca67a..fdcc7b5fa0f 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -349,6 +349,9 @@ extern int mkstemps(char *template, int suffix_len);
@@ -361,6 +361,9 @@ extern int mkstemps(char *template, int suffix_len);
#ifndef XATTR_USER_PREFIX
# define XATTR_USER_PREFIX "user."
#endif
@ -24,7 +24,7 @@ index 4bbf999..5204807 100644
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
extern int xattr_fremove( int filedes, const char *name );
diff --git a/server/file.c b/server/file.c
index babb935..d52a5ff 100644
index 0fabb0cd04a..2b21b3dcab6 100644
--- a/server/file.c
+++ b/server/file.c
@@ -32,6 +32,7 @@
@ -50,8 +50,8 @@ index babb935..d52a5ff 100644
struct file
{
struct object obj; /* object header */
@@ -200,6 +209,28 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_
return &file->obj;
@@ -206,6 +215,28 @@ int is_file_executable( const char *name )
return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" ));
}
+static void set_xattr_sd( int fd, const struct security_descriptor *sd )
@ -79,7 +79,7 @@ index babb935..d52a5ff 100644
static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len,
unsigned int access, unsigned int sharing, int create,
unsigned int options, unsigned int attrs,
@@ -631,6 +662,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
@@ -636,6 +667,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
*mode = new_mode;
}
@ -90,5 +90,5 @@ index babb935..d52a5ff 100644
obj->sd = new_sd;
return 1;
--
1.9.1
2.17.1

View File

@ -1,4 +1,4 @@
From cd8cb8bb9d05340eb8c055e6684f421789c5657e Mon Sep 17 00:00:00 2001
From a6c569b3ed10be719a75d5a63c377220749733c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 18 Aug 2017 23:51:59 +0200
Subject: [PATCH] wined3d: Implement dual source blending.
@ -27,10 +27,10 @@ index 58544f9d6e8..1d98ee499ed 100644
ID3D11BlendState_Release(blend_state);
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index c8924505e18..5e7ff6e2fae 100644
index 8a6f7f07959..6ee3e91cd68 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -2991,6 +2991,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
@@ -2993,6 +2993,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
gl_info->limits.buffers = min(MAX_RENDER_TARGET_VIEWS, gl_max);
TRACE("Max draw buffers: %u.\n", gl_max);
}
@ -43,7 +43,7 @@ index c8924505e18..5e7ff6e2fae 100644
if (gl_info->supported[ARB_MULTITEXTURE])
{
if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
@@ -5120,6 +5126,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
@@ -5122,6 +5128,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
struct fragment_caps fragment_caps;
struct shader_caps shader_caps;
GLfloat f[2];
@ -51,7 +51,7 @@ index c8924505e18..5e7ff6e2fae 100644
adapter_gl->a.shader_backend->shader_get_caps(&adapter_gl->a, &shader_caps);
adapter_gl->a.vertex_pipe->vp_get_caps(&adapter_gl->a, &vertex_caps);
@@ -5140,6 +5147,10 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
@@ -5142,6 +5149,10 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices;
d3d_info->limits.active_light_count = vertex_caps.max_active_lights;
@ -157,7 +157,7 @@ index 13e55cff8aa..e308acccb74 100644
static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index aa85193bdd7..32c7c946165 100644
index 19f47f834e4..54075caefa3 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -532,12 +532,14 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
@ -196,11 +196,11 @@ index aa85193bdd7..32c7c946165 100644
checkGLcall("glEnable(GL_BLEND)");
+ rt_format = state->fb->render_targets[0]->format;
gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src,
state->render_states[WINED3D_RS_DESTBLEND], rt_format);
gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src, b->desc.dst, rt_format);
blendop(state, gl_info);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 20af49e5546..ca7dec19947 100644
index 127e4c76212..d7113d6cac2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -205,6 +205,7 @@ struct wined3d_d3d_info
@ -211,7 +211,7 @@ index 20af49e5546..ca7dec19947 100644
uint32_t wined3d_creation_flags;
uint32_t xyzrhw : 1;
uint32_t emulated_flatshading : 1;
@@ -1393,7 +1394,8 @@ struct ps_compile_args
@@ -1394,7 +1395,8 @@ struct ps_compile_args
DWORD alpha_test_func : 3;
DWORD render_offscreen : 1;
DWORD rt_alpha_swizzle : 8; /* MAX_RENDER_TARGET_VIEWS, 8 */
@ -221,7 +221,7 @@ index 20af49e5546..ca7dec19947 100644
};
enum fog_src_type
@@ -1970,7 +1972,8 @@ struct wined3d_context
@@ -1971,7 +1973,8 @@ struct wined3d_context
DWORD destroyed : 1;
DWORD destroy_delayed : 1;
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */
@ -231,7 +231,7 @@ index 20af49e5546..ca7dec19947 100644
DWORD constant_update_mask;
DWORD numbered_array_mask;
@@ -2718,6 +2721,7 @@ struct wined3d_fbo_ops
@@ -2719,6 +2722,7 @@ struct wined3d_fbo_ops
struct wined3d_gl_limits
{
UINT buffers;
@ -239,7 +239,7 @@ index 20af49e5546..ca7dec19947 100644
UINT lights;
UINT textures;
UINT texture_coords;
@@ -3230,6 +3234,22 @@ struct wined3d_state
@@ -3231,6 +3235,22 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@ -263,5 +263,5 @@ index 20af49e5546..ca7dec19947 100644
{
GLuint tex_1d;
--
2.25.1
2.17.1

View File

@ -1,369 +0,0 @@
From 2957b95552af20dcd56c8ebcde57f41f0e301628 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 20 Jul 2017 13:50:07 +0200
Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks.
---
dlls/d3d11/device.c | 29 ++++++++++-----------
dlls/d3d11/state.c | 4 ---
dlls/wined3d/context.c | 10 +++-----
dlls/wined3d/device.c | 6 ++---
dlls/wined3d/state.c | 46 +++++++++++++++++++++++-----------
dlls/wined3d/stateblock.c | 11 +++++---
dlls/wined3d/surface.c | 7 +++---
dlls/wined3d/utils.c | 6 ++++-
dlls/wined3d/wined3d_private.h | 1 +
include/wine/wined3d.h | 14 ++++++++++-
10 files changed, 80 insertions(+), 54 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 143ae6ecc54..089b37e7868 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -2088,6 +2088,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
static const float default_blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f};
struct d3d_blend_state *blend_state_impl;
const D3D11_BLEND_DESC *desc;
+ int i;
TRACE("iface %p, blend_state %p, blend_factor %s, sample_mask 0x%08x.\n",
iface, blend_state, debug_float4(blend_factor), sample_mask);
@@ -2102,14 +2103,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
wined3d_device_set_blend_state(device->wined3d_device, NULL,
(const struct wined3d_color *)blend_factor);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, FALSE);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE, D3D11_COLOR_WRITE_ENABLE_ALL);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE1, D3D11_COLOR_WRITE_ENABLE_ALL);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE2, D3D11_COLOR_WRITE_ENABLE_ALL);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE3, D3D11_COLOR_WRITE_ENABLE_ALL);
+ for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
+ {
+ wined3d_device_set_render_state(device->wined3d_device,
+ WINED3D_RS_COLORWRITE(i), D3D11_COLOR_WRITE_ENABLE_ALL);
+ }
wined3d_mutex_unlock();
return;
}
@@ -2131,14 +2129,13 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, d->DestBlendAlpha);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, d->BlendOpAlpha);
}
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE, desc->RenderTarget[0].RenderTargetWriteMask);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE1, desc->RenderTarget[1].RenderTargetWriteMask);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE2, desc->RenderTarget[2].RenderTargetWriteMask);
- wined3d_device_set_render_state(device->wined3d_device,
- WINED3D_RS_COLORWRITEENABLE3, desc->RenderTarget[3].RenderTargetWriteMask);
+ for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
+ {
+ DWORD src_index = desc->IndependentBlendEnable ? i : 0;
+
+ wined3d_device_set_render_state(device->wined3d_device,
+ WINED3D_RS_COLORWRITE(i), desc->RenderTarget[src_index].RenderTargetWriteMask);
+ }
wined3d_mutex_unlock();
}
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index dd2eb6306e7..3375b31e949 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -344,10 +344,6 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
tmp_desc.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD;
}
tmp_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask;
-
- if (i > 3 && tmp_desc.RenderTarget[i].RenderTargetWriteMask != D3D11_COLOR_WRITE_ENABLE_ALL)
- FIXME("Color mask %#x not supported for render target %u.\n",
- tmp_desc.RenderTarget[i].RenderTargetWriteMask, i);
}
/* glEnableIndexedEXT(GL_BLEND, ...) */
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 149c7318d96..aa7fce873c7 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3059,7 +3059,7 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
const struct wined3d_gl_info *gl_info;
uint32_t rt_mask, *cur_mask;
struct wined3d_texture *rt;
- unsigned int sampler;
+ unsigned int i, sampler;
SIZE rt_size;
TRACE("Setting up context %p for blitting.\n", context);
@@ -3165,10 +3165,8 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE));
}
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
+ for (i = 0; i < MAX_RENDER_TARGETS; ++i)
+ context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITE(i)));
context->last_was_rhw = TRUE;
context_invalidate_state(context, STATE_VDECL); /* because of last_was_rhw = TRUE */
@@ -5171,7 +5169,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
continue;
- if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
+ if (state->render_states[WINED3D_RS_COLORWRITE(i)])
{
wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index de2f2b9a52f..a574b8933de 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -437,10 +437,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
}
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
+ for (i = 0; i < MAX_RENDER_TARGETS; ++i)
+ context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITE(i)));
gl_info->gl_ops.gl.p_glClearColor(color->r, color->g, color->b, color->a);
checkGLcall("glClearColor");
clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 89051aa1e41..e162d37c28d 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1551,9 +1551,6 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE];
- DWORD mask1 = state->render_states[WINED3D_RS_COLORWRITEENABLE1];
- DWORD mask2 = state->render_states[WINED3D_RS_COLORWRITEENABLE2];
- DWORD mask3 = state->render_states[WINED3D_RS_COLORWRITEENABLE3];
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
mask0 & WINED3DCOLORWRITEENABLE_RED ? 1 : 0,
@@ -1566,13 +1563,7 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined
mask0 & WINED3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
checkGLcall("glColorMask(...)");
- if (!((mask1 == mask0 && mask2 == mask0 && mask3 == mask0)
- || (mask1 == 0xf && mask2 == 0xf && mask3 == 0xf)))
- {
- FIXME("WINED3D_RS_COLORWRITEENABLE/1/2/3, %#x/%#x/%#x/%#x not yet implemented.\n",
- mask0, mask1, mask2, mask3);
- FIXME("Missing of cap D3DPMISCCAPS_INDEPENDENTWRITEMASKS wasn't honored?\n");
- }
+ /* FIXME: WINED3D_RS_COLORWRITEENABLE1 .. WINED3D_RS_COLORWRITEENABLE7 not implemented. */
}
static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DWORD mask)
@@ -1585,9 +1576,20 @@ static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DW
checkGLcall("glColorMaski");
}
-static void state_colorwrite0(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+static void state_colorwrite_i(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
- set_color_mask(wined3d_context_gl(context)->gl_info, 0, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
+ const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
+ int index;
+
+ if (state_id == WINED3D_RS_COLORWRITEENABLE) index = 0;
+ else if (state_id <= WINED3D_RS_COLORWRITEENABLE3) index = state_id - WINED3D_RS_COLORWRITEENABLE1 + 1;
+ else if (state_id <= WINED3D_RS_COLORWRITEENABLE7) index = state_id - WINED3D_RS_COLORWRITEENABLE4 + 4;
+ else return;
+
+ if (index >= gl_info->limits.buffers)
+ WARN("Ignoring color write value for index %d, because gpu only supports %d render targets\n", index, gl_info->limits.buffers);
+
+ set_color_mask(gl_info, index, state->render_states[state_id]);
}
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@@ -4672,8 +4674,22 @@ const struct wined3d_state_entry_template misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE },
- { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE4), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE4), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE4), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE5), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE5), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE5), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE6), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE6), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE6), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE7), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE7), state_colorwrite_i }, EXT_DRAW_BUFFERS2 },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE7), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION },
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 },
@@ -4681,7 +4697,9 @@ const struct wined3d_state_entry_template misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 },
- { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL },
+WINED3D_GL_EXT_NONE },
+ { STATE_RENDER(WINED3D_RS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE },
/* Samplers */
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 22862403e90..f4cca385dcf 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -45,6 +45,10 @@ static const DWORD pixel_states_render[] =
WINED3D_RS_COLORWRITEENABLE1,
WINED3D_RS_COLORWRITEENABLE2,
WINED3D_RS_COLORWRITEENABLE3,
+ WINED3D_RS_COLORWRITEENABLE4,
+ WINED3D_RS_COLORWRITEENABLE5,
+ WINED3D_RS_COLORWRITEENABLE6,
+ WINED3D_RS_COLORWRITEENABLE7,
WINED3D_RS_DEPTHBIAS,
WINED3D_RS_DESTBLEND,
WINED3D_RS_DESTBLENDALPHA,
@@ -1680,6 +1684,7 @@ HRESULT CDECL wined3d_stateblock_get_light(const struct wined3d_stateblock *stat
static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
{
+ unsigned int i;
union
{
struct wined3d_line_pattern lp;
@@ -1773,7 +1778,6 @@ static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], c
tmpfloat.f = d3d_info->limits.pointsize_max;
rs[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d;
rs[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE;
- rs[WINED3D_RS_COLORWRITEENABLE] = 0x0000000f;
tmpfloat.f = 0.0f;
rs[WINED3D_RS_TWEENFACTOR] = tmpfloat.d;
rs[WINED3D_RS_BLENDOP] = WINED3D_BLEND_OP_ADD;
@@ -1799,9 +1803,6 @@ static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], c
rs[WINED3D_RS_BACK_STENCILZFAIL] = WINED3D_STENCIL_OP_KEEP;
rs[WINED3D_RS_BACK_STENCILPASS] = WINED3D_STENCIL_OP_KEEP;
rs[WINED3D_RS_BACK_STENCILFUNC] = WINED3D_CMP_ALWAYS;
- rs[WINED3D_RS_COLORWRITEENABLE1] = 0x0000000f;
- rs[WINED3D_RS_COLORWRITEENABLE2] = 0x0000000f;
- rs[WINED3D_RS_COLORWRITEENABLE3] = 0x0000000f;
rs[WINED3D_RS_BLENDFACTOR] = 0xffffffff;
rs[WINED3D_RS_SRGBWRITEENABLE] = 0;
rs[WINED3D_RS_DEPTHBIAS] = 0;
@@ -1817,6 +1818,8 @@ static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], c
rs[WINED3D_RS_SRCBLENDALPHA] = WINED3D_BLEND_ONE;
rs[WINED3D_RS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO;
rs[WINED3D_RS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD;
+ for (i = 0; i < MAX_RENDER_TARGETS; ++i)
+ rs[WINED3D_RS_COLORWRITE(i)] = 0x0000000f;
}
static void init_default_texture_state(unsigned int i, DWORD stage[WINED3D_HIGHEST_TEXTURE_STATE + 1])
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cb79f5c0746..60950c45819 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -153,6 +153,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
GLenum gl_filter;
GLenum buffer;
RECT s, d;
+ int i;
TRACE("device %p, context %p, filter %s, src_texture %p, src_sub_resource_idx %u, src_location %s, "
"src_rect %s, dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s.\n",
@@ -261,10 +262,8 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
context_invalidate_state(context, STATE_FRAMEBUFFER);
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
- context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
+ for (i = 0; i < MAX_RENDER_TARGETS; ++i)
+ context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITE(i)));
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RASTERIZER);
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 9ad294c597e..0e04fef296d 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4972,7 +4972,6 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_DEBUGMONITORTOKEN);
D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE_MAX);
D3DSTATE_TO_STR(WINED3D_RS_INDEXEDVERTEXBLENDENABLE);
- D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE);
D3DSTATE_TO_STR(WINED3D_RS_TWEENFACTOR);
D3DSTATE_TO_STR(WINED3D_RS_BLENDOP);
D3DSTATE_TO_STR(WINED3D_RS_POSITIONDEGREE);
@@ -4992,9 +4991,14 @@ const char *debug_d3drenderstate(enum wined3d_render_state state)
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILZFAIL);
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILPASS);
D3DSTATE_TO_STR(WINED3D_RS_BACK_STENCILFUNC);
+ D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE);
D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE1);
D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE2);
D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE3);
+ D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE4);
+ D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE5);
+ D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE6);
+ D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE7);
D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE);
D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS);
D3DSTATE_TO_STR(WINED3D_RS_WRAP8);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5c0324273a0..e2f715becf2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -291,6 +291,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
#define MAX_UNORDERED_ACCESS_VIEWS 8
#define MAX_TGSM_REGISTERS 8192
#define MAX_VERTEX_BLENDS 4
+#define MAX_RENDER_TARGETS 8
struct min_lookup
{
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 07e0692fd7d..2c789db2f71 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -404,8 +404,20 @@ enum wined3d_render_state
WINED3D_RS_SRCBLENDALPHA = 207,
WINED3D_RS_DESTBLENDALPHA = 208,
WINED3D_RS_BLENDOPALPHA = 209,
+ WINED3D_RS_COLORWRITEENABLE4 = 210,
+ WINED3D_RS_COLORWRITEENABLE5 = 211,
+ WINED3D_RS_COLORWRITEENABLE6 = 212,
+ WINED3D_RS_COLORWRITEENABLE7 = 213,
};
-#define WINEHIGHEST_RENDER_STATE WINED3D_RS_BLENDOPALPHA
+#define WINEHIGHEST_RENDER_STATE WINED3D_RS_COLORWRITEENABLE7
+
+static inline enum wined3d_render_state WINED3D_RS_COLORWRITE(int index)
+{
+ if (index == 0) return WINED3D_RS_COLORWRITEENABLE;
+ if (index <= 3) return WINED3D_RS_COLORWRITEENABLE1 + index - 1;
+ if (index <= 7) return WINED3D_RS_COLORWRITEENABLE4 + index - 4;
+ return WINED3D_RS_COLORWRITEENABLE;
+}
enum wined3d_blend
{
--
2.17.1

View File

@ -1,2 +0,0 @@
Fixes: Implement support for all d3d11 color write masks in wined3d
Disabled: true

View File

@ -1,40 +0,0 @@
From 6574972a4ef025a354ebc00b4f1b0c96da3cede0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
Date: Mon, 17 Dec 2018 12:12:20 +1100
Subject: [PATCH] wined3d: Multiple games need WINED3D_TEXF_ANISOTROPIC filter
mode
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41929
---
dlls/wined3d/surface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 85f9489..3441f01 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -169,16 +169,16 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
switch (filter)
{
- case WINED3D_TEXF_LINEAR:
- gl_filter = GL_LINEAR;
+ case WINED3D_TEXF_NONE:
+ case WINED3D_TEXF_POINT:
+ gl_filter = GL_NEAREST;
break;
default:
FIXME("Unsupported filter mode %s (%#x).\n", debug_d3dtexturefiltertype(filter), filter);
/* fall through */
- case WINED3D_TEXF_NONE:
- case WINED3D_TEXF_POINT:
- gl_filter = GL_NEAREST;
+ case WINED3D_TEXF_LINEAR:
+ gl_filter = GL_LINEAR;
break;
}
--
1.9.1

View File

@ -1 +0,0 @@
Fixes: [41929] wined3d: Multiple games need WINED3D_TEXF_ANISOTROPIC filter mode