Rebase against upstream changes, remove patch for IDirectPlayVoiceClient::GetCompressionTypes (accepted upstream).

This commit is contained in:
Sebastian Lackner 2015-02-20 01:56:07 +01:00
parent 9717d3f69e
commit ea9f209292
10 changed files with 226 additions and 587 deletions

View File

@ -134,7 +134,7 @@ Included bug fixes and improvements
* Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323))
* Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042))
* Implement ntoskrnl driver testing framework.
* Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes ([Wine Bug #29238](https://bugs.winehq.org/show_bug.cgi?id=29238))
* ~~Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes~~ ([Wine Bug #29238](https://bugs.winehq.org/show_bug.cgi?id=29238))
* Implement stub for ntoskrnl.IoGetAttachedDeviceReference
* Implement stub for ntoskrnl.KeDelayExecutionThread.
* Implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe

2
debian/changelog vendored
View File

@ -15,6 +15,8 @@ wine-staging (1.7.37) UNRELEASED; urgency=low
* Added patch to improve stubs for AEV_{Get,Set}Mute.
* Removed patches for UTF7 support (accepted upstream).
* Removed patches for SIO_ADDRESS_LIST_CHANGE ioctl (accepted upstream).
* Removed patch for IApplicationAssociationRegistration::QueryCurrentDefault (accepted upstream).
* Removed patch for IDirectPlayVoiceClient::GetCompressionTypes (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Sun, 08 Feb 2015 20:29:38 +0100
wine-staging (1.7.36) unstable; urgency=low

View File

@ -1,221 +0,0 @@
From 2ffd5a6a1a61b8a3f9a6747a5cb23676d3092c3d Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Fri, 16 Jan 2015 00:44:23 -0700
Subject: dpvoice/tests: Add GetCompressionTypes tests.
---
dlls/dpvoice/tests/voice.c | 190 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 188 insertions(+), 2 deletions(-)
diff --git a/dlls/dpvoice/tests/voice.c b/dlls/dpvoice/tests/voice.c
index 8048280..8d1d879 100644
--- a/dlls/dpvoice/tests/voice.c
+++ b/dlls/dpvoice/tests/voice.c
@@ -343,6 +343,179 @@ static void create_voicetest(void)
}
}
+static void test_GetCompressionTypes(HRESULT (WINAPI *GetCompressionTypes)(void*,void*,DWORD*,DWORD*,DWORD),
+ void *iface, const char *name)
+{
+ DVCOMPRESSIONINFO data[32];
+ HRESULT ret;
+ DWORD data_size, num_elements, i, j;
+ WCHAR *string_loc;
+ BOOL found_pcm;
+
+ /* some variables are initialized to 99 just to check that they are not overwritten with 0 */
+ static struct
+ {
+ /* inputs */
+ DWORD data_size;
+ DWORD num_elements;
+ DWORD flags;
+ /* expected output */
+ HRESULT ret;
+ /* test flags */
+ enum
+ {
+ NULL_DATA = 1,
+ NULL_DATA_SIZE = 2,
+ NULL_NUM_ELEMENTS = 4,
+ SHARED_VARIABLE = 8
+ }
+ test_flags;
+ }
+ tests[] =
+ {
+ /* tests NULL data with an insufficient data_size */
+ { 10, 0, 0, DVERR_BUFFERTOOSMALL, NULL_DATA },
+
+ /* tests NULL data with an ample data_size */
+ { sizeof(data) - 1, 0, 0, DVERR_INVALIDPOINTER, NULL_DATA },
+
+ /* tests NULL data_size */
+ { 0, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA_SIZE },
+
+ /* tests NULL num_elements */
+ { 99, 0, 0, DVERR_INVALIDPOINTER, NULL_NUM_ELEMENTS },
+
+ /* tests NULL everything */
+ { 99, 99, 0, DVERR_INVALIDPOINTER, NULL_DATA | NULL_DATA_SIZE | NULL_NUM_ELEMENTS },
+
+ /* tests passing the same pointer for data_size and num_elements */
+ { 10, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE },
+
+ /* tests passing the same pointer but with an ample data_size */
+ { sizeof(data) - 1, 0, 0, DVERR_BUFFERTOOSMALL, SHARED_VARIABLE },
+
+ /* tests flags!=0 */
+ { 99, 99, 1, DVERR_INVALIDFLAGS },
+
+ /* tests data_size=0 */
+ { 0, 0, 0, DVERR_BUFFERTOOSMALL },
+
+ /* tests data_size=1 */
+ { 1, 0, 0, DVERR_BUFFERTOOSMALL },
+
+ /* tests data_size = sizeof(DVCOMPRESSIONINFO) */
+ { sizeof(DVCOMPRESSIONINFO), 0, 0, DVERR_BUFFERTOOSMALL },
+
+ /* tests data_size = returned data_size - 1 */
+ { 0 /* initialized later */, 0, 0, DVERR_BUFFERTOOSMALL },
+
+ /* tests data_size = returned data_size */
+ { 0 /* initialized later */, 0, 0, DV_OK },
+
+ /* tests data_size = returned data_size + 1 */
+ { 0 /* initialized later */, 0, 0, DV_OK }
+ };
+
+ if(GetCompressionTypes(iface, NULL, NULL, NULL, 0) == E_NOTIMPL)
+ {
+ skip("%s: GetCompressionTypes not implemented\n", name);
+ return;
+ }
+
+ data_size = 0;
+ ret = GetCompressionTypes(iface, NULL, &data_size, &num_elements, 0);
+ ok(ret == DVERR_BUFFERTOOSMALL,
+ "%s: expected ret=%x, got ret=%x\n", name, DVERR_BUFFERTOOSMALL, ret);
+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
+ "%s: expected data_size between %u and %u, got data_size=%u\n",
+ name, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size);
+ tests[sizeof(tests) / sizeof(tests[0]) - 3].data_size = data_size - 1;
+ tests[sizeof(tests) / sizeof(tests[0]) - 2].data_size = data_size;
+ tests[sizeof(tests) / sizeof(tests[0]) - 1].data_size = data_size + 1;
+
+ for(i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
+ {
+ memset(data, 0x23, sizeof(data));
+
+ data_size = tests[i].data_size;
+ num_elements = tests[i].num_elements;
+
+ ret = GetCompressionTypes(
+ iface,
+ tests[i].test_flags & NULL_DATA ? NULL : data,
+ tests[i].test_flags & NULL_DATA_SIZE ? NULL : &data_size,
+ tests[i].test_flags & NULL_NUM_ELEMENTS ? NULL :
+ tests[i].test_flags & SHARED_VARIABLE ? &data_size : &num_elements,
+ tests[i].flags
+ );
+
+ ok(ret == tests[i].ret,
+ "%s: tests[%u]: expected ret=%x got ret=%x\n", name, i, tests[i].ret, ret);
+
+ if(ret == DV_OK || ret == DVERR_BUFFERTOOSMALL || tests[i].test_flags == NULL_DATA)
+ {
+ ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
+ "%s: tests[%u]: expected data_size between %u and %u, got data_size=%u\n",
+ name, i, (DWORD)sizeof(DVCOMPRESSIONINFO), (DWORD)sizeof(data) - 1, data_size);
+ if(!(tests[i].test_flags & SHARED_VARIABLE))
+ ok(num_elements > 0 && num_elements < data_size / sizeof(DVCOMPRESSIONINFO) + 1,
+ "%s: tests[%u]: expected num_elements between 0 and %u, got num_elements=%u\n",
+ name, i, data_size / (DWORD)sizeof(DVCOMPRESSIONINFO) + 1, num_elements);
+ }
+ else
+ {
+ ok(data_size == tests[i].data_size,
+ "%s: tests[%u]: expected data_size=%u, got data_size=%u\n",
+ name, i, tests[i].data_size, data_size);
+ ok(num_elements == tests[i].num_elements,
+ "%s: tests[%u]: expected num_elements=%u, got num_elements=%u\n",
+ name, i, tests[i].num_elements, num_elements);
+ }
+
+ if(ret == DV_OK)
+ {
+ string_loc = (WCHAR *)(data + num_elements);
+ found_pcm = FALSE;
+ for(j = 0; j < num_elements; j++)
+ {
+ if(memcmp(&data[j].guidType, &DPVCTGUID_NONE, sizeof(GUID)) == 0)
+ {
+ ok(data[j].dwMaxBitsPerSecond == 64000,
+ "%s: tests[%u]: data[%u]: expected dwMaxBitsPerSecond=64000, got dwMaxBitsPerSecond=%u\n",
+ name, i, j, data[j].dwMaxBitsPerSecond);
+ found_pcm = TRUE;
+ }
+ ok(data[j].dwSize == 80,
+ "%s: tests[%u]: data[%u]: expected dwSize=80, got dwSize=%u\n",
+ name, i, j, data[j].dwSize);
+ ok(data[j].lpszName == string_loc,
+ "%s: tests[%u]: data[%u]: expected lpszName=%p, got lpszName=%p\n",
+ name, i, j, string_loc, data[j].lpszName);
+ ok(!data[j].lpszDescription,
+ "%s: tests[%u]: data[%u]: expected lpszDescription=NULL, got lpszDescription=%s\n",
+ name, i, j, wine_dbgstr_w(data[j].lpszDescription));
+ ok(!data[j].dwFlags,
+ "%s: tests[%u]: data[%u]: expected dwFlags=0, got dwFlags=%u\n",
+ name, i, j, data[j].dwFlags);
+ string_loc += lstrlenW(data[j].lpszName) + 1;
+ }
+ ok((char *)string_loc == (char *)data + data_size,
+ "%s: tests[%u]: expected string_loc=%p, got string_loc=%p\n",
+ name, i, (char *)data + data_size, string_loc);
+ ok(*(char *)string_loc == 0x23,
+ "%s: tests[%u]: expected *(char*)string_loc=0x23, got *(char *)string_loc=0x%x\n",
+ name, i, *(char *)string_loc);
+ ok(found_pcm, "%s: tests[%u]: MS-PCM codec not found\n", name, i);
+ }
+ else
+ {
+ ok(*(char *)data == 0x23,
+ "%s: tests[%u]: expected *(char*)data=0x23, got *(char *)data=0x%x\n",
+ name, i, *(char *)data);
+ }
+ }
+}
+
START_TEST(voice)
{
HRESULT hr;
@@ -354,9 +527,22 @@ START_TEST(voice)
create_voicetest();
- if(test_init_dpvoice_server() && test_init_dpvoice_client())
+ if(test_init_dpvoice_server())
+ {
+ test_GetCompressionTypes((void *)vserver->lpVtbl->GetCompressionTypes, vserver, "server");
+ }
+ else
+ {
+ skip("server failed to initialize\n");
+ }
+
+ if(test_init_dpvoice_client())
+ {
+ test_GetCompressionTypes((void *)vclient->lpVtbl->GetCompressionTypes, vclient, "client");
+ }
+ else
{
- /* TODO */
+ skip("client failed to initialize\n");
}
test_cleanup_dpvoice();
--
2.2.1

View File

@ -1,133 +0,0 @@
From 25a2c26cb36b59d5d820707e8d5a6313d6a3636d Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Fri, 16 Jan 2015 00:44:24 -0700
Subject: dpvoice: Turn GetCompressionTypes into a semi-stub.
Star Trek Armada II needs GetCompressionTypes to return at least one
value, see https://bugs.winehq.org/show_bug.cgi?id=29238
MS-PCM is guaranteed to be present on Windows XP, and it's already
implemented in Wine, so advertising this codec shouldn't cause any
trouble.
---
dlls/dpvoice/client.c | 5 +++--
dlls/dpvoice/dvoice_private.h | 1 +
dlls/dpvoice/server.c | 43 +++++++++++++++++++++++++++++++++++++++++--
dlls/dpvoice/tests/voice.c | 6 ------
4 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/dlls/dpvoice/client.c b/dlls/dpvoice/client.c
index 29b5336..bdae160 100644
--- a/dlls/dpvoice/client.c
+++ b/dlls/dpvoice/client.c
@@ -32,6 +32,7 @@
#include "wine/debug.h"
#include "dvoice.h"
+#include "dvoice_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dpvoice);
@@ -149,8 +150,8 @@ static HRESULT WINAPI dpvclient_GetCompressionTypes(IDirectPlayVoiceClient *ifac
DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags)
{
IDirectPlayVoiceClientImpl *This = impl_from_IDirectPlayVoiceClient(iface);
- FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
- return E_NOTIMPL;
+ FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
+ return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags);
}
static HRESULT WINAPI dpvclient_SetTransmitTargets(IDirectPlayVoiceClient *iface, PDVID pdvIDTargets,
diff --git a/dlls/dpvoice/dvoice_private.h b/dlls/dpvoice/dvoice_private.h
index 5b0e57d..ededeab 100644
--- a/dlls/dpvoice/dvoice_private.h
+++ b/dlls/dpvoice/dvoice_private.h
@@ -23,5 +23,6 @@
extern HRESULT DPVOICE_CreateDirectPlayVoiceClient(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPVOICE_CreateDirectPlayVoiceServer(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPVOICE_CreateDirectPlayVoiceTest(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
+extern HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) DECLSPEC_HIDDEN;
#endif
diff --git a/dlls/dpvoice/server.c b/dlls/dpvoice/server.c
index e9291e2..80ef199 100644
--- a/dlls/dpvoice/server.c
+++ b/dlls/dpvoice/server.c
@@ -41,6 +41,45 @@ typedef struct IDirectPlayVoiceServerImpl
LONG ref;
} IDirectPlayVoiceServerImpl;
+HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags)
+{
+ static const DVCOMPRESSIONINFO pcm_type =
+ {80, {0x8de12fd4,0x7cb3,0x48ce,{0xa7,0xe8,0x9c,0x47,0xa2,0x2e,0x8a,0xc5}}, NULL, NULL, 0, 64000};
+ static const WCHAR pcm_name[] =
+ {'M','S','-','P','C','M',' ','6','4',' ','k','b','i','t','/','s',0};
+
+ HRESULT ret;
+ LPWSTR string_loc;
+
+ if (!pdwDataSize || !pdwNumElements)
+ return DVERR_INVALIDPOINTER;
+
+ if (dwFlags)
+ return DVERR_INVALIDFLAGS;
+
+ *pdwNumElements = 1;
+
+ if (*pdwDataSize < sizeof(pcm_type) + sizeof(pcm_name))
+ {
+ ret = DVERR_BUFFERTOOSMALL;
+ }
+ else if (!pData)
+ {
+ ret = DVERR_INVALIDPOINTER;
+ }
+ else
+ {
+ string_loc = (LPWSTR)((char*)pData + sizeof(pcm_type));
+ memcpy(pData, &pcm_type, sizeof(pcm_type));
+ memcpy(string_loc, pcm_name, sizeof(pcm_name));
+ pData->lpszName = string_loc;
+ ret = DV_OK;
+ }
+
+ *pdwDataSize = sizeof(pcm_type) + sizeof(pcm_name);
+ return ret;
+}
+
static inline IDirectPlayVoiceServerImpl *impl_from_IDirectPlayVoiceServer(IDirectPlayVoiceServer *iface)
{
return CONTAINING_RECORD(iface, IDirectPlayVoiceServerImpl, IDirectPlayVoiceServer_iface);
@@ -130,8 +169,8 @@ static HRESULT WINAPI dpvserver_GetCompressionTypes(IDirectPlayVoiceServer *ifac
DWORD *pdwNumElements, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
- FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
- return E_NOTIMPL;
+ FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
+ return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags);
}
static HRESULT WINAPI dpvserver_SetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets,
diff --git a/dlls/dpvoice/tests/voice.c b/dlls/dpvoice/tests/voice.c
index e42fb7b..ad84b3f 100644
--- a/dlls/dpvoice/tests/voice.c
+++ b/dlls/dpvoice/tests/voice.c
@@ -416,12 +416,6 @@ static void test_GetCompressionTypes(HRESULT (WINAPI *GetCompressionTypes)(void*
{ 0 /* initialized later */, 0, 0, DV_OK }
};
- if(GetCompressionTypes(iface, NULL, NULL, NULL, 0) == E_NOTIMPL)
- {
- skip("%s: GetCompressionTypes not implemented\n", name);
- return;
- }
-
data_size = 0;
ret = GetCompressionTypes(iface, NULL, &data_size, &num_elements, 0);
ok(ret == DVERR_BUFFERTOOSMALL,
--
2.2.1

View File

@ -1 +0,0 @@
Fixes: [29238] Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes

View File

@ -84,7 +84,6 @@ patch_enable_all ()
enable_dbghelp_Debug_Symbols="$1"
enable_ddraw_d3d_execute_buffer="$1"
enable_dinput_Events="$1"
enable_dpvoice_GetCompressionTypes="$1"
enable_dsound_Fast_Mixer="$1"
enable_dxgi_GetDesc="$1"
enable_fonts_Missing_Fonts="$1"
@ -281,9 +280,6 @@ patch_enable ()
dinput-Events)
enable_dinput_Events="$2"
;;
dpvoice-GetCompressionTypes)
enable_dpvoice_GetCompressionTypes="$2"
;;
dsound-Fast_Mixer)
enable_dsound_Fast_Mixer="$2"
;;
@ -1445,23 +1441,6 @@ if test "$enable_dinput_Events" -eq 1; then
) >> "$patchlist"
fi
# Patchset dpvoice-GetCompressionTypes
# |
# | This patchset fixes the following Wine bugs:
# | * [#29238] Implement semi-stub for IDirectPlayVoiceClient::GetCompressionTypes
# |
# | Modified files:
# | * dlls/dpvoice/client.c, dlls/dpvoice/dvoice_private.h, dlls/dpvoice/server.c, dlls/dpvoice/tests/voice.c
# |
if test "$enable_dpvoice_GetCompressionTypes" -eq 1; then
patch_apply dpvoice-GetCompressionTypes/0001-dpvoice-tests-Add-GetCompressionTypes-tests.patch
patch_apply dpvoice-GetCompressionTypes/0002-dpvoice-Turn-GetCompressionTypes-into-a-semi-stub.patch
(
echo '+ { "Alex Henrie", "dpvoice/tests: Add GetCompressionTypes tests.", 1 },';
echo '+ { "Alex Henrie", "dpvoice: Turn GetCompressionTypes into a semi-stub.", 1 },';
) >> "$patchlist"
fi
# Patchset dsound-Fast_Mixer
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,18 +1,18 @@
From 031999169c1d5006c62e4b4d722c361d57d5ed09 Mon Sep 17 00:00:00 2001
From a7a0d0aca8b7d4b1972f237a19b5caf212a74fd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:22:24 +0200
Subject: wined3d: Merge get_pitch functions.
---
dlls/ddraw/surface.c | 12 +++++--
dlls/wined3d/resource.c | 31 +++++++++++++++++
dlls/wined3d/surface.c | 75 +++++++++++++++++-------------------------
dlls/wined3d/resource.c | 31 ++++++++++++++++
dlls/wined3d/surface.c | 81 ++++++++++++++++++------------------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/volume.c | 28 ++--------------
dlls/wined3d/volume.c | 28 ++-------------
dlls/wined3d/wined3d.spec | 2 +-
dlls/wined3d/wined3d_private.h | 3 +-
include/wine/wined3d.h | 3 +-
8 files changed, 78 insertions(+), 78 deletions(-)
8 files changed, 81 insertions(+), 81 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index a387d12..9a8d94f 100644
@ -97,7 +97,7 @@ index 205f074..3375c0f 100644
+ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 677f876..8fa36e4 100644
index 9ba5906..dbbc826 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -363,6 +363,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@ -204,7 +204,7 @@ index 677f876..8fa36e4 100644
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
{
LONG w, h;
@@ -2182,12 +2165,13 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2182,20 +2165,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@ -215,13 +215,24 @@ index 677f876..8fa36e4 100644
surface->resource.multisample_type = texture_resource->multisample_type;
surface->resource.multisample_quality = texture_resource->multisample_quality;
- if (surface->pitch)
- surface->resource.size = height * surface->pitch;
+ if (surface->resource.custom_row_pitch)
{
- surface->resource.size = height * surface->pitch;
+ surface->resource.size = height * surface->resource.custom_row_pitch;
}
else
surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
texture_resource->device->surface_alignment, width, height, 1);
@@ -2808,7 +2792,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
{
/* User memory surfaces don't have the regular surface alignment. */
- surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
- 1, width, height, 1);
- surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
+ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1);
+ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
+ surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */
}
/* The format might be changed to a format that needs conversion.
@@ -2814,7 +2798,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
else
@ -230,7 +241,7 @@ index 677f876..8fa36e4 100644
map_desc->slice_pitch = 0;
if (!rect)
@@ -2935,6 +2919,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2941,6 +2925,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
@ -238,7 +249,7 @@ index 677f876..8fa36e4 100644
surface_get_memory(surface, &data, dst_location);
@@ -2971,8 +2956,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2977,8 +2962,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
}
/* Setup pixel store pack state -- to glReadPixels into the correct place */
@ -249,7 +260,7 @@ index 677f876..8fa36e4 100644
checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
@@ -2989,7 +2974,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2995,7 +2980,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
@ -260,7 +271,7 @@ index 677f876..8fa36e4 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4220,7 +4207,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4226,7 +4213,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
struct wined3d_context *context;
@ -269,7 +280,7 @@ index 677f876..8fa36e4 100644
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -4308,7 +4295,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4314,7 +4301,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
@ -278,7 +289,7 @@ index 677f876..8fa36e4 100644
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -4347,9 +4334,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4353,9 +4340,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@ -290,7 +301,7 @@ index 677f876..8fa36e4 100644
data.addr = mem;
}
else if (conversion)
@@ -4369,14 +4356,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4375,14 +4362,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@ -309,10 +320,10 @@ index 677f876..8fa36e4 100644
context_release(context);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 675ca9e..b5f64ba 100644
index 6b2e266..de433f6 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1266,7 +1266,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
@@ -1279,7 +1279,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
struct wined3d_const_bo_address addr;
unsigned int row_pitch, slice_pitch;

View File

@ -1,4 +1,4 @@
From 1cc8df787d882d4c0a32c7c2f423c9935db5cf64 Mon Sep 17 00:00:00 2001
From 063ea3bd542ec568905d8788bf37e2a281be0c8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:33:48 +0200
Subject: wined3d: Send update_texture calls through the CS
@ -10,7 +10,7 @@ Subject: wined3d: Send update_texture calls through the CS
3 files changed, 97 insertions(+), 74 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 4834dd4..aeba50f 100644
index 62124a7..b41e364 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -72,6 +72,7 @@ enum wined3d_cs_op
@ -34,7 +34,7 @@ index 4834dd4..aeba50f 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -1888,6 +1895,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa
@@ -1891,6 +1898,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa
cs->ops->submit(cs, sizeof(*op));
}
@ -66,7 +66,7 @@ index 4834dd4..aeba50f 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -1938,6 +1970,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1941,6 +1973,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload,
@ -75,10 +75,10 @@ index 4834dd4..aeba50f 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index cbb1466..5333f23 100644
index 22ef49b..eb426ff 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3398,16 +3398,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3416,16 +3416,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
@ -98,7 +98,7 @@ index cbb1466..5333f23 100644
if (src_volume->resource.format != dst_volume->resource.format)
{
@@ -3425,8 +3424,6 @@ static HRESULT device_update_volume(struct wined3d_device *device,
@@ -3443,8 +3442,6 @@ static HRESULT device_update_volume(struct wined3d_device *device,
if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY)))
return hr;
@ -106,8 +106,8 @@ index cbb1466..5333f23 100644
-
/* Only a prepare, since we're uploading the entire volume. */
wined3d_texture_prepare_texture(dst_volume->container, context, FALSE);
@@ -3435,68 +3432,21 @@ static HRESULT device_update_volume(struct wined3d_device *device,
wined3d_texture_bind(dst_volume->container, context, FALSE);
@@ -3454,68 +3451,21 @@ static HRESULT device_update_volume(struct wined3d_device *device,
wined3d_volume_upload_data(dst_volume, context, &data);
wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
@ -182,7 +182,7 @@ index cbb1466..5333f23 100644
/* Update every surface level of the texture. */
switch (type)
@@ -3510,12 +3460,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3529,12 +3479,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
{
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -196,7 +196,7 @@ index cbb1466..5333f23 100644
}
break;
}
@@ -3529,12 +3474,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3548,12 +3493,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
{
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -210,7 +210,7 @@ index cbb1466..5333f23 100644
}
break;
}
@@ -3543,13 +3483,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3562,13 +3502,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
{
for (i = 0; i < level_count; ++i)
{
@ -227,7 +227,7 @@ index cbb1466..5333f23 100644
}
}
break;
@@ -3557,9 +3498,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3576,9 +3517,54 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
default:
FIXME("Unsupported texture type %#x.\n", type);
@ -284,10 +284,10 @@ index cbb1466..5333f23 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index a1518dd..656469a 100644
index 849f233..9c4cb9b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2074,6 +2074,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
@@ -2095,6 +2095,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
@ -296,7 +296,7 @@ index a1518dd..656469a 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2673,6 +2675,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac
@@ -2678,6 +2680,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac
const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@ -306,5 +306,5 @@ index a1518dd..656469a 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
1.9.1
2.3.0

View File

@ -1,4 +1,4 @@
From c2397e25c4bce8e65cddb924047ee0fff1c7a397 Mon Sep 17 00:00:00 2001
From 53122dd7633e0cd0d3c28240eec8f491c36e3da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 29 Aug 2013 22:25:14 +0200
Subject: wined3d: Don't lock the src volume in device_update_volume
@ -13,10 +13,10 @@ FIXME: Maybe merge this with the previous patch or change their order.
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5333f23..4a54025 100644
index eb426ff..75a47a1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3398,12 +3398,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3416,12 +3416,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
@ -31,7 +31,7 @@ index 5333f23..4a54025 100644
TRACE("src_volume %p, dst_volume %p.\n",
src_volume, dst_volume);
@@ -3411,30 +3409,21 @@ static HRESULT device_update_volume(struct wined3d_context *context,
@@ -3429,31 +3427,22 @@ static HRESULT device_update_volume(struct wined3d_context *context,
if (src_volume->resource.format != dst_volume->resource.format)
{
FIXME("Source and destination formats do not match.\n");
@ -52,6 +52,7 @@ index 5333f23..4a54025 100644
-
/* Only a prepare, since we're uploading the entire volume. */
wined3d_texture_prepare_texture(dst_volume->container, context, FALSE);
wined3d_texture_bind(dst_volume->container, context, FALSE);
-
- data.buffer_object = 0;
- data.addr = src.data;
@ -66,7 +67,7 @@ index 5333f23..4a54025 100644
}
/* Context activation is done by the caller */
@@ -3483,15 +3472,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_
@@ -3502,15 +3491,9 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_
{
for (i = 0; i < level_count; ++i)
{
@ -84,5 +85,5 @@ index 5333f23..4a54025 100644
break;
}
--
2.2.1
2.3.0

File diff suppressed because it is too large Load Diff