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
68 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5f19a81589 | ||
|
1033d3990b | ||
|
a896148be0 | ||
|
ef11bb63ce | ||
|
f3b03ce5a1 | ||
|
4b48df5032 | ||
|
24319dc308 | ||
|
931daeffec | ||
|
d923cf9418 | ||
|
66c0fdc159 | ||
|
6f3825b11f | ||
|
8d34769ef1 | ||
|
5a5c5a5743 | ||
|
5c01355ada | ||
|
270f893aea | ||
|
dc0aa10ad7 | ||
|
d7b8304e38 | ||
|
b09fe464be | ||
|
4b6879f30f | ||
|
94337e021c | ||
|
05c42b1df2 | ||
|
1bc4da9d59 | ||
|
16476ce303 | ||
|
bdb9f49c3e | ||
|
82118b0d67 | ||
|
00985bf311 | ||
|
3c8c7910e7 | ||
|
069adfd1b0 | ||
|
c91c63a5da | ||
|
f7c80250ec | ||
|
b059114710 | ||
|
f27610e7e7 | ||
|
9da0fe04d3 | ||
|
dc38777093 | ||
|
b57bf86ec0 | ||
|
4e99d1b2a8 | ||
|
8ad669e434 | ||
|
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 |
@@ -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
|
||||
|
@@ -1,15 +1,15 @@
|
||||
From e51b05c3a9d03e4dd84a107a30841d95f8a519c3 Mon Sep 17 00:00:00 2001
|
||||
From 916189d1cdf149f16867870121171e20f129da9f Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 2 Oct 2014 19:44:31 +0200
|
||||
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
|
||||
branch name and version.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
dlls/ntdll/loader.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index ee453700e51..c2d4b3c2f86 100644
|
||||
index 3339596944a..1d435f88755 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
|
||||
@@ -20,7 +20,7 @@ index ee453700e51..c2d4b3c2f86 100644
|
||||
|
||||
#ifdef _WIN64
|
||||
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
|
||||
@@ -3307,6 +3308,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
@@ -3373,6 +3374,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
process_detach();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ index ee453700e51..c2d4b3c2f86 100644
|
||||
|
||||
/******************************************************************
|
||||
* RtlExitUserProcess (NTDLL.@)
|
||||
@@ -3673,6 +3675,9 @@ static void init_wow64(void)
|
||||
@@ -3783,6 +3785,9 @@ static void init_wow64( CONTEXT *context )
|
||||
*/
|
||||
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR unknown3, ULONG_PTR unknown4 )
|
||||
{
|
||||
@@ -38,9 +38,9 @@ index ee453700e51..c2d4b3c2f86 100644
|
||||
static int attach_done;
|
||||
int i;
|
||||
NTSTATUS status;
|
||||
@@ -3753,6 +3758,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
|
||||
}
|
||||
else wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
|
||||
@@ -3869,6 +3874,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
|
||||
if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
|
||||
#endif
|
||||
|
||||
+ RtlInitUnicodeString( &staging_event_string, L"\\__wine_staging_warn_event" );
|
||||
+ InitializeObjectAttributes( &staging_event_attr, &staging_event_string, OBJ_OPENIF, NULL, NULL );
|
||||
@@ -51,7 +51,6 @@ index ee453700e51..c2d4b3c2f86 100644
|
||||
+ }
|
||||
+ else
|
||||
+ WARN_(winediag)("wine-staging %s is a testing version containing experimental patches.\n", wine_get_version());
|
||||
+
|
||||
+
|
||||
RtlAcquirePebLock();
|
||||
InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks );
|
||||
|
@@ -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,92 +0,0 @@
|
||||
From f0cfa1dc94330d07589e09ae5961956364adac4d Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 14 May 2021 15:51:55 -0500
|
||||
Subject: [PATCH] wined3d: Implement
|
||||
wined3d_deferred_context_update_sub_resource().
|
||||
|
||||
Needed by Wolcen: Lords of Mayhem.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/wined3d/cs.c | 37 +++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 33 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 50a08334dab..e6f84134795 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -490,6 +490,7 @@ struct wined3d_cs_update_sub_resource
|
||||
unsigned int sub_resource_idx;
|
||||
struct wined3d_box box;
|
||||
struct wined3d_sub_resource_data data;
|
||||
+ /* If data.data is NULL, the structure is followed by the data in memory. */
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2597,6 +2598,7 @@ void wined3d_device_context_emit_blt_sub_resource(struct wined3d_device_context
|
||||
static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_update_sub_resource *op = data;
|
||||
+ const void *src_data = op->data.data ? op->data.data : (const BYTE *)(op + 1);
|
||||
struct wined3d_resource *resource = op->resource;
|
||||
const struct wined3d_box *box = &op->box;
|
||||
unsigned int width, height, depth, level;
|
||||
@@ -2617,7 +2619,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
|
||||
goto done;
|
||||
}
|
||||
|
||||
- wined3d_buffer_upload_data(buffer, context, box, op->data.data);
|
||||
+ wined3d_buffer_upload_data(buffer, context, box, src_data);
|
||||
wined3d_buffer_invalidate_location(buffer, ~WINED3D_LOCATION_BUFFER);
|
||||
goto done;
|
||||
}
|
||||
@@ -2630,7 +2632,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
|
||||
depth = wined3d_texture_get_level_depth(texture, level);
|
||||
|
||||
addr.buffer_object = 0;
|
||||
- addr.addr = op->data.data;
|
||||
+ addr.addr = src_data;
|
||||
|
||||
/* Only load the sub-resource for partial updates. */
|
||||
if (!box->left && !box->top && !box->front
|
||||
@@ -3375,8 +3377,35 @@ static void wined3d_deferred_context_update_sub_resource(struct wined3d_device_c
|
||||
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 %s, data %p, row_pitch %u, slice_pitch %u, stub!\n",
|
||||
- context, resource, sub_resource_idx, debug_box(box), data, row_pitch, slice_pitch);
|
||||
+ struct wined3d_cs_update_sub_resource *op;
|
||||
+ size_t data_size;
|
||||
+
|
||||
+ if (resource->type == WINED3D_RTYPE_BUFFER)
|
||||
+ {
|
||||
+ data_size = box->right - box->left;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const struct wined3d_format *format = resource->format;
|
||||
+
|
||||
+ data_size = (box->back - box->front - 1) * slice_pitch
|
||||
+ + ((box->bottom - box->top - 1) / format->block_height) * row_pitch
|
||||
+ + ((box->right - box->left + format->block_width - 1) / format->block_width) * format->block_byte_count;
|
||||
+ }
|
||||
+
|
||||
+ op = wined3d_device_context_require_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT);
|
||||
+ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
+ op->resource = resource;
|
||||
+ op->sub_resource_idx = sub_resource_idx;
|
||||
+ op->box = *box;
|
||||
+ op->data.row_pitch = row_pitch;
|
||||
+ op->data.slice_pitch = slice_pitch;
|
||||
+ op->data.data = NULL;
|
||||
+ memcpy(op + 1, data, data_size);
|
||||
+
|
||||
+ wined3d_device_context_acquire_resource(context, resource);
|
||||
+
|
||||
+ wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
|
||||
}
|
||||
|
||||
static void wined3d_deferred_context_issue_query(struct wined3d_device_context *context,
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,461 +0,0 @@
|
||||
From cff68ab6407f62fa76e00d28532f741aa6498ad1 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 19 May 2021 19:00:56 -0500
|
||||
Subject: [PATCH] wined3d: Implement wined3d_deferred_context_map().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 15 +---
|
||||
dlls/wined3d/buffer.c | 14 ++++
|
||||
dlls/wined3d/cs.c | 136 ++++++++++++++++++++++++++++++---
|
||||
dlls/wined3d/resource.c | 29 +++----
|
||||
dlls/wined3d/texture.c | 25 ++++++
|
||||
dlls/wined3d/wined3d_private.h | 5 ++
|
||||
6 files changed, 189 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 408c0492cd2..a2fdc116e61 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -32735,21 +32735,14 @@ 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);
|
||||
- todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+ 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);
|
||||
- todo_wine ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr);
|
||||
+ 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);
|
||||
- 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;
|
||||
- }
|
||||
+ 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. */
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 12d038c0120..12b90cb54c2 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -826,6 +826,19 @@ struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffe
|
||||
return &buffer->resource;
|
||||
}
|
||||
|
||||
+static HRESULT buffer_resource_sub_resource_get_size(struct wined3d_resource *resource,
|
||||
+ unsigned int sub_resource_idx, unsigned int *size, unsigned int *row_pitch, unsigned int *slice_pitch)
|
||||
+{
|
||||
+ if (sub_resource_idx)
|
||||
+ {
|
||||
+ WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
|
||||
+ return E_INVALIDARG;
|
||||
+ }
|
||||
+
|
||||
+ *size = *row_pitch = *slice_pitch = resource->size;
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags)
|
||||
{
|
||||
@@ -1084,6 +1097,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
|
||||
buffer_resource_decref,
|
||||
buffer_resource_preload,
|
||||
buffer_resource_unload,
|
||||
+ buffer_resource_sub_resource_get_size,
|
||||
buffer_resource_sub_resource_map,
|
||||
buffer_resource_sub_resource_unmap,
|
||||
};
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index e6f84134795..1f7213232fa 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -26,6 +26,13 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||
|
||||
#define WINED3D_INITIAL_CS_SIZE 4096
|
||||
|
||||
+struct wined3d_acquired_resource
|
||||
+{
|
||||
+ struct wined3d_resource *resource;
|
||||
+ unsigned int sub_resource_idx;
|
||||
+ void *sysmem;
|
||||
+};
|
||||
+
|
||||
struct wined3d_command_list
|
||||
{
|
||||
LONG refcount;
|
||||
@@ -36,7 +43,7 @@ struct wined3d_command_list
|
||||
void *data;
|
||||
|
||||
SIZE_T resource_count;
|
||||
- struct wined3d_resource **resources;
|
||||
+ struct wined3d_acquired_resource *resources;
|
||||
|
||||
/* List of command lists queued for execution on this command list. We might
|
||||
* be the only thing holding a pointer to another command list, so we need
|
||||
@@ -48,9 +55,13 @@ struct wined3d_command_list
|
||||
static void wined3d_command_list_destroy_object(void *object)
|
||||
{
|
||||
struct wined3d_command_list *list = object;
|
||||
+ SIZE_T i;
|
||||
|
||||
TRACE("list %p.\n", list);
|
||||
|
||||
+ for (i = 0; i < list->resource_count; ++i)
|
||||
+ wined3d_free_sysmem(list->resources[i].sysmem);
|
||||
+
|
||||
heap_free(list->resources);
|
||||
heap_free(list->data);
|
||||
heap_free(list);
|
||||
@@ -79,7 +90,7 @@ ULONG CDECL wined3d_command_list_decref(struct wined3d_command_list *list)
|
||||
for (i = 0; i < list->command_list_count; ++i)
|
||||
wined3d_command_list_decref(list->command_lists[i]);
|
||||
for (i = 0; i < list->resource_count; ++i)
|
||||
- wined3d_resource_decref(list->resources[i]);
|
||||
+ wined3d_resource_decref(list->resources[i].resource);
|
||||
|
||||
wined3d_cs_destroy_object(device->cs, wined3d_command_list_destroy_object, list);
|
||||
}
|
||||
@@ -139,6 +150,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_COPY_UAV_COUNTER,
|
||||
WINED3D_CS_OP_GENERATE_MIPMAPS,
|
||||
WINED3D_CS_OP_EXECUTE_COMMAND_LIST,
|
||||
+ WINED3D_CS_OP_UPLOAD_SUB_RESOURCE,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -469,6 +481,15 @@ struct wined3d_cs_unmap
|
||||
HRESULT *hr;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_upload_sub_resource
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ struct wined3d_resource *resource;
|
||||
+ unsigned int sub_resource_idx;
|
||||
+ unsigned int size;
|
||||
+ const void *data;
|
||||
+};
|
||||
+
|
||||
struct wined3d_cs_blt_sub_resource
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
@@ -616,6 +637,7 @@ static const char *debug_cs_op(enum wined3d_cs_op op)
|
||||
WINED3D_TO_STR(WINED3D_CS_OP_COPY_UAV_COUNTER);
|
||||
WINED3D_TO_STR(WINED3D_CS_OP_GENERATE_MIPMAPS);
|
||||
WINED3D_TO_STR(WINED3D_CS_OP_EXECUTE_COMMAND_LIST);
|
||||
+ WINED3D_TO_STR(WINED3D_CS_OP_UPLOAD_SUB_RESOURCE);
|
||||
WINED3D_TO_STR(WINED3D_CS_OP_STOP);
|
||||
#undef WINED3D_TO_STR
|
||||
}
|
||||
@@ -2342,7 +2364,7 @@ static void wined3d_cs_execute_command_list(struct wined3d_device_context *conte
|
||||
op->list = list;
|
||||
|
||||
for (i = 0; i < list->resource_count; ++i)
|
||||
- wined3d_resource_acquire(list->resources[i]);
|
||||
+ wined3d_resource_acquire(list->resources[i].resource);
|
||||
|
||||
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
|
||||
|
||||
@@ -2463,6 +2485,28 @@ static HRESULT wined3d_cs_unmap(struct wined3d_device_context *context, struct w
|
||||
return hr;
|
||||
}
|
||||
|
||||
+static void wined3d_cs_exec_upload_sub_resource(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_upload_sub_resource *op = data;
|
||||
+ struct wined3d_resource *resource = op->resource;
|
||||
+ unsigned int sub_resource_idx = op->sub_resource_idx;
|
||||
+ struct wined3d_map_desc map_desc;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (FAILED(hr = resource->resource_ops->resource_sub_resource_map(resource,
|
||||
+ sub_resource_idx, &map_desc, NULL, WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD)))
|
||||
+ {
|
||||
+ ERR("Failed to map resource, hr %#x.\n", hr);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(map_desc.data, op->data, op->size);
|
||||
+
|
||||
+ resource->resource_ops->resource_sub_resource_unmap(resource, sub_resource_idx);
|
||||
+
|
||||
+ wined3d_resource_release(resource);
|
||||
+}
|
||||
+
|
||||
static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_blt_sub_resource *op = data;
|
||||
@@ -2870,6 +2914,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_COPY_UAV_COUNTER */ wined3d_cs_exec_copy_uav_counter,
|
||||
/* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps,
|
||||
/* WINED3D_CS_OP_EXECUTE_COMMAND_LIST */ wined3d_cs_exec_execute_command_list,
|
||||
+ /* WINED3D_CS_OP_UPLOAD_SUB_RESOURCE */ wined3d_cs_exec_upload_sub_resource,
|
||||
};
|
||||
|
||||
static void wined3d_cs_exec_execute_command_list(struct wined3d_cs *cs, const void *data)
|
||||
@@ -3301,7 +3346,7 @@ struct wined3d_deferred_context
|
||||
void *data;
|
||||
|
||||
SIZE_T resource_count, resources_capacity;
|
||||
- struct wined3d_resource **resources;
|
||||
+ struct wined3d_acquired_resource *resources;
|
||||
|
||||
/* List of command lists queued for execution on this context. A command
|
||||
* list can be the only thing holding a pointer to another command list, so
|
||||
@@ -3361,16 +3406,78 @@ static HRESULT wined3d_deferred_context_map(struct wined3d_device_context *conte
|
||||
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;
|
||||
+ struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+ struct wined3d_acquired_resource *acquired_resource;
|
||||
+ unsigned int size;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (box)
|
||||
+ {
|
||||
+ ERR("Unexpected box.\n");
|
||||
+ return E_INVALIDARG;
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr = resource->resource_ops->resource_sub_resource_get_size(resource,
|
||||
+ sub_resource_idx, &size, &map_desc->row_pitch, &map_desc->slice_pitch)))
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ if (flags & WINED3D_MAP_DISCARD)
|
||||
+ {
|
||||
+ struct wined3d_cs_upload_sub_resource *op;
|
||||
+ void *sysmem;
|
||||
+
|
||||
+ if (!(sysmem = wined3d_allocate_sysmem(size)))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ if (!wined3d_array_reserve((void **)&deferred->resources, &deferred->resources_capacity,
|
||||
+ deferred->resource_count + 1, sizeof(*deferred->resources)))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ acquired_resource = &deferred->resources[deferred->resource_count++];
|
||||
+ acquired_resource->resource = resource;
|
||||
+ wined3d_resource_incref(resource);
|
||||
+ acquired_resource->sub_resource_idx = sub_resource_idx;
|
||||
+ acquired_resource->sysmem = sysmem;
|
||||
+
|
||||
+ op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
|
||||
+ op->opcode = WINED3D_CS_OP_UPLOAD_SUB_RESOURCE;
|
||||
+ op->resource = resource;
|
||||
+ op->sub_resource_idx = sub_resource_idx;
|
||||
+ op->size = size;
|
||||
+ op->data = sysmem;
|
||||
+
|
||||
+ map_desc->data = sysmem;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ else if (flags & WINED3D_MAP_NOOVERWRITE)
|
||||
+ {
|
||||
+ int i = deferred->resource_count;
|
||||
+
|
||||
+ while (i--)
|
||||
+ {
|
||||
+ acquired_resource = &deferred->resources[i];
|
||||
+
|
||||
+ if (acquired_resource->resource == resource
|
||||
+ && acquired_resource->sub_resource_idx == sub_resource_idx && acquired_resource->sysmem)
|
||||
+ {
|
||||
+ map_desc->data = acquired_resource->sysmem;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WARN("Invalid flags %#x, returning E_INVALIDARG.\n", flags);
|
||||
+ return E_INVALIDARG;
|
||||
+ }
|
||||
}
|
||||
|
||||
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;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static void wined3d_deferred_context_update_sub_resource(struct wined3d_device_context *context,
|
||||
@@ -3423,13 +3530,17 @@ static void wined3d_deferred_context_acquire_resource(struct wined3d_device_cont
|
||||
struct wined3d_resource *resource)
|
||||
{
|
||||
struct wined3d_deferred_context *deferred = wined3d_deferred_context_from_context(context);
|
||||
+ struct wined3d_acquired_resource *acquired_resource;
|
||||
|
||||
if (!wined3d_array_reserve((void **)&deferred->resources, &deferred->resources_capacity,
|
||||
deferred->resource_count + 1, sizeof(*deferred->resources)))
|
||||
return;
|
||||
|
||||
- deferred->resources[deferred->resource_count++] = resource;
|
||||
+ acquired_resource = &deferred->resources[deferred->resource_count++];
|
||||
+ acquired_resource->resource = resource;
|
||||
wined3d_resource_incref(resource);
|
||||
+ acquired_resource->sub_resource_idx = 0;
|
||||
+ acquired_resource->sysmem = NULL;
|
||||
}
|
||||
|
||||
static void wined3d_deferred_context_execute_command_list(struct wined3d_device_context *context,
|
||||
@@ -3504,7 +3615,10 @@ void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *conte
|
||||
TRACE("context %p.\n", context);
|
||||
|
||||
for (i = 0; i < deferred->resource_count; ++i)
|
||||
- wined3d_resource_decref(deferred->resources[i]);
|
||||
+ {
|
||||
+ wined3d_resource_decref(deferred->resources[i].resource);
|
||||
+ wined3d_free_sysmem(deferred->resources[i].sysmem);
|
||||
+ }
|
||||
heap_free(deferred->resources);
|
||||
|
||||
wined3d_state_destroy(deferred->c.state);
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 58e3e5c77fd..42e45a2745c 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -334,24 +334,32 @@ void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
|
||||
wined3d_cs_emit_preload_resource(resource->device->cs, resource);
|
||||
}
|
||||
|
||||
-static BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
|
||||
+void *wined3d_allocate_sysmem(SIZE_T size)
|
||||
{
|
||||
void **p;
|
||||
- SIZE_T align = RESOURCE_ALIGNMENT - 1 + sizeof(*p);
|
||||
+ static const SIZE_T align = RESOURCE_ALIGNMENT - 1 + sizeof(*p);
|
||||
void *mem;
|
||||
|
||||
- if (!(mem = heap_alloc_zero(resource->size + align)))
|
||||
+ if (!(mem = heap_alloc_zero(size + align)))
|
||||
{
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
- return FALSE;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1;
|
||||
*p = mem;
|
||||
|
||||
- resource->heap_memory = ++p;
|
||||
+ return ++p;
|
||||
+}
|
||||
|
||||
- return TRUE;
|
||||
+void wined3d_free_sysmem(void *mem)
|
||||
+{
|
||||
+ void **p = mem;
|
||||
+
|
||||
+ if (!p)
|
||||
+ return;
|
||||
+
|
||||
+ heap_free(*(--p));
|
||||
}
|
||||
|
||||
BOOL wined3d_resource_prepare_sysmem(struct wined3d_resource *resource)
|
||||
@@ -359,17 +367,12 @@ BOOL wined3d_resource_prepare_sysmem(struct wined3d_resource *resource)
|
||||
if (resource->heap_memory)
|
||||
return TRUE;
|
||||
|
||||
- return wined3d_resource_allocate_sysmem(resource);
|
||||
+ return !!(resource->heap_memory = wined3d_allocate_sysmem(resource->size));
|
||||
}
|
||||
|
||||
void wined3d_resource_free_sysmem(struct wined3d_resource *resource)
|
||||
{
|
||||
- void **p = resource->heap_memory;
|
||||
-
|
||||
- if (!p)
|
||||
- return;
|
||||
-
|
||||
- heap_free(*(--p));
|
||||
+ wined3d_free_sysmem(resource->heap_memory);
|
||||
resource->heap_memory = NULL;
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c7a9b4da3e1..663503bdf39 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -3506,6 +3506,30 @@ static void texture_resource_unload(struct wined3d_resource *resource)
|
||||
resource_unload(&texture->resource);
|
||||
}
|
||||
|
||||
+static HRESULT texture_resource_sub_resource_get_size(struct wined3d_resource *resource,
|
||||
+ unsigned int sub_resource_idx, unsigned int *size, unsigned int *row_pitch, unsigned int *slice_pitch)
|
||||
+{
|
||||
+ struct wined3d_texture *texture = texture_from_resource(resource);
|
||||
+ unsigned int texture_level = sub_resource_idx % texture->level_count;
|
||||
+ struct wined3d_texture_sub_resource *sub_resource;
|
||||
+
|
||||
+ if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)))
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ if (resource->format_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
|
||||
+ {
|
||||
+ *row_pitch = wined3d_texture_get_level_width(texture, texture_level) * resource->format->byte_count;
|
||||
+ *slice_pitch = wined3d_texture_get_level_height(texture, texture_level) * (*row_pitch);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ wined3d_texture_get_pitch(texture, texture_level, row_pitch, slice_pitch);
|
||||
+ }
|
||||
+
|
||||
+ *size = sub_resource->size;
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
|
||||
{
|
||||
@@ -3692,6 +3716,7 @@ static const struct wined3d_resource_ops texture_resource_ops =
|
||||
texture_resource_decref,
|
||||
texture_resource_preload,
|
||||
texture_resource_unload,
|
||||
+ texture_resource_sub_resource_get_size,
|
||||
texture_resource_sub_resource_map,
|
||||
texture_resource_sub_resource_unmap,
|
||||
};
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 8e3efccffc2..db6e1619e8f 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -4048,6 +4048,8 @@ struct wined3d_resource_ops
|
||||
ULONG (*resource_decref)(struct wined3d_resource *resource);
|
||||
void (*resource_preload)(struct wined3d_resource *resource);
|
||||
void (*resource_unload)(struct wined3d_resource *resource);
|
||||
+ HRESULT (*resource_sub_resource_get_size)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
+ unsigned int *size, unsigned int *row_pitch, unsigned int *slice_pitch);
|
||||
HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
|
||||
HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx);
|
||||
@@ -4131,6 +4133,9 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DEC
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
#define WINED3D_CONSTANT_BUFFER_ALIGNMENT 16
|
||||
|
||||
+void *wined3d_allocate_sysmem(SIZE_T size) DECLSPEC_HIDDEN;
|
||||
+void wined3d_free_sysmem(void *mem) DECLSPEC_HIDDEN;
|
||||
+
|
||||
#define WINED3D_LOCATION_DISCARDED 0x00000001
|
||||
#define WINED3D_LOCATION_SYSMEM 0x00000002
|
||||
#define WINED3D_LOCATION_BUFFER 0x00000008
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1,3 +0,0 @@
|
||||
Fixes: [42191] Multiple games require d3d11 deferred contexts (Diablo 3, Dark Souls 3, The Evil Within, Elex, Alien: Isolation, Assassin's Creed III)
|
||||
Fixes: [43743] No 3D graphics in Wolcen: Lords of Mayhem
|
||||
Fixes: [41636] Multiple DirectX 11 games need ID3D11Device1::CreateDeferredContext1 implementation (WWE 2K15, Dishonored: Death of the Outsider, Pro Evolution Soccer 2019, Shantae and the Pirate's Curse, Space Engineers)
|
@@ -0,0 +1,254 @@
|
||||
From 95708c8fdfcb45cfe667cc9a68ea774c2be52169 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 30 Jul 2021 15:57:29 +1000
|
||||
Subject: [PATCH] d3dx11_43: Implement D3DX11GetImageInfoFromMemory
|
||||
|
||||
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=50210
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx11_42/Makefile.in | 1 +
|
||||
dlls/d3dx11_43/Makefile.in | 1 +
|
||||
dlls/d3dx11_43/main.c | 9 --
|
||||
dlls/d3dx11_43/texture.c | 176 +++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 178 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in
|
||||
index c34f53a930c..9e1379937a7 100644
|
||||
--- a/dlls/d3dx11_42/Makefile.in
|
||||
+++ b/dlls/d3dx11_42/Makefile.in
|
||||
@@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=42
|
||||
MODULE = d3dx11_42.dll
|
||||
IMPORTLIB = d3dx11_42
|
||||
IMPORTS = d3dcompiler
|
||||
+DELAYIMPORTS = windowscodecs
|
||||
PARENTSRC = ../d3dx11_43
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
|
||||
diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in
|
||||
index b69f3f1ce02..ed23958a671 100644
|
||||
--- a/dlls/d3dx11_43/Makefile.in
|
||||
+++ b/dlls/d3dx11_43/Makefile.in
|
||||
@@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=43
|
||||
MODULE = d3dx11_43.dll
|
||||
IMPORTLIB = d3dx11
|
||||
IMPORTS = d3dcompiler
|
||||
+DELAYIMPORTS = windowscodecs
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
|
||||
|
||||
diff --git a/dlls/d3dx11_43/main.c b/dlls/d3dx11_43/main.c
|
||||
index 950f6d76f5c..00c1db35e42 100644
|
||||
--- a/dlls/d3dx11_43/main.c
|
||||
+++ b/dlls/d3dx11_43/main.c
|
||||
@@ -66,12 +66,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadP
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
-
|
||||
-HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
|
||||
- D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
|
||||
-{
|
||||
- FIXME("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p stub!\n",
|
||||
- src_data, src_data_size, pump, img_info, hresult);
|
||||
-
|
||||
- return E_NOTIMPL;
|
||||
-}
|
||||
diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c
|
||||
index ee6808d76d6..8addf4f84d3 100644
|
||||
--- a/dlls/d3dx11_43/texture.c
|
||||
+++ b/dlls/d3dx11_43/texture.c
|
||||
@@ -15,14 +15,190 @@
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
+#define COBJMACROS
|
||||
|
||||
#include "d3dx11.h"
|
||||
#include "d3dcompiler.h"
|
||||
+#include "wincodec.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
|
||||
|
||||
+HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory);
|
||||
+
|
||||
+static const struct
|
||||
+{
|
||||
+ const GUID *wic_container_guid;
|
||||
+ D3DX11_IMAGE_FILE_FORMAT d3dx_file_format;
|
||||
+}
|
||||
+file_formats[] =
|
||||
+{
|
||||
+ { &GUID_ContainerFormatBmp, D3DX11_IFF_BMP },
|
||||
+ { &GUID_ContainerFormatJpeg, D3DX11_IFF_JPG },
|
||||
+ { &GUID_ContainerFormatPng, D3DX11_IFF_PNG },
|
||||
+ { &GUID_ContainerFormatDds, D3DX11_IFF_DDS },
|
||||
+ { &GUID_ContainerFormatTiff, D3DX11_IFF_TIFF },
|
||||
+ { &GUID_ContainerFormatGif, D3DX11_IFF_GIF },
|
||||
+ { &GUID_ContainerFormatWmp, D3DX11_IFF_WMP },
|
||||
+};
|
||||
+
|
||||
+static D3DX11_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(file_formats); ++i)
|
||||
+ {
|
||||
+ if (IsEqualGUID(file_formats[i].wic_container_guid, container_format))
|
||||
+ return file_formats[i].d3dx_file_format;
|
||||
+ }
|
||||
+ return D3DX11_IFF_FORCE_DWORD;
|
||||
+}
|
||||
+
|
||||
+static D3D11_RESOURCE_DIMENSION wic_dimension_to_d3dx11_dimension(WICDdsDimension wic_dimension)
|
||||
+{
|
||||
+ switch (wic_dimension)
|
||||
+ {
|
||||
+ case WICDdsTexture1D:
|
||||
+ return D3D11_RESOURCE_DIMENSION_TEXTURE1D;
|
||||
+ case WICDdsTexture2D:
|
||||
+ case WICDdsTextureCube:
|
||||
+ return D3D11_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
+ case WICDdsTexture3D:
|
||||
+ return D3D11_RESOURCE_DIMENSION_TEXTURE3D;
|
||||
+ default:
|
||||
+ return D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const DXGI_FORMAT to_be_converted_format[] =
|
||||
+{
|
||||
+ DXGI_FORMAT_UNKNOWN,
|
||||
+ DXGI_FORMAT_R8_UNORM,
|
||||
+ DXGI_FORMAT_R8G8_UNORM,
|
||||
+ DXGI_FORMAT_B5G6R5_UNORM,
|
||||
+ DXGI_FORMAT_B4G4R4A4_UNORM,
|
||||
+ DXGI_FORMAT_B5G5R5A1_UNORM,
|
||||
+ DXGI_FORMAT_B8G8R8X8_UNORM,
|
||||
+ DXGI_FORMAT_B8G8R8A8_UNORM
|
||||
+};
|
||||
+
|
||||
+static DXGI_FORMAT get_d3dx11_dds_format(DXGI_FORMAT format)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(to_be_converted_format); ++i)
|
||||
+ {
|
||||
+ if (format == to_be_converted_format[i])
|
||||
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
+ }
|
||||
+ return format;
|
||||
+}
|
||||
+
|
||||
+HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
|
||||
+ D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
|
||||
+{
|
||||
+ IWICBitmapFrameDecode *frame = NULL;
|
||||
+ IWICImagingFactory *factory = NULL;
|
||||
+ IWICDdsDecoder *dds_decoder = NULL;
|
||||
+ IWICBitmapDecoder *decoder = NULL;
|
||||
+ WICDdsParameters dds_params;
|
||||
+ IWICStream *stream = NULL;
|
||||
+ unsigned int frame_count;
|
||||
+ GUID container_format;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("src_data %p, src_data_size %lu, pump %p, img_info %p, hresult %p.\n",
|
||||
+ src_data, src_data_size, pump, img_info, hresult);
|
||||
+
|
||||
+ if (!src_data || !src_data_size || !img_info)
|
||||
+ return E_FAIL;
|
||||
+ if (pump)
|
||||
+ FIXME("Thread pump is not supported yet.\n");
|
||||
+
|
||||
+ WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
||||
+ IWICImagingFactory_CreateStream(factory, &stream);
|
||||
+ hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ WARN("Failed to initialize stream.\n");
|
||||
+ goto end;
|
||||
+ }
|
||||
+ hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+
|
||||
+ hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+ img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format);
|
||||
+ if (img_info->ImageFileFormat == D3DX11_IFF_FORCE_DWORD)
|
||||
+ {
|
||||
+ hr = E_FAIL;
|
||||
+ WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format));
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
|
||||
+ if (FAILED(hr) || !frame_count)
|
||||
+ goto end;
|
||||
+ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+ hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+
|
||||
+ if (img_info->ImageFileFormat == D3DX11_IFF_DDS)
|
||||
+ {
|
||||
+ hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+ hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+ img_info->ArraySize = dds_params.ArraySize;
|
||||
+ img_info->Depth = dds_params.Depth;
|
||||
+ img_info->MipLevels = dds_params.MipLevels;
|
||||
+ img_info->ResourceDimension = wic_dimension_to_d3dx11_dimension(dds_params.Dimension);
|
||||
+ img_info->Format = get_d3dx11_dds_format(dds_params.DxgiFormat);
|
||||
+ img_info->MiscFlags = 0;
|
||||
+ if (dds_params.Dimension == WICDdsTextureCube)
|
||||
+ {
|
||||
+ img_info->MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;
|
||||
+ img_info->ArraySize *= 6;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ img_info->ArraySize = 1;
|
||||
+ img_info->Depth = 1;
|
||||
+ img_info->MipLevels = 1;
|
||||
+ img_info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
+ img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
+ img_info->MiscFlags = 0;
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ if (dds_decoder)
|
||||
+ IWICDdsDecoder_Release(dds_decoder);
|
||||
+ if (frame)
|
||||
+ IWICBitmapFrameDecode_Release(frame);
|
||||
+ if (decoder)
|
||||
+ IWICBitmapDecoder_Release(decoder);
|
||||
+ if (stream)
|
||||
+ IWICStream_Release(stream);
|
||||
+ if (factory)
|
||||
+ IWICImagingFactory_Release(factory);
|
||||
+
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ WARN("Invalid or unsupported image file.\n");
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data,
|
||||
SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump,
|
||||
ID3D11ShaderResourceView **view, HRESULT *hresult)
|
||||
--
|
||||
2.32.0
|
||||
|
@@ -0,0 +1,395 @@
|
||||
From 2f65959901f62bfc6a48c683e6eaa5d6ed5f7416 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 3 Aug 2021 11:13:18 +1000
|
||||
Subject: [PATCH] d3dx11_42: Implement D3DX11CreateTextureFromMemory
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx11_43/texture.c | 347 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 342 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c
|
||||
index 8addf4f84d3..f47b8583c6c 100644
|
||||
--- a/dlls/d3dx11_43/texture.c
|
||||
+++ b/dlls/d3dx11_43/texture.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "wincodec.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/heap.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
|
||||
|
||||
@@ -43,6 +44,32 @@ file_formats[] =
|
||||
{ &GUID_ContainerFormatWmp, D3DX11_IFF_WMP },
|
||||
};
|
||||
|
||||
+static const struct
|
||||
+{
|
||||
+ const GUID *wic_guid;
|
||||
+ DXGI_FORMAT dxgi_format;
|
||||
+}
|
||||
+wic_pixel_formats[] =
|
||||
+{
|
||||
+ { &GUID_WICPixelFormatBlackWhite, DXGI_FORMAT_R1_UNORM },
|
||||
+ { &GUID_WICPixelFormat8bppAlpha, DXGI_FORMAT_A8_UNORM },
|
||||
+ { &GUID_WICPixelFormat8bppGray, DXGI_FORMAT_R8_UNORM },
|
||||
+ { &GUID_WICPixelFormat16bppGray, DXGI_FORMAT_R16_UNORM },
|
||||
+ { &GUID_WICPixelFormat16bppGrayHalf, DXGI_FORMAT_R16_FLOAT },
|
||||
+ { &GUID_WICPixelFormat32bppGrayFloat, DXGI_FORMAT_R32_FLOAT },
|
||||
+ { &GUID_WICPixelFormat16bppBGR565, DXGI_FORMAT_B5G6R5_UNORM },
|
||||
+ { &GUID_WICPixelFormat16bppBGRA5551, DXGI_FORMAT_B5G5R5A1_UNORM },
|
||||
+ { &GUID_WICPixelFormat32bppBGR, DXGI_FORMAT_B8G8R8X8_UNORM },
|
||||
+ { &GUID_WICPixelFormat32bppBGRA, DXGI_FORMAT_B8G8R8A8_UNORM },
|
||||
+ { &GUID_WICPixelFormat32bppRGBA, DXGI_FORMAT_R8G8B8A8_UNORM },
|
||||
+ { &GUID_WICPixelFormat32bppRGBA1010102, DXGI_FORMAT_R10G10B10A2_UNORM },
|
||||
+ { &GUID_WICPixelFormat32bppRGBA1010102XR, DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM },
|
||||
+ { &GUID_WICPixelFormat64bppRGBA, DXGI_FORMAT_R16G16B16A16_UNORM },
|
||||
+ { &GUID_WICPixelFormat64bppRGBAHalf, DXGI_FORMAT_R16G16B16A16_FLOAT },
|
||||
+ { &GUID_WICPixelFormat96bppRGBFloat, DXGI_FORMAT_R32G32B32_FLOAT },
|
||||
+ { &GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT }
|
||||
+};
|
||||
+
|
||||
static D3DX11_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format)
|
||||
{
|
||||
unsigned int i;
|
||||
@@ -95,6 +122,175 @@ static DXGI_FORMAT get_d3dx11_dds_format(DXGI_FORMAT format)
|
||||
return format;
|
||||
}
|
||||
|
||||
+static const DXGI_FORMAT block_compressed_formats[] =
|
||||
+{
|
||||
+ DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB,
|
||||
+ DXGI_FORMAT_BC2_TYPELESS, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB,
|
||||
+ DXGI_FORMAT_BC3_TYPELESS, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB,
|
||||
+ DXGI_FORMAT_BC4_TYPELESS, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_SNORM,
|
||||
+ DXGI_FORMAT_BC5_TYPELESS, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_SNORM,
|
||||
+ DXGI_FORMAT_BC6H_TYPELESS, DXGI_FORMAT_BC6H_UF16, DXGI_FORMAT_BC6H_SF16,
|
||||
+ DXGI_FORMAT_BC7_TYPELESS, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM_SRGB
|
||||
+};
|
||||
+
|
||||
+static BOOL is_block_compressed(DXGI_FORMAT format)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(block_compressed_formats); ++i)
|
||||
+ if (format == block_compressed_formats[i])
|
||||
+ return TRUE;
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static unsigned int get_bpp_from_format(DXGI_FORMAT format)
|
||||
+{
|
||||
+ switch (format)
|
||||
+ {
|
||||
+ case DXGI_FORMAT_R32G32B32A32_TYPELESS:
|
||||
+ case DXGI_FORMAT_R32G32B32A32_FLOAT:
|
||||
+ case DXGI_FORMAT_R32G32B32A32_UINT:
|
||||
+ case DXGI_FORMAT_R32G32B32A32_SINT:
|
||||
+ return 128;
|
||||
+ case DXGI_FORMAT_R32G32B32_TYPELESS:
|
||||
+ case DXGI_FORMAT_R32G32B32_FLOAT:
|
||||
+ case DXGI_FORMAT_R32G32B32_UINT:
|
||||
+ case DXGI_FORMAT_R32G32B32_SINT:
|
||||
+ return 96;
|
||||
+ case DXGI_FORMAT_R16G16B16A16_TYPELESS:
|
||||
+ case DXGI_FORMAT_R16G16B16A16_FLOAT:
|
||||
+ case DXGI_FORMAT_R16G16B16A16_UNORM:
|
||||
+ case DXGI_FORMAT_R16G16B16A16_UINT:
|
||||
+ case DXGI_FORMAT_R16G16B16A16_SNORM:
|
||||
+ case DXGI_FORMAT_R16G16B16A16_SINT:
|
||||
+ case DXGI_FORMAT_R32G32_TYPELESS:
|
||||
+ case DXGI_FORMAT_R32G32_FLOAT:
|
||||
+ case DXGI_FORMAT_R32G32_UINT:
|
||||
+ case DXGI_FORMAT_R32G32_SINT:
|
||||
+ case DXGI_FORMAT_R32G8X24_TYPELESS:
|
||||
+ case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
|
||||
+ case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
|
||||
+ case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
|
||||
+ case DXGI_FORMAT_Y416:
|
||||
+ case DXGI_FORMAT_Y210:
|
||||
+ case DXGI_FORMAT_Y216:
|
||||
+ return 64;
|
||||
+ case DXGI_FORMAT_R10G10B10A2_TYPELESS:
|
||||
+ case DXGI_FORMAT_R10G10B10A2_UNORM:
|
||||
+ case DXGI_FORMAT_R10G10B10A2_UINT:
|
||||
+ case DXGI_FORMAT_R11G11B10_FLOAT:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_TYPELESS:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_UNORM:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_UINT:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_SNORM:
|
||||
+ case DXGI_FORMAT_R8G8B8A8_SINT:
|
||||
+ case DXGI_FORMAT_R16G16_TYPELESS:
|
||||
+ case DXGI_FORMAT_R16G16_FLOAT:
|
||||
+ case DXGI_FORMAT_R16G16_UNORM:
|
||||
+ case DXGI_FORMAT_R16G16_UINT:
|
||||
+ case DXGI_FORMAT_R16G16_SNORM:
|
||||
+ case DXGI_FORMAT_R16G16_SINT:
|
||||
+ case DXGI_FORMAT_R32_TYPELESS:
|
||||
+ case DXGI_FORMAT_D32_FLOAT:
|
||||
+ case DXGI_FORMAT_R32_FLOAT:
|
||||
+ case DXGI_FORMAT_R32_UINT:
|
||||
+ case DXGI_FORMAT_R32_SINT:
|
||||
+ case DXGI_FORMAT_R24G8_TYPELESS:
|
||||
+ case DXGI_FORMAT_D24_UNORM_S8_UINT:
|
||||
+ case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
|
||||
+ case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
|
||||
+ case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
|
||||
+ case DXGI_FORMAT_R8G8_B8G8_UNORM:
|
||||
+ case DXGI_FORMAT_G8R8_G8B8_UNORM:
|
||||
+ case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
+ case DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
+ case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
|
||||
+ case DXGI_FORMAT_B8G8R8A8_TYPELESS:
|
||||
+ case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_B8G8R8X8_TYPELESS:
|
||||
+ case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_AYUV:
|
||||
+ case DXGI_FORMAT_Y410:
|
||||
+ case DXGI_FORMAT_YUY2:
|
||||
+ return 32;
|
||||
+ case DXGI_FORMAT_P010:
|
||||
+ case DXGI_FORMAT_P016:
|
||||
+ return 24;
|
||||
+ case DXGI_FORMAT_R8G8_TYPELESS:
|
||||
+ case DXGI_FORMAT_R8G8_UNORM:
|
||||
+ case DXGI_FORMAT_R8G8_UINT:
|
||||
+ case DXGI_FORMAT_R8G8_SNORM:
|
||||
+ case DXGI_FORMAT_R8G8_SINT:
|
||||
+ case DXGI_FORMAT_R16_TYPELESS:
|
||||
+ case DXGI_FORMAT_R16_FLOAT:
|
||||
+ case DXGI_FORMAT_D16_UNORM:
|
||||
+ case DXGI_FORMAT_R16_UNORM:
|
||||
+ case DXGI_FORMAT_R16_UINT:
|
||||
+ case DXGI_FORMAT_R16_SNORM:
|
||||
+ case DXGI_FORMAT_R16_SINT:
|
||||
+ case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
+ case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
+ case DXGI_FORMAT_A8P8:
|
||||
+ case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
+ return 16;
|
||||
+ case DXGI_FORMAT_NV12:
|
||||
+ case DXGI_FORMAT_420_OPAQUE:
|
||||
+ case DXGI_FORMAT_NV11:
|
||||
+ return 12;
|
||||
+ case DXGI_FORMAT_R8_TYPELESS:
|
||||
+ case DXGI_FORMAT_R8_UNORM:
|
||||
+ case DXGI_FORMAT_R8_UINT:
|
||||
+ case DXGI_FORMAT_R8_SNORM:
|
||||
+ case DXGI_FORMAT_R8_SINT:
|
||||
+ case DXGI_FORMAT_A8_UNORM:
|
||||
+ case DXGI_FORMAT_AI44:
|
||||
+ case DXGI_FORMAT_IA44:
|
||||
+ case DXGI_FORMAT_P8:
|
||||
+ case DXGI_FORMAT_BC2_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC2_UNORM:
|
||||
+ case DXGI_FORMAT_BC2_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_BC3_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC3_UNORM:
|
||||
+ case DXGI_FORMAT_BC3_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_BC5_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC5_UNORM:
|
||||
+ case DXGI_FORMAT_BC5_SNORM:
|
||||
+ case DXGI_FORMAT_BC6H_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC6H_UF16:
|
||||
+ case DXGI_FORMAT_BC6H_SF16:
|
||||
+ case DXGI_FORMAT_BC7_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC7_UNORM:
|
||||
+ case DXGI_FORMAT_BC7_UNORM_SRGB:
|
||||
+ return 8;
|
||||
+ case DXGI_FORMAT_BC1_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC1_UNORM:
|
||||
+ case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||
+ case DXGI_FORMAT_BC4_TYPELESS:
|
||||
+ case DXGI_FORMAT_BC4_UNORM:
|
||||
+ case DXGI_FORMAT_BC4_SNORM:
|
||||
+ return 4;
|
||||
+ case DXGI_FORMAT_R1_UNORM:
|
||||
+ return 1;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const GUID *dxgi_format_to_wic_guid(DXGI_FORMAT format)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); ++i)
|
||||
+ {
|
||||
+ if (wic_pixel_formats[i].dxgi_format == format)
|
||||
+ return wic_pixel_formats[i].wic_guid;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump,
|
||||
D3DX11_IMAGE_INFO *img_info, HRESULT *hresult)
|
||||
{
|
||||
@@ -229,14 +425,155 @@ HRESULT WINAPI D3DX11CreateTextureFromFileW(ID3D11Device *device, const WCHAR *f
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
-HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *data,
|
||||
- SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump,
|
||||
+HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *src_data,
|
||||
+ SIZE_T src_data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump,
|
||||
ID3D11Resource **texture, HRESULT *hresult)
|
||||
{
|
||||
- FIXME("device %p, data %p, data_size %lu, load_info %p, pump %p, texture %p, hresult %p stub.\n",
|
||||
- device, data, data_size, load_info, pump, texture, hresult);
|
||||
+ unsigned int frame_count, width, height, stride, frame_size;
|
||||
+ IWICFormatConverter *converter = NULL;
|
||||
+ IWICDdsFrameDecode *dds_frame = NULL;
|
||||
+ D3D11_TEXTURE2D_DESC texture_2d_desc;
|
||||
+ D3D11_SUBRESOURCE_DATA resource_data;
|
||||
+ IWICBitmapFrameDecode *frame = NULL;
|
||||
+ IWICImagingFactory *factory = NULL;
|
||||
+ IWICBitmapDecoder *decoder = NULL;
|
||||
+ ID3D11Texture2D *texture_2d;
|
||||
+ D3DX11_IMAGE_INFO img_info;
|
||||
+ IWICStream *stream = NULL;
|
||||
+ const GUID *dst_format;
|
||||
+ BYTE *buffer = NULL;
|
||||
+ BOOL can_convert;
|
||||
+ GUID src_format;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("device %p, src_data %p, src_data_size %lu, load_info %p, pump %p, texture %p, hresult %p.\n",
|
||||
+ device, src_data, src_data_size, load_info, pump, texture, hresult);
|
||||
+
|
||||
+ if (!src_data || !src_data_size || !texture)
|
||||
+ return E_FAIL;
|
||||
+ if (load_info)
|
||||
+ FIXME("load_info is ignored.\n");
|
||||
+ if (pump)
|
||||
+ FIXME("Thread pump is not supported yet.\n");
|
||||
+
|
||||
+ if (FAILED(D3DX11GetImageInfoFromMemory(src_data, src_data_size, NULL, &img_info, NULL)))
|
||||
+ return E_FAIL;
|
||||
+ if (img_info.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
+ {
|
||||
+ FIXME("Cube map is not supported.\n");
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICImagingFactory_CreateStream(factory, &stream)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count)) || !frame_count)
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &src_format)))
|
||||
+ goto end;
|
||||
+
|
||||
+ width = img_info.Width;
|
||||
+ height = img_info.Height;
|
||||
+ if (is_block_compressed(img_info.Format))
|
||||
+ {
|
||||
+ width = (width + 3) & ~3;
|
||||
+ height = (height + 3) & ~3;
|
||||
+ }
|
||||
+ stride = (width * get_bpp_from_format(img_info.Format) + 7) / 8;
|
||||
+ frame_size = stride * height;
|
||||
+
|
||||
+ if (!(buffer = heap_alloc(frame_size)))
|
||||
+ {
|
||||
+ hr = E_FAIL;
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ if (is_block_compressed(img_info.Format))
|
||||
+ {
|
||||
+ if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICDdsFrameDecode, (void **)&dds_frame)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, stride * 4, frame_size, buffer)))
|
||||
+ goto end;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format)))
|
||||
+ {
|
||||
+ hr = E_FAIL;
|
||||
+ FIXME("Unsupported DXGI format %#x.\n", img_info.Format);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ if (IsEqualGUID(&src_format, dst_format))
|
||||
+ {
|
||||
+ if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, stride, frame_size, buffer)))
|
||||
+ goto end;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (FAILED(hr = IWICImagingFactory_CreateFormatConverter(factory, &converter)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICFormatConverter_CanConvert(converter, &src_format, dst_format, &can_convert)))
|
||||
+ goto end;
|
||||
+ if (!can_convert)
|
||||
+ {
|
||||
+ WARN("Format converting %s to %s is not supported by WIC.\n",
|
||||
+ debugstr_guid(&src_format), debugstr_guid(dst_format));
|
||||
+ goto end;
|
||||
+ }
|
||||
+ if (FAILED(hr = IWICFormatConverter_Initialize(converter, (IWICBitmapSource *)frame, dst_format,
|
||||
+ WICBitmapDitherTypeErrorDiffusion, 0, 0, WICBitmapPaletteTypeCustom)))
|
||||
+ goto end;
|
||||
+ if (FAILED(hr = IWICFormatConverter_CopyPixels(converter, NULL, stride, frame_size, buffer)))
|
||||
+ goto end;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ memset(&texture_2d_desc, 0, sizeof(texture_2d_desc));
|
||||
+ texture_2d_desc.Width = width;
|
||||
+ texture_2d_desc.Height = height;
|
||||
+ texture_2d_desc.MipLevels = 1;
|
||||
+ texture_2d_desc.ArraySize = img_info.ArraySize;
|
||||
+ texture_2d_desc.Format = img_info.Format;
|
||||
+ texture_2d_desc.SampleDesc.Count = 1;
|
||||
+ texture_2d_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ texture_2d_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
+ texture_2d_desc.MiscFlags = img_info.MiscFlags;
|
||||
+
|
||||
+ resource_data.pSysMem = buffer;
|
||||
+ resource_data.SysMemPitch = stride;
|
||||
+ resource_data.SysMemSlicePitch = frame_size;
|
||||
+
|
||||
+ if (FAILED(hr = ID3D11Device_CreateTexture2D(device, &texture_2d_desc, &resource_data, &texture_2d)))
|
||||
+ goto end;
|
||||
+
|
||||
+ *texture = (ID3D11Resource *)texture_2d;
|
||||
+ hr = S_OK;
|
||||
+
|
||||
+end:
|
||||
+ if (converter)
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+ if (dds_frame)
|
||||
+ IWICDdsFrameDecode_Release(dds_frame);
|
||||
+ if (buffer)
|
||||
+ heap_free(buffer);
|
||||
+ if (frame)
|
||||
+ IWICBitmapFrameDecode_Release(frame);
|
||||
+ if (decoder)
|
||||
+ IWICBitmapDecoder_Release(decoder);
|
||||
+ if (stream)
|
||||
+ IWICStream_Release(stream);
|
||||
+ if (factory)
|
||||
+ IWICImagingFactory_Release(factory);
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture,
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -0,0 +1,4 @@
|
||||
Fixes: [50210] - Implement D3DX11GetImageInfoFromMemory
|
||||
Fixes: [45533] - Implement D3DX11CreateTextureFromMemory
|
||||
|
||||
# This patchset will need to wait until the new wined3dx dll implemented.
|
@@ -1,4 +1,4 @@
|
||||
From 27517cacf7df657e32e7ca7068c3e86723cb4a3c Mon Sep 17 00:00:00 2001
|
||||
From 6c3aa646aff81104eb7783138a71d4bb8cf192a7 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sat, 13 Feb 2016 15:29:37 +0100
|
||||
Subject: [PATCH] d3dx9_36: Implement D3DXDisassembleShader. (v2)
|
||||
@@ -6,11 +6,11 @@ Subject: [PATCH] d3dx9_36: Implement D3DXDisassembleShader. (v2)
|
||||
Changes in v2 (by Christian Costa):
|
||||
* More generic code for D3DXDisassembleShader.
|
||||
---
|
||||
dlls/d3dx9_36/shader.c | 331 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 328 insertions(+), 3 deletions(-)
|
||||
dlls/d3dx9_36/shader.c | 332 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 327 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
|
||||
index c59fc791e..79d47b95c 100644
|
||||
index fe0f99180ac..54d0b158568 100644
|
||||
--- a/dlls/d3dx9_36/shader.c
|
||||
+++ b/dlls/d3dx9_36/shader.c
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -30,11 +30,10 @@ index c59fc791e..79d47b95c 100644
|
||||
#include "d3dx9_private.h"
|
||||
#include "d3dcommon.h"
|
||||
#include "d3dcompiler.h"
|
||||
@@ -2138,10 +2139,334 @@ HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **sample
|
||||
@@ -2336,13 +2337,334 @@ HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **sample
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
+
|
||||
+static const char *decl_usage[] = { "position", "blendweight", "blendindices", "normal", "psize", "texcoord",
|
||||
+ "tangent", "binormal", "tessfactor", "positiont", "color" };
|
||||
+
|
||||
@@ -299,10 +298,11 @@ index c59fc791e..79d47b95c 100644
|
||||
+ { D3DSIO_COMMENT, "", 0, instr_comment, 0x0100, 0xFFFF }
|
||||
+};
|
||||
+
|
||||
HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments, ID3DXBuffer **disassembly)
|
||||
HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments,
|
||||
- ID3DXBuffer **buffer)
|
||||
+ ID3DXBuffer **disassembly)
|
||||
{
|
||||
- FIXME("%p %d %s %p: stub\n", shader, colorcode, debugstr_a(comments), disassembly);
|
||||
- return E_OUTOFMEMORY;
|
||||
- TRACE("shader %p, colorcode %d, comments %s, buffer %p.\n", shader, colorcode, debugstr_a(comments), buffer);
|
||||
+ DWORD *ptr = (DWORD *)shader;
|
||||
+ char *buffer, *buf;
|
||||
+ UINT capacity = 4096;
|
||||
@@ -314,7 +314,9 @@ index c59fc791e..79d47b95c 100644
|
||||
+
|
||||
+ if (!shader || !disassembly)
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+
|
||||
|
||||
- return D3DDisassemble(shader, D3DXGetShaderSize(shader), colorcode ? D3D_DISASM_ENABLE_COLOR_CODE : 0,
|
||||
- comments, (ID3DBlob **)buffer);
|
||||
+ buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
|
||||
+ if (!buffer)
|
||||
+ return E_OUTOFMEMORY;
|
||||
@@ -331,7 +333,7 @@ index c59fc791e..79d47b95c 100644
|
||||
+ if ((buf - buffer + 128) > capacity)
|
||||
+ {
|
||||
+ UINT count = buf - buffer;
|
||||
+ char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
|
||||
+ char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
|
||||
+ if (!new_buffer)
|
||||
+ {
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
@@ -368,5 +370,5 @@ index c59fc791e..79d47b95c 100644
|
||||
|
||||
struct d3dx9_texture_shader
|
||||
--
|
||||
2.21.0
|
||||
2.32.0
|
||||
|
||||
|
@@ -1,144 +0,0 @@
|
||||
From cca287da02e2946705ad89f6e8c052b68199ad31 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 1 Jun 2021 17:15:44 +1000
|
||||
Subject: [PATCH v3] dpnet: Implement IDirectPlay8Server EnumServiceProviders
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/dpnet/server.c | 14 ++++++-
|
||||
dlls/dpnet/tests/server.c | 86 +++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 98 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/dpnet/server.c b/dlls/dpnet/server.c
|
||||
index 977771697ac..26dd76388b1 100644
|
||||
--- a/dlls/dpnet/server.c
|
||||
+++ b/dlls/dpnet/server.c
|
||||
@@ -126,9 +126,19 @@ static HRESULT WINAPI IDirectPlay8ServerImpl_EnumServiceProviders(IDirectPlay8Se
|
||||
PDWORD pcReturned, DWORD dwFlags)
|
||||
{
|
||||
IDirectPlay8ServerImpl *This = impl_from_IDirectPlay8Server(iface);
|
||||
- FIXME("(%p)->(%s %s %p %p %p %d)\n", This, debugstr_guid(pguidServiceProvider), debugstr_guid(pguidApplication),
|
||||
+ TRACE("(%p)->(%s %s %p %p %p %d)\n", This, debugstr_guid(pguidServiceProvider), debugstr_guid(pguidApplication),
|
||||
pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags);
|
||||
- return E_NOTIMPL;
|
||||
+
|
||||
+ if(!This->msghandler)
|
||||
+ return DPNERR_UNINITIALIZED;
|
||||
+
|
||||
+ if(dwFlags)
|
||||
+ FIXME("Unhandled flags %x\n", dwFlags);
|
||||
+
|
||||
+ if(pguidApplication)
|
||||
+ FIXME("Application guid %s is currently being ignored\n", debugstr_guid(pguidApplication));
|
||||
+
|
||||
+ return enum_services_providers(pguidServiceProvider, pSPInfoBuffer, pcbEnumData, pcReturned);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirectPlay8ServerImpl_CancelAsyncOperation(IDirectPlay8Server *iface, DPNHANDLE hAsyncHandle, DWORD dwFlags)
|
||||
diff --git a/dlls/dpnet/tests/server.c b/dlls/dpnet/tests/server.c
|
||||
index 74a0e5adfcf..ae7e876522d 100644
|
||||
--- a/dlls/dpnet/tests/server.c
|
||||
+++ b/dlls/dpnet/tests/server.c
|
||||
@@ -184,6 +184,91 @@ static void test_server_info(void)
|
||||
}
|
||||
}
|
||||
|
||||
+static void test_enum_service_providers(void)
|
||||
+{
|
||||
+ DPN_SERVICE_PROVIDER_INFO *serv_prov_info;
|
||||
+ IDirectPlay8Server *server = NULL;
|
||||
+ DWORD items, size;
|
||||
+ DWORD i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ hr = CoCreateInstance( &CLSID_DirectPlay8Server, NULL, CLSCTX_ALL, &IID_IDirectPlay8Server, (LPVOID*)&server);
|
||||
+ ok(hr == S_OK, "Failed to create IDirectPlay8Server object\n");
|
||||
+ if (FAILED(hr))
|
||||
+ return;
|
||||
+
|
||||
+ size = 0;
|
||||
+ items = 0;
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, serv_prov_info, &size, &items, 0);
|
||||
+ ok(hr == DPNERR_UNINITIALIZED, "got %x\n", hr);
|
||||
+
|
||||
+ hr = IDirectPlay8Server_Initialize(server, NULL, DirectPlayMessageHandler, 0);
|
||||
+ ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ IDirectPlay8Server_Release(server);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ size = 0;
|
||||
+ items = 0;
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, &size, NULL, 0);
|
||||
+ ok(hr == E_POINTER, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, NULL, &items, 0);
|
||||
+ ok(hr == E_POINTER, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, NULL, &size, &items, 0);
|
||||
+ ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+ ok(size != 0, "size is unexpectedly 0\n");
|
||||
+
|
||||
+ serv_prov_info = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, NULL, NULL, serv_prov_info, &size, &items, 0);
|
||||
+ ok(hr == S_OK, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+ ok(items != 0, "Found unexpectedly no service providers\n");
|
||||
+
|
||||
+ trace("number of items found: %d\n", items);
|
||||
+
|
||||
+ for (i=0;i<items;i++)
|
||||
+ {
|
||||
+ trace("Found Service Provider: %s\n", wine_dbgstr_w(serv_prov_info[i].pwszName));
|
||||
+ trace("Found guid: %s\n", wine_dbgstr_guid(&serv_prov_info[i].guid));
|
||||
+ }
|
||||
+
|
||||
+ ok(HeapFree(GetProcessHeap(), 0, serv_prov_info), "Failed freeing server provider info\n");
|
||||
+
|
||||
+ size = 0;
|
||||
+ items = 0;
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, &CLSID_DP8SP_TCPIP, NULL, NULL, &size, &items, 0);
|
||||
+ ok(hr == DPNERR_BUFFERTOOSMALL, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+ ok(size != 0, "size is unexpectedly 0\n");
|
||||
+
|
||||
+ serv_prov_info = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, &CLSID_DP8SP_TCPIP, NULL, serv_prov_info, &size, &items, 0);
|
||||
+ ok(hr == S_OK, "IDirectPlay8Server_EnumServiceProviders failed with %x\n", hr);
|
||||
+ ok(items != 0, "Found unexpectedly no adapter\n");
|
||||
+
|
||||
+
|
||||
+ for (i=0;i<items;i++)
|
||||
+ {
|
||||
+ trace("Found adapter: %s\n", wine_dbgstr_w(serv_prov_info[i].pwszName));
|
||||
+ trace("Found adapter guid: %s\n", wine_dbgstr_guid(&serv_prov_info[i].guid));
|
||||
+ }
|
||||
+
|
||||
+ /* Invalid GUID */
|
||||
+ items = 88;
|
||||
+ hr = IDirectPlay8Server_EnumServiceProviders(server, &appguid, NULL, serv_prov_info, &size, &items, 0);
|
||||
+ ok(hr == DPNERR_DOESNOTEXIST, "IDirectPlay8Peer_EnumServiceProviders failed with %x\n", hr);
|
||||
+ ok(items == 88, "Found adapter %d\n", items);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, serv_prov_info);
|
||||
+ IDirectPlay8Server_Release(server);
|
||||
+}
|
||||
+
|
||||
BOOL is_process_elevated(void)
|
||||
{
|
||||
HANDLE token;
|
||||
@@ -398,6 +483,7 @@ START_TEST(server)
|
||||
|
||||
create_server();
|
||||
test_server_info();
|
||||
+ test_enum_service_providers();
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [51221] dpnet: Impelment IDirectPlay8Server EnumServiceProviders.
|
@@ -36,7 +36,7 @@ index 5d06bf9348..2213717f92 100644
|
||||
+ if (layout->format.fallback) {
|
||||
+ fallback = layout->format.fallback;
|
||||
+ IDWriteFontFallback_AddRef(fallback);
|
||||
+ } else if (FAILED(hr = IDWriteFactory5_GetSystemFontFallback(layout->factory, &fallback))) {
|
||||
+ } else if (FAILED(hr = IDWriteFactory7_GetSystemFontFallback(layout->factory, &fallback))) {
|
||||
+ WARN("Failed to get system fallback, hr %#x.\n", hr);
|
||||
+ return hr;
|
||||
+ }
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user