You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
52dd338148 | ||
|
f841424edd | ||
|
5e8fbbf200 | ||
|
183fd3e089 | ||
|
092f3b1ed1 | ||
|
e59eb7639a | ||
|
a0716c9cfe | ||
|
fcf7b80107 | ||
|
163f74fe61 | ||
|
ce643e9d2a | ||
|
f18cff9e7a | ||
|
f5fe9c0c89 | ||
|
c6e832ee03 | ||
|
a7ae280480 | ||
|
8988a92bee | ||
|
260734214e | ||
|
1a3b158f0b | ||
|
1af6d6980c | ||
|
1c9c21dc1c | ||
|
0dd44a250f | ||
|
9bf50b7e1f | ||
|
9c8608eea6 | ||
|
fd5866f6f1 | ||
|
432c0b5a83 | ||
|
5d26dfaa93 | ||
|
876024f44f | ||
|
c933b26cb6 | ||
|
eeec769eeb | ||
|
e3cca687be | ||
|
08912e4896 | ||
|
daec2e3662 | ||
|
8a3554ad85 | ||
|
1fc93d6e9f | ||
|
799d451409 | ||
|
a534ddb0a0 | ||
|
3e16509e0e | ||
|
06523ed0a0 | ||
|
0e6e23e1f9 | ||
|
8790b8780f | ||
|
44f10effff | ||
|
73c8cb1002 | ||
|
356d0d750c | ||
|
9efac47eec | ||
|
2ebe0e23aa | ||
|
d4e9192632 | ||
|
d97f6a5faa | ||
|
34afd80e2e | ||
|
69765f438b | ||
|
99d312740b | ||
|
5bbe3e47a5 |
@@ -0,0 +1,34 @@
|
||||
From 5be4173b6c3e89b1d9267679cd392a7343088a52 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:10:37 +1000
|
||||
Subject: [PATCH] ntdll: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 34b332a613c..111c851b43b 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -3016,7 +3016,7 @@ NTSTATUS virtual_clear_tls_index( ULONG index )
|
||||
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
|
||||
LIST_FOR_EACH_ENTRY( thread_data, &teb_list, struct ntdll_thread_data, entry )
|
||||
{
|
||||
- TEB *teb = CONTAINING_RECORD( thread_data, TEB, GdiTebBatch );
|
||||
+ TEB *teb = CONTAINING_RECORD( (GDI_TEB_BATCH *)thread_data, TEB, GdiTebBatch );
|
||||
#ifdef _WIN64
|
||||
WOW_TEB *wow_teb = get_wow_teb( teb );
|
||||
if (wow_teb) wow_teb->TlsSlots[index] = 0;
|
||||
@@ -3034,7 +3034,7 @@ NTSTATUS virtual_clear_tls_index( ULONG index )
|
||||
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
|
||||
LIST_FOR_EACH_ENTRY( thread_data, &teb_list, struct ntdll_thread_data, entry )
|
||||
{
|
||||
- TEB *teb = CONTAINING_RECORD( thread_data, TEB, GdiTebBatch );
|
||||
+ TEB *teb = CONTAINING_RECORD( (GDI_TEB_BATCH *)thread_data, TEB, GdiTebBatch );
|
||||
#ifdef _WIN64
|
||||
WOW_TEB *wow_teb = get_wow_teb( teb );
|
||||
if (wow_teb)
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,40 @@
|
||||
From 7784b62bd2b64aabd6bfef9ef39ac4f3e8c55c77 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 08:56:40 +1000
|
||||
Subject: [PATCH] bcrypt: Stop compile error when HAVE_GNUTLS_CIPHER_INIT not
|
||||
defined
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In file included from dlls/bcrypt/gnutls.c:1916:
|
||||
include/windef.h:112:24: error: unknown type name ‘va_list’
|
||||
112 | # define __ms_va_list va_list
|
||||
| ^~~~~~~
|
||||
include/winbase.h:2076:84: note: in expansion of macro ‘__ms_va_list’
|
||||
2076 | WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*);
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/bcrypt/gnutls.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 37a80bdc062..64825f5b99b 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -25,9 +25,10 @@
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
+#include <stdarg.h>
|
||||
+
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
|
||||
-#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <gnutls/crypto.h>
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,61 @@
|
||||
From 990050ed436283fb820d4fe64b08dda3ac7ea9e2 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:34:28 +1000
|
||||
Subject: [PATCH 2/2] d3d10: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/d3d10/effect.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
|
||||
index 86ef50aac01..060fb69ce3e 100644
|
||||
--- a/dlls/d3d10/effect.c
|
||||
+++ b/dlls/d3d10/effect.c
|
||||
@@ -126,7 +126,7 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D1
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderVariable(ID3D10EffectShaderVariable *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
struct d3d10_effect_state_property_info
|
||||
@@ -4665,7 +4665,7 @@ static void read_variable_array_from_buffer(struct d3d10_effect_variable *variab
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectScalarVariable(ID3D10EffectScalarVariable *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
|
||||
@@ -5001,7 +5001,7 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVectorVariable(ID3D10EffectVectorVariable *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
|
||||
@@ -5488,7 +5488,7 @@ static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable
|
||||
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectMatrixVariable(ID3D10EffectMatrixVariable *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
|
||||
@@ -5995,7 +5995,7 @@ static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10S
|
||||
static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderResourceVariable(
|
||||
ID3D10EffectShaderResourceVariable *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
+ return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
|
||||
}
|
||||
|
||||
static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,34 @@
|
||||
From dd8e8e98edf2f16a4fd4109cd283cf7949a3cb9b Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:39:56 +1000
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/d2d1/geometry.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
|
||||
index eb353669030..3e00edfd1b3 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
+++ b/dlls/d2d1/geometry.c
|
||||
@@ -3615,7 +3615,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1EllipseGeometry(ID2D1EllipseGeometry *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Geometry*)iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_ellipse_geometry_QueryInterface(ID2D1EllipseGeometry *iface,
|
||||
@@ -4237,7 +4237,7 @@ fail:
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1RoundedRectangleGeometry(ID2D1RoundedRectangleGeometry *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Geometry*)iface, struct d2d_geometry, ID2D1Geometry_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_rounded_rectangle_geometry_QueryInterface(ID2D1RoundedRectangleGeometry *iface,
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,25 @@
|
||||
From f8ce184f72c416a1ce249afe313b698013e961b3 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:46:25 +1000
|
||||
Subject: [PATCH] dxgi: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/dxgi/output.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dxgi/output.c b/dlls/dxgi/output.c
|
||||
index f341388766c..64f87202741 100644
|
||||
--- a/dlls/dxgi/output.c
|
||||
+++ b/dlls/dxgi/output.c
|
||||
@@ -711,7 +711,7 @@ struct dxgi_output *unsafe_impl_from_IDXGIOutput(IDXGIOutput *iface)
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (IDXGIOutputVtbl *)&dxgi_output_vtbl);
|
||||
- return CONTAINING_RECORD(iface, struct dxgi_output, IDXGIOutput6_iface);
|
||||
+ return CONTAINING_RECORD((IDXGIOutput6*)iface, struct dxgi_output, IDXGIOutput6_iface);
|
||||
}
|
||||
|
||||
static void dxgi_output_init(struct dxgi_output *output, unsigned int output_idx,
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,25 @@
|
||||
From 272753daf4f20b7fe3c646eae4fd78f1b254c9a6 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 09:57:01 +1000
|
||||
Subject: [PATCH] msctf: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/msctf/range.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/msctf/range.c b/dlls/msctf/range.c
|
||||
index 9690a0a15c4..e15123eeb89 100644
|
||||
--- a/dlls/msctf/range.c
|
||||
+++ b/dlls/msctf/range.c
|
||||
@@ -54,7 +54,7 @@ static inline Range *impl_from_ITfRangeACP(ITfRangeACP *iface)
|
||||
|
||||
static Range *unsafe_impl_from_ITfRange(ITfRange *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, Range, ITfRangeACP_iface);
|
||||
+ return CONTAINING_RECORD((ITfRangeACP*)iface, Range, ITfRangeACP_iface);
|
||||
}
|
||||
|
||||
static void Range_Destructor(Range *This)
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,39 @@
|
||||
From f34ee38467781b2f7bae7e7f8a04a4210bf7d046 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 11:22:48 +1000
|
||||
Subject: [PATCH] rpcrt4: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/rpcrt4/ndr_marshall.c | 2 +-
|
||||
dlls/rpcrt4/ndr_typelib.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
|
||||
index 764b304a047..58ea128e8a4 100644
|
||||
--- a/dlls/rpcrt4/ndr_marshall.c
|
||||
+++ b/dlls/rpcrt4/ndr_marshall.c
|
||||
@@ -6999,7 +6999,7 @@ static unsigned char *WINAPI NdrContextHandleMarshall(
|
||||
}
|
||||
else
|
||||
{
|
||||
- NDR_SCONTEXT ctxt = CONTAINING_RECORD(pMemory, struct _NDR_SCONTEXT, userContext);
|
||||
+ NDR_SCONTEXT ctxt = CONTAINING_RECORD((void * const*)pMemory, struct _NDR_SCONTEXT, userContext);
|
||||
NDR_RUNDOWN rundown = pStubMsg->StubDesc->apfnNdrRundownRoutines[pFormat[2]];
|
||||
NdrServerContextNewMarshall(pStubMsg, ctxt, rundown, pFormat);
|
||||
}
|
||||
diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
|
||||
index f1f25885b75..126e8ec8766 100644
|
||||
--- a/dlls/rpcrt4/ndr_typelib.c
|
||||
+++ b/dlls/rpcrt4/ndr_typelib.c
|
||||
@@ -1452,7 +1452,7 @@ struct typelib_stub
|
||||
|
||||
static ULONG WINAPI typelib_stub_Release(IRpcStubBuffer *iface)
|
||||
{
|
||||
- struct typelib_stub *stub = CONTAINING_RECORD(iface, struct typelib_stub, stub.stub_buffer);
|
||||
+ struct typelib_stub *stub = CONTAINING_RECORD((CStdStubBuffer *)iface, struct typelib_stub, stub.stub_buffer);
|
||||
ULONG refcount = InterlockedDecrement(&stub->stub.stub_buffer.RefCount);
|
||||
|
||||
TRACE("(%p) decreasing refs to %d\n", stub, refcount);
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,34 @@
|
||||
From 4801b547b70654507cb8a25dcfd1efc862dcf467 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 8 Jun 2021 11:38:46 +1000
|
||||
Subject: [PATCH] wbemdisp: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/wbemdisp/locator.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c
|
||||
index e0a1872d38f..5bb2a187f2c 100644
|
||||
--- a/dlls/wbemdisp/locator.c
|
||||
+++ b/dlls/wbemdisp/locator.c
|
||||
@@ -1751,7 +1751,7 @@ static struct object *unsafe_object_impl_from_IDispatch(IDispatch *iface)
|
||||
FIXME( "External implementations are not supported.\n" );
|
||||
return NULL;
|
||||
}
|
||||
- return CONTAINING_RECORD(iface, struct object, ISWbemObject_iface);
|
||||
+ return CONTAINING_RECORD((ISWbemObject *)iface, struct object, ISWbemObject_iface);
|
||||
}
|
||||
|
||||
static HRESULT SWbemObject_create( struct services *services, IWbemClassObject *wbem_object,
|
||||
@@ -3587,7 +3587,7 @@ static struct namedvalueset *unsafe_valueset_impl_from_IDispatch(IDispatch *ifac
|
||||
FIXME( "External implementations are not supported.\n" );
|
||||
return NULL;
|
||||
}
|
||||
- return CONTAINING_RECORD(iface, struct namedvalueset, ISWbemNamedValueSet_iface);
|
||||
+ return CONTAINING_RECORD((ISWbemNamedValueSet*)iface, struct namedvalueset, ISWbemNamedValueSet_iface);
|
||||
}
|
||||
|
||||
HRESULT SWbemNamedValueSet_create( void **obj )
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,27 @@
|
||||
From ebf3df9837ac6707fe831722c7ed24ccd80f95ce Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Crider <gloriouseggroll@gmail.com>
|
||||
Date: Sat, 29 May 2021 14:39:08 -0600
|
||||
Subject: [PATCH] api-ms-win-core-psapi-l1-1-0: Add K32GetModuleBaseNameW and
|
||||
K32GetModuleInformation.
|
||||
|
||||
Needed for Mass Effect Legendary Edition.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51199
|
||||
Signed-off-by: Thomas Crider <gloriouseggroll@gmail.com>
|
||||
---
|
||||
.../api-ms-win-core-psapi-l1-1-0.spec | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/dlls/api-ms-win-core-psapi-l1-1-0/api-ms-win-core-psapi-l1-1-0.spec b/dlls/api-ms-win-core-psapi-l1-1-0/api-ms-win-core-psapi-l1-1-0.spec
|
||||
index c54c1077843..321fc3fe928 100644
|
||||
--- a/dlls/api-ms-win-core-psapi-l1-1-0/api-ms-win-core-psapi-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-core-psapi-l1-1-0/api-ms-win-core-psapi-l1-1-0.spec
|
||||
@@ -14,3 +14,5 @@
|
||||
@ stdcall K32QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet
|
||||
@ stdcall K32QueryWorkingSetEx(long ptr long) kernel32.K32QueryWorkingSetEx
|
||||
@ stdcall QueryFullProcessImageNameW(ptr long ptr ptr) kernel32.QueryFullProcessImageNameW
|
||||
+@ stdcall K32GetModuleBaseNameW(long long ptr long) kernel32.K32GetModuleBaseNameW
|
||||
+@ stdcall K32GetModuleInformation(long long ptr long) kernel32.K32GetModuleInformation
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,25 @@
|
||||
From c96b3a0632721f8849fb1d8404272b5007c1d1b4 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Crider <gloriouseggroll@gmail.com>
|
||||
Date: Sat, 29 May 2021 14:39:09 -0600
|
||||
Subject: [PATCH] api-ms-win-core-psapi-ansi-l1-1-0: add K32GetModuleBaseNameA
|
||||
|
||||
Needed for Mass Effect Legendary Edition.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51199
|
||||
Signed-off-by: Thomas Crider <gloriouseggroll@gmail.com>
|
||||
---
|
||||
.../api-ms-win-core-psapi-ansi-l1-1-0.spec | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/api-ms-win-core-psapi-ansi-l1-1-0/api-ms-win-core-psapi-ansi-l1-1-0.spec b/dlls/api-ms-win-core-psapi-ansi-l1-1-0/api-ms-win-core-psapi-ansi-l1-1-0.spec
|
||||
index e4f758581f6..340198c6edf 100644
|
||||
--- a/dlls/api-ms-win-core-psapi-ansi-l1-1-0/api-ms-win-core-psapi-ansi-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-core-psapi-ansi-l1-1-0/api-ms-win-core-psapi-ansi-l1-1-0.spec
|
||||
@@ -4,3 +4,4 @@
|
||||
@ stdcall K32GetMappedFileNameA(long ptr ptr long) kernel32.K32GetMappedFileNameA
|
||||
@ stdcall K32GetProcessImageFileNameA(long ptr long) kernel32.K32GetProcessImageFileNameA
|
||||
@ stdcall QueryFullProcessImageNameA(ptr long ptr ptr) kernel32.QueryFullProcessImageNameA
|
||||
+@ stdcall K32GetModuleBaseNameA(long long ptr long) kernel32.K32GetModuleBaseNameA
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1 @@
|
||||
Fixes: [51199] Add missing api-ms-win-core-psapi forwards
|
@@ -1,4 +1,4 @@
|
||||
From 6d925cb20409888ada3e469a2a09b1bfc726fa79 Mon Sep 17 00:00:00 2001
|
||||
From 89c22c9894fd170b0b3a99309540c88059c64824 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Fri, 2 Oct 2020 11:29:24 -0500
|
||||
Subject: [PATCH] bcrypt: Allow multiple backends to coexist.
|
||||
@@ -7,10 +7,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
---
|
||||
dlls/bcrypt/Makefile.in | 3 +-
|
||||
dlls/bcrypt/bcrypt_internal.h | 3 +
|
||||
dlls/bcrypt/gnutls.c | 32 ++++--
|
||||
dlls/bcrypt/gnutls.c | 34 ++++--
|
||||
dlls/bcrypt/macos.c | 18 ++-
|
||||
dlls/bcrypt/unixlib.c | 211 ++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 252 insertions(+), 15 deletions(-)
|
||||
5 files changed, 253 insertions(+), 16 deletions(-)
|
||||
create mode 100644 dlls/bcrypt/unixlib.c
|
||||
|
||||
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
|
||||
@@ -27,10 +27,10 @@ index 24803fb2d7c..46a20d473dd 100644
|
||||
|
||||
RC_SRCS = version.rc
|
||||
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
|
||||
index eb136111509..3c7110d05f8 100644
|
||||
index 61c367cae9d..d0697ed807e 100644
|
||||
--- a/dlls/bcrypt/bcrypt_internal.h
|
||||
+++ b/dlls/bcrypt/bcrypt_internal.h
|
||||
@@ -218,4 +218,7 @@ struct key_funcs
|
||||
@@ -219,4 +219,7 @@ struct key_funcs
|
||||
NTSTATUS (CDECL *key_import_rsa)( struct key *, UCHAR *, ULONG );
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ index eb136111509..3c7110d05f8 100644
|
||||
+
|
||||
#endif /* __BCRYPT_INTERNAL_H */
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 2f0c62bc6da..4a9dcf9de8a 100644
|
||||
index 9c1e7b5ab06..9b716c6f536 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -372,9 +372,12 @@ fail:
|
||||
@@ -58,7 +58,16 @@ index 2f0c62bc6da..4a9dcf9de8a 100644
|
||||
}
|
||||
|
||||
struct buffer
|
||||
@@ -1899,19 +1902,28 @@ static const struct key_funcs key_funcs =
|
||||
@@ -1869,7 +1872,7 @@ static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULO
|
||||
return status;
|
||||
}
|
||||
|
||||
-static const struct key_funcs key_funcs =
|
||||
+static struct key_funcs key_funcs =
|
||||
{
|
||||
key_set_property,
|
||||
key_symmetric_init,
|
||||
@@ -1893,19 +1896,28 @@ static const struct key_funcs key_funcs =
|
||||
key_import_rsa
|
||||
};
|
||||
|
||||
@@ -95,7 +104,7 @@ index 2f0c62bc6da..4a9dcf9de8a 100644
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
|
||||
index 44906519cef..2a88aec8362 100644
|
||||
index 20e1a61e3fb..1e364ac05a3 100644
|
||||
--- a/dlls/bcrypt/macos.c
|
||||
+++ b/dlls/bcrypt/macos.c
|
||||
@@ -302,11 +302,21 @@ static const struct key_funcs key_funcs =
|
||||
@@ -126,7 +135,7 @@ index 44906519cef..2a88aec8362 100644
|
||||
#endif
|
||||
diff --git a/dlls/bcrypt/unixlib.c b/dlls/bcrypt/unixlib.c
|
||||
new file mode 100644
|
||||
index 00000000000..9cbb25f5740
|
||||
index 00000000000..6c3aff80373
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/unixlib.c
|
||||
@@ -0,0 +1,211 @@
|
||||
@@ -262,7 +271,7 @@ index 00000000000..9cbb25f5740
|
||||
+}
|
||||
+
|
||||
+static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len,
|
||||
+ UCHAR *output, ULONG *output_len )
|
||||
+ UCHAR *output, ULONG *output_len, ULONG *ret_len )
|
||||
+{
|
||||
+ FIXME( "not implemented\n" );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
|
@@ -1,34 +0,0 @@
|
||||
From 29866a3cb6dc799b060565d94608c7b25bd26509 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 21 May 2021 23:44:39 -0500
|
||||
Subject: [PATCH] d3d11/tests: Add a couple of extra tests for SRV/RTV
|
||||
conflict.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 47c6613d904..5ab08632367 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -32364,6 +32364,15 @@ static void test_deferred_context_state(void)
|
||||
ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv);
|
||||
ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv);
|
||||
|
||||
+ ID3D11DeviceContext_PSSetShaderResources(deferred, 0, 1, &srv);
|
||||
+ ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv);
|
||||
+ ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv);
|
||||
+
|
||||
+ ID3D11DeviceContext_PSSetShaderResources(immediate, 0, 1, &srv);
|
||||
+ ID3D11DeviceContext_PSGetShaderResources(immediate, 0, 1, &ret_srv);
|
||||
+ ok(ret_srv == srv, "Got unexpected SRV %p.\n", ret_srv);
|
||||
+ ID3D11ShaderResourceView_Release(ret_srv);
|
||||
+
|
||||
ID3D11ShaderResourceView_Release(srv);
|
||||
ID3D11RenderTargetView_Release(rtv);
|
||||
ID3D11Texture2D_Release(texture);
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,286 +0,0 @@
|
||||
From bca2466f49202f638339644f9c92b3573b719822 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Sat, 22 May 2021 00:27:53 -0500
|
||||
Subject: [PATCH] wined3d: Check for SRV/RTV binding conflicts per
|
||||
wined3d_state.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/wined3d/context.c | 19 ++++-
|
||||
dlls/wined3d/device.c | 23 ++++--
|
||||
dlls/wined3d/resource.c | 1 -
|
||||
dlls/wined3d/wined3d_private.h | 125 +++++++--------------------------
|
||||
4 files changed, 61 insertions(+), 107 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 2debf50de7f..7f50126204b 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -335,6 +335,23 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi
|
||||
}
|
||||
}
|
||||
|
||||
+static bool is_resource_rtv_bound(const struct wined3d_state *state,
|
||||
+ const struct wined3d_resource *resource)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ if (!resource->rtv_bind_count_device)
|
||||
+ return false;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
|
||||
+ {
|
||||
+ if (state->fb.render_targets[i] && state->fb.render_targets[i]->resource == resource)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
/* Context activation is done by the caller. */
|
||||
static void context_preload_texture(struct wined3d_context *context,
|
||||
const struct wined3d_state *state, unsigned int idx)
|
||||
@@ -344,7 +361,7 @@ static void context_preload_texture(struct wined3d_context *context,
|
||||
if (!(texture = state->textures[idx]))
|
||||
return;
|
||||
|
||||
- if ((texture->resource.rtv_full_bind_count_device + texture->resource.rtv_partial_bind_count_device)
|
||||
+ if (is_resource_rtv_bound(state, &texture->resource)
|
||||
|| (state->fb.depth_stencil && state->fb.depth_stencil->resource == &texture->resource))
|
||||
context->uses_fbo_attached_resources = 1;
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index dbb5dcf2672..2c8ebba8844 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1985,7 +1985,7 @@ void CDECL wined3d_device_context_set_shader_resource_view(struct wined3d_device
|
||||
if (view == prev)
|
||||
return;
|
||||
|
||||
- if (view && (wined3d_is_srv_rtv_bound(view)
|
||||
+ if (view && (wined3d_is_srv_rtv_bound(state, view)
|
||||
|| ((dsv = state->fb.depth_stencil)
|
||||
&& dsv->resource == view->resource && wined3d_dsv_srv_conflict(dsv, view->format))))
|
||||
{
|
||||
@@ -2064,22 +2064,31 @@ void CDECL wined3d_device_context_set_unordered_access_view(struct wined3d_devic
|
||||
static void wined3d_device_context_unbind_srv_for_rtv(struct wined3d_device_context *context,
|
||||
const struct wined3d_rendertarget_view *view, BOOL dsv)
|
||||
{
|
||||
- struct wined3d_state *state = context->state;
|
||||
+ const struct wined3d_state *state = context->state;
|
||||
+ const struct wined3d_resource *resource;
|
||||
|
||||
- if (view && wined3d_is_rtv_srv_bound(view))
|
||||
+ if (!view)
|
||||
+ return;
|
||||
+ resource = view->resource;
|
||||
+
|
||||
+ if (resource->srv_bind_count_device)
|
||||
{
|
||||
- const struct wined3d_resource *resource = view->resource;
|
||||
const struct wined3d_shader_resource_view *srv;
|
||||
unsigned int i, j;
|
||||
|
||||
- WARN("Application sets bound resource as render target.\n");
|
||||
-
|
||||
for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
|
||||
+ {
|
||||
for (j = 0; j < MAX_SHADER_RESOURCE_VIEWS; ++j)
|
||||
+ {
|
||||
if ((srv = state->shader_resource_view[i][j]) && srv->resource == resource
|
||||
- && ((!dsv && wined3d_is_srv_rtv_bound(srv))
|
||||
+ && ((!dsv && wined3d_is_srv_rtv_bound(state, srv))
|
||||
|| (dsv && wined3d_dsv_srv_conflict(view, srv->format))))
|
||||
+ {
|
||||
+ WARN("Application sets bound resource as render target.\n");
|
||||
wined3d_device_context_set_shader_resource_view(context, i, j, NULL);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 6e34605f547..58e3e5c77fd 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -235,7 +235,6 @@ static void wined3d_resource_destroy_object(void *object)
|
||||
|
||||
TRACE("resource %p.\n", resource);
|
||||
|
||||
- heap_free(resource->sub_resource_bind_counts_device);
|
||||
wined3d_resource_free_sysmem(resource);
|
||||
context_resource_released(resource->device, resource);
|
||||
wined3d_resource_release(resource);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 4c308d2ac05..fadad706af4 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -4084,16 +4084,8 @@ struct wined3d_resource
|
||||
|
||||
struct list resource_list_entry;
|
||||
|
||||
- struct
|
||||
- {
|
||||
- uint32_t srv;
|
||||
- uint32_t rtv;
|
||||
- }
|
||||
- *sub_resource_bind_counts_device;
|
||||
- uint32_t srv_full_bind_count_device;
|
||||
- uint32_t rtv_full_bind_count_device;
|
||||
- uint32_t srv_partial_bind_count_device;
|
||||
- uint32_t rtv_partial_bind_count_device;
|
||||
+ uint32_t srv_bind_count_device;
|
||||
+ uint32_t rtv_bind_count_device;
|
||||
};
|
||||
|
||||
static inline ULONG wined3d_resource_incref(struct wined3d_resource *resource)
|
||||
@@ -6214,120 +6206,57 @@ static inline bool wined3d_rtv_all_subresources(const struct wined3d_rendertarge
|
||||
return texture->level_count == 1 && rtv->layer_count == wined3d_bind_layer_count(texture);
|
||||
}
|
||||
|
||||
-static inline void wined3d_srv_bind_count_add(struct wined3d_shader_resource_view *srv, int value)
|
||||
-{
|
||||
- struct wined3d_resource *resource = srv->resource;
|
||||
- struct wined3d_texture *texture;
|
||||
- unsigned int level, layer;
|
||||
-
|
||||
- if (wined3d_srv_all_subresources(srv))
|
||||
- {
|
||||
- resource->srv_full_bind_count_device += value;
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- resource->srv_partial_bind_count_device += value;
|
||||
-
|
||||
- texture = texture_from_resource(resource);
|
||||
-
|
||||
- if (!resource->sub_resource_bind_counts_device
|
||||
- && !(resource->sub_resource_bind_counts_device = heap_alloc_zero(texture->level_count
|
||||
- * wined3d_bind_layer_count(texture) * sizeof(*resource->sub_resource_bind_counts_device))))
|
||||
- return;
|
||||
-
|
||||
- for (layer = 0; layer < srv->desc.u.texture.layer_count; ++layer)
|
||||
- for (level = 0; level < srv->desc.u.texture.level_count; ++level)
|
||||
- resource->sub_resource_bind_counts_device[(layer + srv->desc.u.texture.layer_idx)
|
||||
- * texture->level_count + srv->desc.u.texture.level_idx + level].srv += value;
|
||||
-}
|
||||
-
|
||||
static inline void wined3d_srv_bind_count_inc(struct wined3d_shader_resource_view *srv)
|
||||
{
|
||||
- wined3d_srv_bind_count_add(srv, 1);
|
||||
+ ++srv->resource->srv_bind_count_device;
|
||||
}
|
||||
|
||||
static inline void wined3d_srv_bind_count_dec(struct wined3d_shader_resource_view *srv)
|
||||
{
|
||||
- wined3d_srv_bind_count_add(srv, -1);
|
||||
-}
|
||||
-
|
||||
-static inline void wined3d_rtv_bind_count_add(struct wined3d_rendertarget_view *rtv, int value)
|
||||
-{
|
||||
- struct wined3d_resource *resource = rtv->resource;
|
||||
- struct wined3d_texture *texture;
|
||||
- unsigned int layer;
|
||||
-
|
||||
- if (wined3d_rtv_all_subresources(rtv))
|
||||
- {
|
||||
- resource->rtv_full_bind_count_device += value;
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- resource->rtv_partial_bind_count_device += value;
|
||||
-
|
||||
- texture = texture_from_resource(resource);
|
||||
-
|
||||
- if (!resource->sub_resource_bind_counts_device
|
||||
- && !(resource->sub_resource_bind_counts_device = heap_alloc_zero(texture->level_count
|
||||
- * wined3d_bind_layer_count(texture) * sizeof(*resource->sub_resource_bind_counts_device))))
|
||||
- return;
|
||||
-
|
||||
- for (layer = 0; layer < rtv->layer_count; ++layer)
|
||||
- resource->sub_resource_bind_counts_device[rtv->sub_resource_idx + layer * texture->level_count].rtv += value;
|
||||
+ --srv->resource->srv_bind_count_device;
|
||||
}
|
||||
|
||||
static inline void wined3d_rtv_bind_count_inc(struct wined3d_rendertarget_view *rtv)
|
||||
{
|
||||
- wined3d_rtv_bind_count_add(rtv, 1);
|
||||
+ ++rtv->resource->rtv_bind_count_device;
|
||||
}
|
||||
|
||||
static inline void wined3d_rtv_bind_count_dec(struct wined3d_rendertarget_view *rtv)
|
||||
{
|
||||
- wined3d_rtv_bind_count_add(rtv, -1);
|
||||
+ --rtv->resource->rtv_bind_count_device;
|
||||
}
|
||||
|
||||
-static inline bool wined3d_is_srv_rtv_bound(const struct wined3d_shader_resource_view *srv)
|
||||
+static inline bool wined3d_rtv_overlaps_srv(const struct wined3d_rendertarget_view *rtv,
|
||||
+ const struct wined3d_shader_resource_view *srv)
|
||||
{
|
||||
- struct wined3d_resource *resource = srv->resource;
|
||||
- struct wined3d_texture *texture;
|
||||
- unsigned int level, layer;
|
||||
+ if (rtv->resource != srv->resource)
|
||||
+ return false;
|
||||
|
||||
- if (!(resource->rtv_full_bind_count_device + resource->rtv_partial_bind_count_device))
|
||||
- return FALSE;
|
||||
+ if (wined3d_srv_all_subresources(srv) || wined3d_rtv_all_subresources(rtv))
|
||||
+ return true;
|
||||
|
||||
- if (resource->rtv_full_bind_count_device || wined3d_srv_all_subresources(srv))
|
||||
- return TRUE;
|
||||
-
|
||||
- texture = texture_from_resource(resource);
|
||||
-
|
||||
- for (layer = 0; layer < srv->desc.u.texture.layer_count; ++layer)
|
||||
- for (level = 0; level < srv->desc.u.texture.level_count; ++level)
|
||||
- if (resource->sub_resource_bind_counts_device[(layer + srv->desc.u.texture.layer_idx)
|
||||
- * texture->level_count + srv->desc.u.texture.level_idx + level].rtv)
|
||||
- return TRUE;
|
||||
-
|
||||
- return FALSE;
|
||||
+ return rtv->sub_resource_idx >= srv->desc.u.texture.level_idx
|
||||
+ && rtv->sub_resource_idx < srv->desc.u.texture.level_idx + srv->desc.u.texture.level_count
|
||||
+ && rtv->layer_count >= srv->desc.u.texture.layer_idx;
|
||||
}
|
||||
|
||||
-static inline bool wined3d_is_rtv_srv_bound(const struct wined3d_rendertarget_view *rtv)
|
||||
+static inline bool wined3d_is_srv_rtv_bound(const struct wined3d_state *state,
|
||||
+ const struct wined3d_shader_resource_view *srv)
|
||||
{
|
||||
- struct wined3d_resource *resource = rtv->resource;
|
||||
- struct wined3d_texture *texture;
|
||||
- unsigned int layer;
|
||||
+ unsigned int i;
|
||||
|
||||
- if (!(resource->srv_full_bind_count_device + resource->srv_partial_bind_count_device))
|
||||
- return FALSE;
|
||||
+ if (!srv->resource->rtv_bind_count_device)
|
||||
+ return false;
|
||||
|
||||
- if (resource->srv_full_bind_count_device || wined3d_rtv_all_subresources(rtv))
|
||||
- return TRUE;
|
||||
+ for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
|
||||
+ {
|
||||
+ const struct wined3d_rendertarget_view *rtv;
|
||||
|
||||
- texture = texture_from_resource(resource);
|
||||
+ if ((rtv = state->fb.render_targets[i]) && wined3d_rtv_overlaps_srv(rtv, srv))
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
- for (layer = 0; layer < rtv->layer_count; ++layer)
|
||||
- if (resource->sub_resource_bind_counts_device[rtv->sub_resource_idx + layer * texture->level_count].srv)
|
||||
- return TRUE;
|
||||
-
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
static inline void wined3d_viewport_get_z_range(const struct wined3d_viewport *vp, float *min_z, float *max_z)
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,270 +0,0 @@
|
||||
From d591728c209f7fd9e438eebfb3977692d13bbd6b Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Tue, 18 May 2021 21:42:01 -0500
|
||||
Subject: [PATCH] d3d11/tests: Add some tests for Map() on deferred contexts.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 239 +++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 239 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 5ab08632367..e5d46f445a4 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -32706,6 +32706,244 @@ static void test_deferred_context_rendering(void)
|
||||
release_test_context(&test_context);
|
||||
}
|
||||
|
||||
+static void test_deferred_context_map(void)
|
||||
+{
|
||||
+ ID3D11DeviceContext *immediate, *deferred;
|
||||
+ struct d3d11_test_context test_context;
|
||||
+ D3D11_SUBRESOURCE_DATA resource_data;
|
||||
+ D3D11_BUFFER_DESC buffer_desc = {0};
|
||||
+ D3D11_MAPPED_SUBRESOURCE map_desc;
|
||||
+ ID3D11Buffer *buffer, *buffer2;
|
||||
+ struct resource_readback rb;
|
||||
+ ID3D11CommandList *list;
|
||||
+ float data[16], value;
|
||||
+ ID3D11Device *device;
|
||||
+ float *map_data;
|
||||
+ unsigned int i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!init_test_context(&test_context, NULL))
|
||||
+ return;
|
||||
+
|
||||
+ device = test_context.device;
|
||||
+ immediate = test_context.immediate_context;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
|
||||
+ todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ release_test_context(&test_context);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ data[i] = i;
|
||||
+ resource_data.pSysMem = data;
|
||||
+ resource_data.SysMemPitch = 0;
|
||||
+ resource_data.SysMemSlicePitch = 0;
|
||||
+
|
||||
+ buffer_desc.ByteWidth = sizeof(data);
|
||||
+ buffer_desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
+ buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
+ buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
+ hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer);
|
||||
+ ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr);
|
||||
+ hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer2);
|
||||
+ ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ_WRITE, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
|
||||
+ ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ /* The previous contents of map_data are undefined and may in practice be
|
||||
+ * uninitialized garbage. */
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = 2 * i;
|
||||
+
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = 2 * i;
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list);
|
||||
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11CommandList_Release(list);
|
||||
+
|
||||
+ /* Test WRITE_NO_OVERWRITE. */
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = i;
|
||||
+ ID3D11DeviceContext_Unmap(immediate, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
|
||||
+ ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = 2 * i;
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ_WRITE, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ ok(map_data[i] == 2 * i, "Got unexpected value %.8e at %u.\n", map_data[i], i);
|
||||
+ if (i % 2)
|
||||
+ map_data[i] = 3 * i;
|
||||
+ }
|
||||
+ memcpy(data, map_data, sizeof(data));
|
||||
+
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ ok(map_data[i] == data[i], "Got unexpected value %.8e at %u.\n", map_data[i], i);
|
||||
+ if (i % 3)
|
||||
+ map_data[i] = 4 * i;
|
||||
+ }
|
||||
+ memcpy(data, map_data, sizeof(data));
|
||||
+
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list);
|
||||
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == data[i], "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11CommandList_Release(list);
|
||||
+
|
||||
+ /* Do something with the mapped data from within the deferred context. */
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = i;
|
||||
+ ID3D11DeviceContext_Unmap(immediate, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = 2 * i;
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ ID3D11DeviceContext_CopyResource(deferred, (ID3D11Resource *)buffer2, (ID3D11Resource *)buffer);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ map_data = map_desc.pData;
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ map_data[i] = 3 * i;
|
||||
+ ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list);
|
||||
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE);
|
||||
+
|
||||
+ get_buffer_readback(buffer2, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == 3 * i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11CommandList_Release(list);
|
||||
+
|
||||
+ ID3D11Buffer_Release(buffer2);
|
||||
+ ID3D11Buffer_Release(buffer);
|
||||
+ ID3D11DeviceContext_Release(deferred);
|
||||
+ release_test_context(&test_context);
|
||||
+}
|
||||
+
|
||||
START_TEST(d3d11)
|
||||
{
|
||||
unsigned int argc, i;
|
||||
@@ -32876,6 +33114,7 @@ START_TEST(d3d11)
|
||||
queue_test(test_deferred_context_state);
|
||||
queue_test(test_deferred_context_swap_state);
|
||||
queue_test(test_deferred_context_rendering);
|
||||
+ queue_test(test_deferred_context_map);
|
||||
queue_test(test_unbound_streams);
|
||||
|
||||
run_queued_tests();
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,70 +0,0 @@
|
||||
From 621c0b6f10a09dd7300caa8870015a931d338e85 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 21 May 2021 22:17:30 -0500
|
||||
Subject: [PATCH] d3d11/tests: Add some tests for UpdateSubresource() on a
|
||||
deferred context.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 45 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 45 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index e5d46f445a4..0f5ba6c3663 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -32940,6 +32940,51 @@ static void test_deferred_context_map(void)
|
||||
|
||||
ID3D11Buffer_Release(buffer2);
|
||||
ID3D11Buffer_Release(buffer);
|
||||
+
|
||||
+ /* Test UpdateSubresource. */
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ data[i] = i;
|
||||
+
|
||||
+ buffer_desc.ByteWidth = sizeof(data);
|
||||
+ buffer_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
+ buffer_desc.CPUAccessFlags = 0;
|
||||
+ hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer);
|
||||
+ ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr);
|
||||
+ hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer2);
|
||||
+ ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ data[i] = 2 * i;
|
||||
+ ID3D11DeviceContext_UpdateSubresource(deferred, (ID3D11Resource *)buffer, 0, NULL, data, 0, 0);
|
||||
+
|
||||
+ hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list);
|
||||
+ ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE);
|
||||
+
|
||||
+ get_buffer_readback(buffer, &rb);
|
||||
+ for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
+ {
|
||||
+ value = get_readback_float(&rb, i, 0);
|
||||
+ ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i);
|
||||
+ }
|
||||
+ release_resource_readback(&rb);
|
||||
+
|
||||
+ ID3D11CommandList_Release(list);
|
||||
+
|
||||
+ ID3D11Buffer_Release(buffer2);
|
||||
+ ID3D11Buffer_Release(buffer);
|
||||
+
|
||||
ID3D11DeviceContext_Release(deferred);
|
||||
release_test_context(&test_context);
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,92 +0,0 @@
|
||||
From 78d2694bb7cb03fa84c6a093ba28264f81adc143 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 12 May 2021 16:40:00 -0500
|
||||
Subject: [PATCH] wined3d: Store the framebuffer state inline in struct
|
||||
wined3d_cs_clear.
|
||||
|
||||
Avoid storing pointers to the CS data inside individual ops.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/wined3d/cs.c | 23 +++++++++++------------
|
||||
1 file changed, 11 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 14076defaa9..8702ac08631 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -107,7 +107,7 @@ struct wined3d_cs_clear
|
||||
enum wined3d_cs_op opcode;
|
||||
DWORD flags;
|
||||
unsigned int rt_count;
|
||||
- struct wined3d_fb_state *fb;
|
||||
+ struct wined3d_fb_state fb;
|
||||
RECT draw_rect;
|
||||
struct wined3d_color color;
|
||||
float depth;
|
||||
@@ -684,19 +684,19 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
const struct wined3d_cs_clear *op = data;
|
||||
unsigned int i;
|
||||
|
||||
- device->blitter->ops->blitter_clear(device->blitter, device, op->rt_count, op->fb,
|
||||
+ device->blitter->ops->blitter_clear(device->blitter, device, op->rt_count, &op->fb,
|
||||
op->rect_count, op->rects, &op->draw_rect, op->flags, &op->color, op->depth, op->stencil);
|
||||
|
||||
if (op->flags & WINED3DCLEAR_TARGET)
|
||||
{
|
||||
for (i = 0; i < op->rt_count; ++i)
|
||||
{
|
||||
- if (op->fb->render_targets[i])
|
||||
- wined3d_resource_release(op->fb->render_targets[i]->resource);
|
||||
+ if (op->fb.render_targets[i])
|
||||
+ wined3d_resource_release(op->fb.render_targets[i]->resource);
|
||||
}
|
||||
}
|
||||
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
|
||||
- wined3d_resource_release(op->fb->depth_stencil->resource);
|
||||
+ wined3d_resource_release(op->fb.depth_stencil->resource);
|
||||
}
|
||||
|
||||
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
|
||||
@@ -715,7 +715,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
op->opcode = WINED3D_CS_OP_CLEAR;
|
||||
op->flags = flags & (WINED3DCLEAR_TARGET | WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL);
|
||||
op->rt_count = rt_count;
|
||||
- op->fb = &cs->state.fb;
|
||||
+ op->fb = state->fb;
|
||||
SetRect(&op->draw_rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height);
|
||||
if (state->rasterizer_state && state->rasterizer_state->desc.scissor)
|
||||
IntersectRect(&op->draw_rect, &op->draw_rect, &state->scissor_rects[0]);
|
||||
@@ -746,24 +746,23 @@ void wined3d_device_context_emit_clear_rendertarget_view(struct wined3d_device_c
|
||||
struct wined3d_cs_clear *op;
|
||||
size_t size;
|
||||
|
||||
- size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(struct wined3d_fb_state);
|
||||
+ size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]);
|
||||
op = wined3d_device_context_require_space(context, size, WINED3D_CS_QUEUE_DEFAULT);
|
||||
- op->fb = (void *)&op->rects[1];
|
||||
|
||||
op->opcode = WINED3D_CS_OP_CLEAR;
|
||||
op->flags = flags & (WINED3DCLEAR_TARGET | WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL);
|
||||
if (flags & WINED3DCLEAR_TARGET)
|
||||
{
|
||||
op->rt_count = 1;
|
||||
- op->fb->render_targets[0] = view;
|
||||
- op->fb->depth_stencil = NULL;
|
||||
+ op->fb.render_targets[0] = view;
|
||||
+ op->fb.depth_stencil = NULL;
|
||||
op->color = *color;
|
||||
}
|
||||
else
|
||||
{
|
||||
op->rt_count = 0;
|
||||
- op->fb->render_targets[0] = NULL;
|
||||
- op->fb->depth_stencil = view;
|
||||
+ op->fb.render_targets[0] = NULL;
|
||||
+ op->fb.depth_stencil = view;
|
||||
op->depth = depth;
|
||||
op->stencil = stencil;
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,487 +0,0 @@
|
||||
From 6b084cc6c70ca2e68709bf417f9d485199e0a04c Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Thu, 6 May 2021 20:49:03 -0500
|
||||
Subject: [PATCH] d3d11: Implement ID3D11Device::CreateDeferredContext().
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42191
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/device.c | 70 +++++++++++++++---
|
||||
dlls/d3d11/tests/d3d11.c | 65 ++++++++--------
|
||||
dlls/wined3d/cs.c | 147 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/wined3d.spec | 3 +
|
||||
include/wine/wined3d.h | 3 +
|
||||
6 files changed, 250 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 1a8cdc6d77c..2b5a51afbd1 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -547,6 +547,7 @@ struct d3d11_device_context
|
||||
ID3D11Multithread ID3D11Multithread_iface;
|
||||
LONG refcount;
|
||||
|
||||
+ D3D11_DEVICE_CONTEXT_TYPE type;
|
||||
struct wined3d_device_context *wined3d_context;
|
||||
struct d3d_device *device;
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 2a012fce144..459c49145cd 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -351,7 +351,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_QueryInterface(ID3D11Devic
|
||||
{
|
||||
*out = &context->ID3D11DeviceContext1_iface;
|
||||
}
|
||||
- else if (IsEqualGUID(iid, &IID_ID3D11Multithread))
|
||||
+ else if (context->type == D3D11_DEVICE_CONTEXT_IMMEDIATE && IsEqualGUID(iid, &IID_ID3D11Multithread))
|
||||
{
|
||||
*out = &context->ID3D11Multithread_iface;
|
||||
}
|
||||
@@ -390,6 +390,11 @@ static ULONG STDMETHODCALLTYPE d3d11_device_context_Release(ID3D11DeviceContext1
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
+ if (context->type != D3D11_DEVICE_CONTEXT_IMMEDIATE)
|
||||
+ {
|
||||
+ wined3d_deferred_context_destroy(context->wined3d_context);
|
||||
+ heap_free(context);
|
||||
+ }
|
||||
ID3D11Device2_Release(&context->device->ID3D11Device2_iface);
|
||||
}
|
||||
|
||||
@@ -2645,9 +2650,11 @@ static void STDMETHODCALLTYPE d3d11_device_context_Flush(ID3D11DeviceContext1 *i
|
||||
|
||||
static D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE d3d11_device_context_GetType(ID3D11DeviceContext1 *iface)
|
||||
{
|
||||
+ struct d3d11_device_context *context = impl_from_ID3D11DeviceContext1(iface);
|
||||
+
|
||||
TRACE("iface %p.\n", iface);
|
||||
|
||||
- return D3D11_DEVICE_CONTEXT_IMMEDIATE;
|
||||
+ return context->type;
|
||||
}
|
||||
|
||||
static UINT STDMETHODCALLTYPE d3d11_device_context_GetContextFlags(ID3D11DeviceContext1 *iface)
|
||||
@@ -2826,13 +2833,18 @@ static void STDMETHODCALLTYPE d3d11_device_context_SwapDeviceContextState(ID3D11
|
||||
|
||||
TRACE("iface %p, state %p, prev %p.\n", iface, state, prev);
|
||||
|
||||
- if (!state)
|
||||
+ if (prev)
|
||||
+ *prev = NULL;
|
||||
+
|
||||
+ if (context->type != D3D11_DEVICE_CONTEXT_IMMEDIATE)
|
||||
{
|
||||
- if (prev)
|
||||
- *prev = NULL;
|
||||
+ WARN("SwapDeviceContextState is not allowed on a deferred context.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!state)
|
||||
+ return;
|
||||
+
|
||||
wined3d_mutex_lock();
|
||||
|
||||
prev_impl = device->state;
|
||||
@@ -3082,11 +3094,13 @@ static const struct ID3D11MultithreadVtbl d3d11_multithread_vtbl =
|
||||
d3d11_multithread_GetMultithreadProtected,
|
||||
};
|
||||
|
||||
-static void d3d11_device_context_init(struct d3d11_device_context *context, struct d3d_device *device)
|
||||
+static void d3d11_device_context_init(struct d3d11_device_context *context, struct d3d_device *device,
|
||||
+ D3D11_DEVICE_CONTEXT_TYPE type)
|
||||
{
|
||||
context->ID3D11DeviceContext1_iface.lpVtbl = &d3d11_device_context_vtbl;
|
||||
context->ID3D11Multithread_iface.lpVtbl = &d3d11_multithread_vtbl;
|
||||
context->refcount = 1;
|
||||
+ context->type = type;
|
||||
|
||||
context->device = device;
|
||||
ID3D11Device2_AddRef(&device->ID3D11Device2_iface);
|
||||
@@ -3575,13 +3589,49 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
+static HRESULT d3d11_deferred_context_create(struct d3d_device *device,
|
||||
+ UINT flags, struct d3d11_device_context **context)
|
||||
+{
|
||||
+ struct d3d11_device_context *object;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (flags)
|
||||
+ FIXME("Ignoring flags %#x.\n", flags);
|
||||
+
|
||||
+ if (!(object = heap_alloc_zero(sizeof(*object))))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ d3d11_device_context_init(object, device, D3D11_DEVICE_CONTEXT_DEFERRED);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ if (FAILED(hr = wined3d_deferred_context_create(device->wined3d_device, &object->wined3d_context)))
|
||||
+ {
|
||||
+ WARN("Failed to create wined3d deferred context, hr %#x.\n", hr);
|
||||
+ heap_free(object);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return hr;
|
||||
+ }
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ TRACE("Created deferred context %p.\n", object);
|
||||
+ *context = object;
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags,
|
||||
ID3D11DeviceContext **context)
|
||||
{
|
||||
- FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context);
|
||||
+ struct d3d_device *device = impl_from_ID3D11Device2(iface);
|
||||
+ struct d3d11_device_context *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- *context = NULL;
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, flags %#x, context %p.\n", iface, flags, context);
|
||||
+
|
||||
+ if (FAILED(hr = d3d11_deferred_context_create(device, flags, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *context = (ID3D11DeviceContext *)&object->ID3D11DeviceContext1_iface;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID iid,
|
||||
@@ -6655,7 +6705,7 @@ void d3d_device_init(struct d3d_device *device, void *outer_unknown)
|
||||
device->d3d11_only = FALSE;
|
||||
device->state = NULL;
|
||||
|
||||
- d3d11_device_context_init(&device->immediate_context, device);
|
||||
+ d3d11_device_context_init(&device->immediate_context, device, D3D11_DEVICE_CONTEXT_IMMEDIATE);
|
||||
ID3D11DeviceContext1_Release(&device->immediate_context.ID3D11DeviceContext1_iface);
|
||||
|
||||
wine_rb_init(&device->blend_states, d3d_blend_state_compare);
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 0f5ba6c3663..43ea70d2e9b 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -2266,6 +2266,8 @@ static void test_create_deferred_context(void)
|
||||
|
||||
hr = ID3D11Device_CreateDeferredContext(device, 0, &context);
|
||||
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
+ if (hr == S_OK)
|
||||
+ ID3D11DeviceContext_Release(context);
|
||||
|
||||
refcount = ID3D11Device_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
@@ -2278,9 +2280,7 @@ static void test_create_deferred_context(void)
|
||||
|
||||
expected_refcount = get_refcount(device) + 1;
|
||||
hr = ID3D11Device_CreateDeferredContext(device, 0, &context);
|
||||
- todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
- if (FAILED(hr))
|
||||
- goto done;
|
||||
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
refcount = get_refcount(device);
|
||||
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
|
||||
refcount = get_refcount(context);
|
||||
@@ -2294,7 +2294,6 @@ static void test_create_deferred_context(void)
|
||||
refcount = ID3D11DeviceContext_Release(context);
|
||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||
|
||||
-done:
|
||||
refcount = ID3D11Device_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
}
|
||||
@@ -32270,14 +32269,7 @@ static void test_deferred_context_state(void)
|
||||
ID3D11DeviceContext_PSSetConstantBuffers(immediate, 0, 1, &green_buffer);
|
||||
|
||||
hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
|
||||
- todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
- if (hr != S_OK)
|
||||
- {
|
||||
- ID3D11Buffer_Release(blue_buffer);
|
||||
- ID3D11Buffer_Release(green_buffer);
|
||||
- release_test_context(&test_context);
|
||||
- return;
|
||||
- }
|
||||
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
|
||||
ID3D11DeviceContext_PSGetConstantBuffers(deferred, 0, 1, &ret_buffer);
|
||||
ok(!ret_buffer, "Got unexpected buffer %p.\n", ret_buffer);
|
||||
@@ -32289,7 +32281,15 @@ static void test_deferred_context_state(void)
|
||||
ID3D11Buffer_Release(ret_buffer);
|
||||
|
||||
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1);
|
||||
- ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+ todo_wine ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ ID3D11DeviceContext_Release(deferred);
|
||||
+ ID3D11Buffer_Release(blue_buffer);
|
||||
+ ID3D11Buffer_Release(green_buffer);
|
||||
+ release_test_context(&test_context);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
ID3D11DeviceContext_PSGetConstantBuffers(deferred, 0, 1, &ret_buffer);
|
||||
ok(ret_buffer == blue_buffer, "Got unexpected buffer %p.\n", ret_buffer);
|
||||
@@ -32468,12 +32468,7 @@ static void test_deferred_context_rendering(void)
|
||||
immediate = test_context.immediate_context;
|
||||
|
||||
hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
|
||||
- todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
- if (hr != S_OK)
|
||||
- {
|
||||
- release_test_context(&test_context);
|
||||
- return;
|
||||
- }
|
||||
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
|
||||
memset(&blend_desc, 0, sizeof(blend_desc));
|
||||
|
||||
@@ -32492,7 +32487,16 @@ static void test_deferred_context_rendering(void)
|
||||
ID3D11DeviceContext_ClearRenderTargetView(deferred, test_context.backbuffer_rtv, green);
|
||||
|
||||
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1);
|
||||
- ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+ todo_wine ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ ID3D11BlendState_Release(red_blend);
|
||||
+ ID3D11BlendState_Release(green_blend);
|
||||
+ ID3D11BlendState_Release(blue_blend);
|
||||
+ ID3D11DeviceContext_Release(deferred);
|
||||
+ release_test_context(&test_context);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list2);
|
||||
ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
||||
@@ -32729,12 +32733,7 @@ static void test_deferred_context_map(void)
|
||||
immediate = test_context.immediate_context;
|
||||
|
||||
hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred);
|
||||
- todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
- if (hr != S_OK)
|
||||
- {
|
||||
- release_test_context(&test_context);
|
||||
- return;
|
||||
- }
|
||||
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(data); ++i)
|
||||
data[i] = i;
|
||||
@@ -32758,13 +32757,21 @@ static void test_deferred_context_map(void)
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc);
|
||||
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+ todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc);
|
||||
- ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
|
||||
+ todo_wine ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ ID3D11Buffer_Release(buffer2);
|
||||
+ ID3D11Buffer_Release(buffer);
|
||||
+ ID3D11DeviceContext_Release(deferred);
|
||||
+ release_test_context(&test_context);
|
||||
+ return;
|
||||
+ }
|
||||
map_data = map_desc.pData;
|
||||
/* The previous contents of map_data are undefined and may in practice be
|
||||
* uninitialized garbage. */
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 8702ac08631..9a143b915ed 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -3162,3 +3162,150 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
|
||||
heap_free(cs->data);
|
||||
heap_free(cs);
|
||||
}
|
||||
+
|
||||
+struct wined3d_deferred_context
|
||||
+{
|
||||
+ struct wined3d_device_context c;
|
||||
+
|
||||
+ SIZE_T data_size, data_capacity;
|
||||
+ void *data;
|
||||
+};
|
||||
+
|
||||
+static struct wined3d_deferred_context *wined3d_deferred_context_from_context(struct wined3d_device_context *context)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(context, struct wined3d_deferred_context, c);
|
||||
+}
|
||||
+
|
||||
+static void *wined3d_deferred_context_require_space(struct wined3d_device_context *context,
|
||||
+ size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
+{
|
||||
+ struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+ struct wined3d_cs_packet *packet;
|
||||
+ size_t header_size, packet_size;
|
||||
+
|
||||
+ assert(queue_id == WINED3D_CS_QUEUE_DEFAULT);
|
||||
+
|
||||
+ header_size = offsetof(struct wined3d_cs_packet, data[0]);
|
||||
+ packet_size = offsetof(struct wined3d_cs_packet, data[size]);
|
||||
+ packet_size = (packet_size + header_size - 1) & ~(header_size - 1);
|
||||
+
|
||||
+ if (!wined3d_array_reserve(&deferred->data, &deferred->data_capacity, deferred->data_size + packet_size, 1))
|
||||
+ return NULL;
|
||||
+
|
||||
+ packet = (struct wined3d_cs_packet *)((BYTE *)deferred->data + deferred->data_size);
|
||||
+ TRACE("size was %zu, adding %zu\n", (size_t)deferred->data_size, packet_size);
|
||||
+ deferred->data_size += packet_size;
|
||||
+ packet->size = packet_size - header_size;
|
||||
+ return &packet->data;
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_submit(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id)
|
||||
+{
|
||||
+ assert(queue_id == WINED3D_CS_QUEUE_DEFAULT);
|
||||
+
|
||||
+ /* Nothing to do. */
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_finish(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id)
|
||||
+{
|
||||
+ /* This should not happen; we cannot meaningfully finish a deferred context. */
|
||||
+ ERR("Ignoring finish() on a deferred context.\n");
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_push_constants(struct wined3d_device_context *context,
|
||||
+ enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants)
|
||||
+{
|
||||
+ FIXME("context %p, p %#x, start_idx %u, count %u, constants %p, stub!\n", context, p, start_idx, count, constants);
|
||||
+}
|
||||
+
|
||||
+static HRESULT wined3d_deferred_context_map(struct wined3d_device_context *context,
|
||||
+ struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags)
|
||||
+{
|
||||
+ FIXME("context %p, resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x, stub!\n",
|
||||
+ context, resource, sub_resource_idx, map_desc, box, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT wined3d_deferred_context_unmap(struct wined3d_device_context *context,
|
||||
+ struct wined3d_resource *resource, unsigned int sub_resource_idx)
|
||||
+{
|
||||
+ FIXME("context %p, resource %p, sub_resource_idx %u, stub!\n",
|
||||
+ context, resource, sub_resource_idx);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_update_sub_resource(struct wined3d_device_context *context,
|
||||
+ struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box,
|
||||
+ const void *data, unsigned int row_pitch, unsigned int slice_pitch)
|
||||
+{
|
||||
+ FIXME("context %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, slice_pitch %u, stub!\n",
|
||||
+ context, resource, sub_resource_idx, box, data, row_pitch, slice_pitch);
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_issue_query(struct wined3d_device_context *context,
|
||||
+ struct wined3d_query *query, unsigned int flags)
|
||||
+{
|
||||
+ FIXME("context %p, query %p, flags %#x, stub!\n", context, query, flags);
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_flush(struct wined3d_device_context *context)
|
||||
+{
|
||||
+ FIXME("context %p, stub!\n", context);
|
||||
+}
|
||||
+
|
||||
+static void wined3d_deferred_context_acquire_resource(struct wined3d_device_context *context,
|
||||
+ struct wined3d_resource *resource)
|
||||
+{
|
||||
+ FIXME("context %p, resource %p, stub!\n", context, resource);
|
||||
+}
|
||||
+
|
||||
+static const struct wined3d_device_context_ops wined3d_deferred_context_ops =
|
||||
+{
|
||||
+ wined3d_deferred_context_require_space,
|
||||
+ wined3d_deferred_context_submit,
|
||||
+ wined3d_deferred_context_finish,
|
||||
+ wined3d_deferred_context_push_constants,
|
||||
+ wined3d_deferred_context_map,
|
||||
+ wined3d_deferred_context_unmap,
|
||||
+ wined3d_deferred_context_update_sub_resource,
|
||||
+ wined3d_deferred_context_issue_query,
|
||||
+ wined3d_deferred_context_flush,
|
||||
+ wined3d_deferred_context_acquire_resource,
|
||||
+};
|
||||
+
|
||||
+HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, struct wined3d_device_context **context)
|
||||
+{
|
||||
+ struct wined3d_deferred_context *object;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("device %p, context %p.\n", device, context);
|
||||
+
|
||||
+ if (!(object = heap_alloc_zero(sizeof(*object))))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ if (FAILED(hr = wined3d_state_create(device, &device->cs->c.state->feature_level, 1, &object->c.state)))
|
||||
+ {
|
||||
+ heap_free(object);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ object->c.ops = &wined3d_deferred_context_ops;
|
||||
+ object->c.device = device;
|
||||
+
|
||||
+ TRACE("Created deferred context %p.\n", context);
|
||||
+ *context = &object->c;
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *context)
|
||||
+{
|
||||
+ struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+
|
||||
+ TRACE("context %p.\n", context);
|
||||
+
|
||||
+ wined3d_state_destroy(deferred->c.state);
|
||||
+ heap_free(deferred->data);
|
||||
+ heap_free(deferred);
|
||||
+}
|
||||
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
|
||||
index 9f3dfed7ef8..901e9bee621 100644
|
||||
--- a/dlls/wined3d/wined3d.spec
|
||||
+++ b/dlls/wined3d/wined3d.spec
|
||||
@@ -33,6 +33,9 @@
|
||||
@ cdecl wined3d_buffer_get_resource(ptr)
|
||||
@ cdecl wined3d_buffer_incref(ptr)
|
||||
|
||||
+@ cdecl wined3d_deferred_context_create(ptr ptr)
|
||||
+@ cdecl wined3d_deferred_context_destroy(ptr)
|
||||
+
|
||||
@ cdecl wined3d_depth_stencil_state_create(ptr ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_depth_stencil_state_decref(ptr)
|
||||
@ cdecl wined3d_depth_stencil_state_get_parent(ptr)
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 2ee18bcaaed..0be192b0f01 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -2340,6 +2340,9 @@ void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer);
|
||||
struct wined3d_resource * __cdecl wined3d_buffer_get_resource(struct wined3d_buffer *buffer);
|
||||
ULONG __cdecl wined3d_buffer_incref(struct wined3d_buffer *buffer);
|
||||
|
||||
+HRESULT __cdecl wined3d_deferred_context_create(struct wined3d_device *device, struct wined3d_device_context **context);
|
||||
+void __cdecl wined3d_deferred_context_destroy(struct wined3d_device_context *context);
|
||||
+
|
||||
HRESULT __cdecl wined3d_depth_stencil_state_create(struct wined3d_device *device,
|
||||
const struct wined3d_depth_stencil_state_desc *desc, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_depth_stencil_state **state);
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,76 +0,0 @@
|
||||
From 23c6f443659535cf63c4bf3a9411ad6ba7724881 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Thu, 6 May 2021 20:53:51 -0500
|
||||
Subject: [PATCH] d3d11: Implement ID3D11Device1::CreateDeferredContext1().
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41636
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/device.c | 12 ++++++++++--
|
||||
dlls/d3d11/tests/d3d11.c | 5 +----
|
||||
dlls/wined3d/cs.c | 2 +-
|
||||
3 files changed, 12 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 459c49145cd..39144df3dc4 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -4077,9 +4077,17 @@ static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *i
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device2 *iface, UINT flags,
|
||||
ID3D11DeviceContext1 **context)
|
||||
{
|
||||
- FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context);
|
||||
+ struct d3d_device *device = impl_from_ID3D11Device2(iface);
|
||||
+ struct d3d11_device_context *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, flags %#x, context %p.\n", iface, flags, context);
|
||||
+
|
||||
+ if (FAILED(hr = d3d11_deferred_context_create(device, flags, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *context = &object->ID3D11DeviceContext1_iface;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device2 *iface,
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 43ea70d2e9b..e56cb7594c6 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -32410,9 +32410,7 @@ static void test_deferred_context_swap_state(void)
|
||||
ID3D11DeviceContext1_PSSetConstantBuffers(immediate, 0, 1, &green_buffer);
|
||||
|
||||
hr = ID3D11Device1_CreateDeferredContext1(device, 0, &deferred);
|
||||
- todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
- if (hr != S_OK)
|
||||
- goto out;
|
||||
+ ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
|
||||
|
||||
feature_level = ID3D11Device1_GetFeatureLevel(device);
|
||||
hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION,
|
||||
@@ -32433,7 +32431,6 @@ static void test_deferred_context_swap_state(void)
|
||||
ID3DDeviceContextState_Release(state);
|
||||
ID3D11DeviceContext1_Release(deferred);
|
||||
|
||||
-out:
|
||||
ID3D11Buffer_Release(green_buffer);
|
||||
ID3D11DeviceContext1_Release(immediate);
|
||||
ID3D11Device1_Release(device);
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 9a143b915ed..e903b94378e 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -3293,7 +3293,7 @@ HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, str
|
||||
object->c.ops = &wined3d_deferred_context_ops;
|
||||
object->c.device = device;
|
||||
|
||||
- TRACE("Created deferred context %p.\n", context);
|
||||
+ TRACE("Created deferred context %p.\n", object);
|
||||
*context = &object->c;
|
||||
|
||||
return S_OK;
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,59 +0,0 @@
|
||||
From 5f4be09c3c2a3098155c769cdda40f1cfb29640d Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Mon, 10 May 2021 12:13:12 -0500
|
||||
Subject: [PATCH] wined3d: Keep a list of acquired resources in struct
|
||||
wined3d_deferred_context.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/wined3d/cs.c | 17 ++++++++++++++++-
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index e903b94378e..e1ffd8f0ff8 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -3169,6 +3169,9 @@ struct wined3d_deferred_context
|
||||
|
||||
SIZE_T data_size, data_capacity;
|
||||
void *data;
|
||||
+
|
||||
+ SIZE_T resource_count, resources_capacity;
|
||||
+ struct wined3d_resource **resources;
|
||||
};
|
||||
|
||||
static struct wined3d_deferred_context *wined3d_deferred_context_from_context(struct wined3d_device_context *context)
|
||||
@@ -3257,7 +3260,14 @@ static void wined3d_deferred_context_flush(struct wined3d_device_context *contex
|
||||
static void wined3d_deferred_context_acquire_resource(struct wined3d_device_context *context,
|
||||
struct wined3d_resource *resource)
|
||||
{
|
||||
- FIXME("context %p, resource %p, stub!\n", context, resource);
|
||||
+ struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+
|
||||
+ if (!wined3d_array_reserve((void **)&deferred->resources, &deferred->resources_capacity,
|
||||
+ deferred->resource_count + 1, sizeof(*deferred->resources)))
|
||||
+ return;
|
||||
+
|
||||
+ deferred->resources[deferred->resource_count++] = resource;
|
||||
+ wined3d_resource_incref(resource);
|
||||
}
|
||||
|
||||
static const struct wined3d_device_context_ops wined3d_deferred_context_ops =
|
||||
@@ -3302,9 +3312,14 @@ HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, str
|
||||
void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *context)
|
||||
{
|
||||
struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+ SIZE_T i;
|
||||
|
||||
TRACE("context %p.\n", context);
|
||||
|
||||
+ for (i = 0; i < deferred->resource_count; ++i)
|
||||
+ wined3d_resource_decref(deferred->resources[i]);
|
||||
+ heap_free(deferred->resources);
|
||||
+
|
||||
wined3d_state_destroy(deferred->c.state);
|
||||
heap_free(deferred->data);
|
||||
heap_free(deferred);
|
||||
--
|
||||
2.30.2
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user