Rebase against 3f50319ec384730360d16dd79d703adafaa953fc.

This commit is contained in:
Sebastian Lackner 2017-03-07 02:12:41 +01:00
parent 3b947eae95
commit 37b0772439
19 changed files with 723 additions and 1726 deletions

View File

@ -1,4 +1,4 @@
From 1696ec4c67d39495d63673137e25d11878c44c8c Mon Sep 17 00:00:00 2001
From e2c6e94c6dd1312f467e5528fa2767b7da6eaca4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 15 Jan 2016 13:23:02 +0100
Subject: kernel32: Add stub for GetCurrentPackageFamilyName and add related
@ -6,12 +6,12 @@ Subject: kernel32: Add stub for GetCurrentPackageFamilyName and add related
---
.../api-ms-win-appmodel-runtime-l1-1-1.spec | 2 +-
dlls/kernel32/kernel32.spec | 35 ++++++++++++++++++++++
dlls/kernel32/kernel32.spec | 34 ++++++++++++++++++++++
dlls/kernel32/version.c | 9 ++++++
3 files changed, 45 insertions(+), 1 deletion(-)
3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec b/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
index 1eb8327..af7774d 100644
index 2c5cf9e5bda..50f8594785f 100644
--- a/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
+++ b/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
@@ -3,7 +3,7 @@
@ -20,11 +20,11 @@ index 1eb8327..af7774d 100644
@ stub GetCurrentApplicationUserModelId
-@ stub GetCurrentPackageFamilyName
+@ stdcall GetCurrentPackageFamilyName(ptr ptr) kernel32.GetCurrentPackageFamilyName
@ stub GetCurrentPackageFullName
@ stdcall GetCurrentPackageFullName(ptr ptr) kernel32.GetCurrentPackageFullName
@ stdcall GetCurrentPackageId(ptr ptr) kernel32.GetCurrentPackageId
@ stub GetCurrentPackageInfo
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 3c25286..3c1cb23 100644
index 59e39a74917..e01e8605d53 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -225,6 +225,7 @@
@ -60,7 +60,7 @@ index 3c25286..3c1cb23 100644
@ stdcall GetAtomNameA(long ptr long)
@ stdcall GetAtomNameW(long ptr long)
@ stdcall GetBinaryType(str ptr) GetBinaryTypeA
@@ -624,11 +629,16 @@
@@ -624,12 +629,16 @@
# @ stub GetCurrencyFormatEx
@ stdcall GetCurrencyFormatW(long long str ptr str long)
@ stdcall GetCurrentActCtx(ptr)
@ -70,14 +70,14 @@ index 3c25286..3c1cb23 100644
@ stdcall GetCurrentDirectoryA(long ptr)
@ stdcall GetCurrentDirectoryW(long ptr)
+@ stdcall GetCurrentPackageFamilyName(ptr ptr)
+@ stub GetCurrentPackageFullName
@ stdcall GetCurrentPackageId(ptr ptr)
@ stdcall GetCurrentPackageFullName(ptr ptr)
+@ stub GetCurrentPackageInfo
+@ stub GetCurrentPackagePath
@ stdcall -norelay GetCurrentProcess()
@ stdcall -norelay GetCurrentProcessId()
@ stdcall GetCurrentProcessorNumber() ntdll.NtGetCurrentProcessorNumber
@@ -759,6 +769,16 @@
@@ -760,6 +769,16 @@
@ stdcall GetOEMCP()
@ stdcall GetOverlappedResult(long ptr ptr long)
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr)
@ -94,7 +94,7 @@ index 3c25286..3c1cb23 100644
@ stdcall GetPhysicallyInstalledSystemMemory(ptr)
@ stdcall GetPriorityClass(long)
@ stdcall GetPrivateProfileIntA(str str long str)
@@ -805,6 +825,8 @@
@@ -806,6 +825,8 @@
@ stub -i386 GetSLCallbackTemplate
@ stdcall GetShortPathNameA(str ptr long)
@ stdcall GetShortPathNameW(wstr ptr long)
@ -103,7 +103,7 @@ index 3c25286..3c1cb23 100644
@ stdcall GetStartupInfoA(ptr)
@ stdcall GetStartupInfoW(ptr)
@ stdcall GetStdHandle(long)
@@ -1118,6 +1140,8 @@
@@ -1119,6 +1140,8 @@
@ stdcall OpenJobObjectW(long long wstr)
@ stdcall OpenMutexA(long long str)
@ stdcall OpenMutexW(long long wstr)
@ -112,7 +112,7 @@ index 3c25286..3c1cb23 100644
# @ stub OpenPrivateNamespaceA
# @ stub OpenPrivateNamespaceW
@ stdcall OpenProcess(long long long)
@@ -1132,6 +1156,12 @@
@@ -1133,6 +1156,12 @@
@ stdcall OpenWaitableTimerW(long long wstr)
@ stdcall OutputDebugStringA(str)
@ stdcall OutputDebugStringW(wstr)
@ -125,7 +125,7 @@ index 3c25286..3c1cb23 100644
@ stdcall PeekConsoleInputA(ptr ptr long ptr)
@ stdcall PeekConsoleInputW(ptr ptr long ptr)
@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr)
@@ -1548,7 +1578,12 @@
@@ -1549,7 +1578,12 @@
@ stdcall VerLanguageNameA(long str long)
@ stdcall VerLanguageNameW(long wstr long)
@ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask
@ -139,11 +139,11 @@ index 3c25286..3c1cb23 100644
@ stdcall VerifyVersionInfoA(long long int64)
@ stdcall VerifyVersionInfoW(long long int64)
diff --git a/dlls/kernel32/version.c b/dlls/kernel32/version.c
index b9d13e4..53f594e 100644
index cf783af6195..aabc9bc2c64 100644
--- a/dlls/kernel32/version.c
+++ b/dlls/kernel32/version.c
@@ -207,3 +207,12 @@ LONG WINAPI GetCurrentPackageId(UINT32 *len, BYTE *buffer)
FIXME("(%p %p): stub\n", len, buffer);
@@ -216,3 +216,12 @@ LONG WINAPI GetCurrentPackageFullName(UINT32 *length, PWSTR name)
FIXME("(%p %p): stub\n", length, name);
return APPMODEL_ERROR_NO_PACKAGE;
}
+
@ -156,5 +156,5 @@ index b9d13e4..53f594e 100644
+ return APPMODEL_ERROR_NO_PACKAGE;
+}
--
2.9.0
2.11.0

View File

@ -1,60 +0,0 @@
From bcbbde0daf2dd0fed6f41a455dae61b2aac6e376 Mon Sep 17 00:00:00 2001
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Date: Sat, 4 Mar 2017 11:05:52 +0100
Subject: kernel32: add stub for GetCurrentPackageFullName
See bug https://bugs.winehq.org/show_bug.cgi?id=42586
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
---
.../api-ms-win-appmodel-runtime-l1-1-1.spec | 2 +-
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/version.c | 9 +++++++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec b/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
index af7774d3679..50f8594785f 100644
--- a/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
+++ b/dlls/api-ms-win-appmodel-runtime-l1-1-1/api-ms-win-appmodel-runtime-l1-1-1.spec
@@ -4,7 +4,7 @@
@ stub GetApplicationUserModelId
@ stub GetCurrentApplicationUserModelId
@ stdcall GetCurrentPackageFamilyName(ptr ptr) kernel32.GetCurrentPackageFamilyName
-@ stub GetCurrentPackageFullName
+@ stdcall GetCurrentPackageFullName(ptr ptr) kernel32.GetCurrentPackageFullName
@ stdcall GetCurrentPackageId(ptr ptr) kernel32.GetCurrentPackageId
@ stub GetCurrentPackageInfo
@ stub GetCurrentPackagePath
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index be514a32371..c240d1fb9ea 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -635,7 +635,7 @@
@ stdcall GetCurrentDirectoryA(long ptr)
@ stdcall GetCurrentDirectoryW(long ptr)
@ stdcall GetCurrentPackageFamilyName(ptr ptr)
-@ stub GetCurrentPackageFullName
+@ stdcall GetCurrentPackageFullName(ptr ptr)
@ stdcall GetCurrentPackageId(ptr ptr)
@ stub GetCurrentPackageInfo
@ stub GetCurrentPackagePath
diff --git a/dlls/kernel32/version.c b/dlls/kernel32/version.c
index 53f594eccab..ddaccacbaa7 100644
--- a/dlls/kernel32/version.c
+++ b/dlls/kernel32/version.c
@@ -216,3 +216,12 @@ LONG WINAPI GetCurrentPackageFamilyName(UINT32 *length, PWSTR name)
FIXME("(%p %p): stub\n", length, name);
return APPMODEL_ERROR_NO_PACKAGE;
}
+
+/***********************************************************************
+ * GetCurrentPackageFullName (KERNEL32.@)
+ */
+LONG WINAPI GetCurrentPackageFullName(UINT32 *length, PWSTR name)
+{
+ FIXME("(%p %p): stub\n", length, name);
+ return APPMODEL_ERROR_NO_PACKAGE;
+}
--
2.11.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "a2460b2424163bbf5b885db6a5423c3d98f883e0"
echo "3f50319ec384730360d16dd79d703adafaa953fc"
}
# Show version information
@ -2744,10 +2744,8 @@ fi
# |
if test "$enable_kernel32_GetCurrentPackageFamilyName" -eq 1; then
patch_apply kernel32-GetCurrentPackageFamilyName/0001-kernel32-Add-stub-for-GetCurrentPackageFamilyName-an.patch
patch_apply kernel32-GetCurrentPackageFamilyName/0002-kernel32-add-stub-for-GetCurrentPackageFullName.patch
(
printf '%s\n' '+ { "Michael Müller", "kernel32: Add stub for GetCurrentPackageFamilyName and add related functions to spec file.", 1 },';
printf '%s\n' '+ { "Louis Lenders", "kernel32: Add stub for GetCurrentPackageFullName.", 1 },';
) >> "$patchlist"
fi
@ -8436,7 +8434,7 @@ fi
# Patchset wined3d-Revert_Buffer_Upload
# |
# | Modified files:
# | * dlls/wined3d/buffer.c, dlls/wined3d/device.c, dlls/wined3d/wined3d_private.h
# | * dlls/wined3d/buffer.c, dlls/wined3d/cs.c, dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_Revert_Buffer_Upload" -eq 1; then
patch_apply wined3d-Revert_Buffer_Upload/0001-Revert-wined3d-Implement-wined3d_buffer_upload_data-.patch
@ -8593,18 +8591,15 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send query_poll through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },';
printf '%s\n' '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer update subresource requests through CS.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer copy requests through CS.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add a separate variable to check if queries are started.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Map vertex buffers through cs.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add swapchain waits.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },';

View File

@ -1,4 +1,4 @@
From 736b314e18e7e4d3c7dc7732e2e38c6b8de7ddfd Mon Sep 17 00:00:00 2001
From 227c20d336bca247834d85e6ddb6002680d3d700 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Aug 2016 22:25:20 +0200
Subject: wined3d: Implement uploading for 1d textures.
@ -9,24 +9,24 @@ Subject: wined3d: Implement uploading for 1d textures.
2 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 150f18f..c87b325 100644
index bd08c352794..53ada28b11b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4140,7 +4140,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
return;
@@ -4055,7 +4055,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
height = 1;
depth = 1;
}
- if (resource->type != WINED3D_RTYPE_TEXTURE_2D && resource->type != WINED3D_RTYPE_TEXTURE_3D)
+ if (resource->type != WINED3D_RTYPE_TEXTURE_1D &&
+ resource->type != WINED3D_RTYPE_TEXTURE_2D && resource->type != WINED3D_RTYPE_TEXTURE_3D)
- else if (resource->type == WINED3D_RTYPE_TEXTURE_2D || resource->type == WINED3D_RTYPE_TEXTURE_3D)
+ else if (resource->type == WINED3D_RTYPE_TEXTURE_1D ||
+ resource->type == WINED3D_RTYPE_TEXTURE_2D || resource->type == WINED3D_RTYPE_TEXTURE_3D)
{
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type));
return;
struct wined3d_texture *texture = texture_from_resource(resource);
unsigned int level;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 2b66b68..614b4cf 100644
index 296ca898f81..a3f90773904 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1456,8 +1456,74 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
@@ -1581,8 +1581,74 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
const struct wined3d_context *context, const struct wined3d_box *box, const struct wined3d_const_bo_address *data,
unsigned int row_pitch, unsigned int slice_pitch)
{
@ -103,5 +103,5 @@ index 2b66b68..614b4cf 100644
/* Context activation is done by the caller. */
--
2.9.0
2.11.0

View File

@ -1,18 +1,18 @@
From cc2cafc81cc50bcd93c20b887838dd663c190ef7 Mon Sep 17 00:00:00 2001
From 94dd5e43f248b35ad24938fbf7422fd455f5185d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 00:57:12 +0100
Subject: wined3d: Add additional synchronization CS ops.
---
dlls/wined3d/cs.c | 51 ++++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/cs.c | 53 +++++++++++++++++++++++++++++++++++++++---
dlls/wined3d/device.c | 2 ++
dlls/wined3d/swapchain.c | 2 ++
dlls/wined3d/view.c | 6 +++++
dlls/wined3d/wined3d_private.h | 3 +++
5 files changed, 62 insertions(+), 2 deletions(-)
5 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 8afa7313a02..b27a083007b 100644
index 39071faef32..543528ae570 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -24,8 +24,8 @@ index 8afa7313a02..b27a083007b 100644
WINED3D_CS_OP_PRESENT,
WINED3D_CS_OP_CLEAR,
WINED3D_CS_OP_DISPATCH,
@@ -65,6 +67,16 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP,
@@ -66,6 +68,16 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
};
+struct wined3d_cs_sync
@ -41,8 +41,8 @@ index 8afa7313a02..b27a083007b 100644
struct wined3d_cs_present
{
enum wined3d_cs_op opcode;
@@ -344,6 +356,38 @@ struct wined3d_cs_unmap
HRESULT *hr;
@@ -354,6 +366,38 @@ struct wined3d_cs_update_sub_resource
struct wined3d_sub_resource_data data;
};
+static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
@ -80,7 +80,7 @@ index 8afa7313a02..b27a083007b 100644
static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_present *op = data;
@@ -1618,7 +1662,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1628,7 +1672,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
op->flags = flags;
op->hr = &hr;
@ -89,7 +89,7 @@ index 8afa7313a02..b27a083007b 100644
return hr;
}
@@ -1642,13 +1686,15 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1652,7 +1696,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
op->sub_resource_idx = sub_resource_idx;
op->hr = &hr;
@ -98,6 +98,13 @@ index 8afa7313a02..b27a083007b 100644
return hr;
}
@@ -1726,11 +1770,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
wined3d_resource_acquire(resource);
- cs->ops->submit(cs);
+ cs->ops->submit_and_wait(cs);
}
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
@ -106,7 +113,7 @@ index 8afa7313a02..b27a083007b 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch,
@@ -1779,6 +1825,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1862,6 +1908,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
{
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
@ -115,7 +122,7 @@ index 8afa7313a02..b27a083007b 100644
};
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e812567b067..be6d784bddf 100644
index 0baf7f1b7cc..ea27553e8c8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1008,6 +1008,7 @@ static void wined3d_device_delete_opengl_contexts_cs(void *object)
@ -155,10 +162,10 @@ index 25deaeb1ae9..bd23999fb1e 100644
if (!swapchain->context[0])
{
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 02964e4a96b..21aa8720e65 100644
index 3cd20ea8fad..9b9e7eef4c6 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -598,6 +598,8 @@ static void wined3d_shader_resource_view_cs_init(void *object)
@@ -594,6 +594,8 @@ static void wined3d_shader_resource_view_cs_init(void *object)
debug_d3dformat(resource->format->id), debug_d3dformat(view_format->id));
}
}
@ -167,7 +174,7 @@ index 02964e4a96b..21aa8720e65 100644
}
static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_view *view,
@@ -614,6 +616,7 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_
@@ -610,6 +612,7 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_
wined3d_resource_incref(view->resource = resource);
@ -175,7 +182,7 @@ index 02964e4a96b..21aa8720e65 100644
wined3d_cs_init_object(resource->device->cs, wined3d_shader_resource_view_cs_init, view);
return WINED3D_OK;
@@ -760,6 +763,8 @@ static void wined3d_unordered_access_view_cs_init(void *object)
@@ -786,6 +789,8 @@ static void wined3d_unordered_access_view_cs_init(void *object)
desc, texture, view->format);
}
}
@ -184,7 +191,7 @@ index 02964e4a96b..21aa8720e65 100644
}
static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_access_view *view,
@@ -776,6 +781,7 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces
@@ -805,6 +810,7 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces
wined3d_resource_incref(view->resource = resource);
@ -193,10 +200,10 @@ index 02964e4a96b..21aa8720e65 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d45e19b0224..d0385a5e90a 100644
index e8d771ecb32..d2e0052067f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3193,6 +3193,7 @@ struct wined3d_cs_ops
@@ -3198,6 +3198,7 @@ struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
void (*submit)(struct wined3d_cs *cs);
@ -204,7 +211,7 @@ index d45e19b0224..d0385a5e90a 100644
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants);
};
@@ -3219,6 +3220,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -3224,6 +3225,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
@ -212,14 +219,14 @@ index d45e19b0224..d0385a5e90a 100644
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
@@ -3270,6 +3272,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3275,6 +3277,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_sync(struct wined3d_cs *cs);
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_init_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
--
2.11.0

View File

@ -1,4 +1,4 @@
From e565d8dfb0453633c53c6a74f5f204e99231729a Mon Sep 17 00:00:00 2001
From ec1172f3bd0ba8c66347ed17edf086c850665f24 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 6 Feb 2017 05:50:11 +0100
Subject: wined3d: Send push_constants through the CS.
@ -10,19 +10,19 @@ Subject: wined3d: Send push_constants through the CS.
3 files changed, 77 insertions(+), 58 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 990cb6735d7..4612244ce0c 100644
index 543528ae570..72c0ace384c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -63,6 +63,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNLOAD_RESOURCE,
@@ -66,6 +66,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_MAP,
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
+ WINED3D_CS_OP_PUSH_CONSTANTS,
};
struct wined3d_cs_sync
@@ -340,6 +341,15 @@ struct wined3d_cs_unmap
HRESULT *hr;
@@ -366,6 +367,15 @@ struct wined3d_cs_update_sub_resource
struct wined3d_sub_resource_data data;
};
+struct wined3d_cs_push_constants
@ -37,8 +37,8 @@ index 990cb6735d7..4612244ce0c 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1579,6 +1589,64 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
return hr;
@@ -1773,6 +1783,64 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->submit_and_wait(cs);
}
+static const struct
@ -102,15 +102,15 @@ index 990cb6735d7..4612244ce0c 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1618,6 +1686,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
@@ -1815,6 +1883,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map,
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
+ /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1664,55 +1733,11 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs)
@@ -1861,55 +1930,11 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs)
HeapFree(GetProcessHeap(), 0, data);
}
@ -167,10 +167,10 @@ index 990cb6735d7..4612244ce0c 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b449225d2e9..5e17ba185de 100644
index ea27553e8c8..a06cae6412e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2347,7 +2347,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
@@ -2337,7 +2337,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
}
else
{
@ -179,7 +179,7 @@ index b449225d2e9..5e17ba185de 100644
}
return WINED3D_OK;
@@ -2396,7 +2396,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
@@ -2386,7 +2386,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
}
else
{
@ -188,7 +188,7 @@ index b449225d2e9..5e17ba185de 100644
}
return WINED3D_OK;
@@ -2441,7 +2441,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
@@ -2431,7 +2431,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.vs_consts_f[start_idx], 1,
count * sizeof(*device->recording->changed.vs_consts_f));
else
@ -197,7 +197,7 @@ index b449225d2e9..5e17ba185de 100644
return WINED3D_OK;
}
@@ -2580,7 +2580,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,
@@ -2570,7 +2570,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,
}
else
{
@ -206,7 +206,7 @@ index b449225d2e9..5e17ba185de 100644
}
return WINED3D_OK;
@@ -2629,7 +2629,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
@@ -2619,7 +2619,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
}
else
{
@ -215,7 +215,7 @@ index b449225d2e9..5e17ba185de 100644
}
return WINED3D_OK;
@@ -2675,7 +2675,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device,
@@ -2665,7 +2665,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.ps_consts_f[start_idx], 1,
count * sizeof(*device->recording->changed.ps_consts_f));
else
@ -225,10 +225,10 @@ index b449225d2e9..5e17ba185de 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 46ca81b4e77..df05dcb8fc8 100644
index d2e0052067f..2a8f075667a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3169,8 +3169,6 @@ struct wined3d_cs_ops
@@ -3199,8 +3199,6 @@ struct wined3d_cs_ops
void *(*require_space)(struct wined3d_cs *cs, size_t size);
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);
@ -237,7 +237,7 @@ index 46ca81b4e77..df05dcb8fc8 100644
};
struct wined3d_cs
@@ -3198,6 +3196,8 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
@@ -3229,6 +3227,8 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
@ -246,7 +246,7 @@ index 46ca81b4e77..df05dcb8fc8 100644
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx,
@@ -3253,12 +3253,6 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -3289,12 +3289,6 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From c300fbe493da45c4767a7ebe73f9854a9a1101e8 Mon Sep 17 00:00:00 2001
From a34bdbe6dd81562c6bad79e3c1662dd17333c447 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@ -6,25 +6,24 @@ Subject: wined3d: Send blits through the command stream.
This needs more work. This patch breaks error handling, and the split
between surface_blt and surface_blt_ugly isn't particularly nice.
---
dlls/wined3d/cs.c | 52 +++++++++
dlls/wined3d/device.c | 26 +++++
dlls/wined3d/surface.c | 240 ++++++++++++++++++++++++-----------------
dlls/wined3d/cs.c | 52 +++++++++++
dlls/wined3d/surface.c | 208 +++++++++++++++++++++++++----------------
dlls/wined3d/wined3d_private.h | 7 ++
4 files changed, 228 insertions(+), 97 deletions(-)
3 files changed, 188 insertions(+), 79 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ee3d9a79da0..1517df9da95 100644
index 1366973c1e6..f2eb87e35b8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -66,6 +66,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_MAP,
@@ -67,6 +67,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_PUSH_CONSTANTS,
+ WINED3D_CS_OP_BLT,
};
struct wined3d_cs_sync
@@ -366,6 +367,18 @@ struct wined3d_cs_push_constants
@@ -376,6 +377,18 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
@ -43,7 +42,7 @@ index ee3d9a79da0..1517df9da95 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1776,6 +1789,44 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -1857,6 +1870,44 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -88,70 +87,19 @@ index ee3d9a79da0..1517df9da95 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1818,6 +1869,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map,
@@ -1900,6 +1951,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
+ /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 01f7f1b6d84..7644e2aa250 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4027,6 +4027,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
struct wined3d_texture *dst_texture, *src_texture;
RECT dst_rect, src_rect;
HRESULT hr;
+ struct wined3d_box dst_box;
TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
"src_resource %p, src_sub_resource_idx %u, src_box %s.\n",
@@ -4114,6 +4115,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
+ if ((src_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ && !wined3d_texture_check_block_align(src_texture,
+ src_sub_resource_idx % src_texture->level_count, src_box))
+ {
+ WARN("Source box not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4127,6 +4136,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left),
dst_y + (src_rect.bottom - src_rect.top));
+ if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ {
+ dst_box.left = dst_rect.left;
+ dst_box.top = dst_rect.top;
+ dst_box.front = 0;
+ dst_box.right = dst_rect.right;
+ dst_box.bottom = dst_rect.bottom;
+ dst_box.back = 1;
+
+ if(!wined3d_texture_check_block_align(dst_texture,
+ dst_sub_resource_idx % dst_texture->level_count, &dst_box))
+ {
+ WARN("Destination box not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+ }
+
if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect,
src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 347a8097484..c0b34e20b83 100644
index 0dffdfa30f2..47ef3759b3e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3772,7 +3772,7 @@ const struct blit_shader cpu_blit = {
@@ -3737,7 +3737,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@ -160,19 +108,21 @@ index 347a8097484..c0b34e20b83 100644
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
@@ -3782,9 +3782,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3747,11 +3747,10 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
- struct wined3d_texture *src_texture = NULL;
- unsigned int dst_w, dst_h, src_w, src_h;
- unsigned int src_sub_resource_idx = 0;
+ struct wined3d_texture *src_texture;
+ unsigned int src_sub_resource_idx;
DWORD src_ds_flags, dst_ds_flags;
BOOL scale, convert;
- HRESULT hr;
@@ -3797,84 +3796,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
static const DWORD simple_blit = WINED3D_BLT_ASYNC
| WINED3D_BLT_COLOR_FILL
@@ -3762,66 +3761,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
| WINED3D_BLT_DO_NOT_WAIT
| WINED3D_BLT_ALPHA_TEST;
@ -207,30 +157,12 @@ index 347a8097484..c0b34e20b83 100644
- return WINEDDERR_SURFACEBUSY;
- }
-
- dst_w = wined3d_texture_get_level_width(dst_texture, dst_surface->texture_level);
- dst_h = wined3d_texture_get_level_height(dst_texture, dst_surface->texture_level);
- if (IsRectEmpty(dst_rect) || dst_rect->left > dst_w || dst_rect->left < 0
- || dst_rect->top > dst_h || dst_rect->top < 0
- || dst_rect->right > dst_w || dst_rect->right < 0
- || dst_rect->bottom > dst_h || dst_rect->bottom < 0)
- {
- WARN("The application gave us a bad destination rectangle.\n");
- return WINEDDERR_INVALIDRECT;
- }
- if (FAILED(hr = wined3d_texture_check_box_dimensions(dst_texture, dst_surface->texture_level, &dst_box)))
- return hr;
-
- if (src_texture)
- {
- src_w = wined3d_texture_get_level_width(src_texture, src_surface->texture_level);
- src_h = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
- if (IsRectEmpty(src_rect) || src_rect->left > src_w || src_rect->left < 0
- || src_rect->top > src_h || src_rect->top < 0
- || src_rect->right > src_w || src_rect->right < 0
- || src_rect->bottom > src_h || src_rect->bottom < 0)
- {
- WARN("The application gave us a bad source rectangle.\n");
- return WINEDDERR_INVALIDRECT;
- }
- }
- if (src_texture && FAILED(hr = wined3d_texture_check_box_dimensions(src_texture,
- src_surface->texture_level, &src_box)))
- return hr;
-
- if (!fx || !(fx->fx))
- flags &= ~WINED3D_BLT_FX;
@ -262,7 +194,7 @@ index 347a8097484..c0b34e20b83 100644
}
if (!device->d3d_initialized)
@@ -3899,11 +3831,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3846,11 +3796,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
}
@ -274,7 +206,7 @@ index 347a8097484..c0b34e20b83 100644
dst_swapchain = dst_texture->swapchain;
/* This isn't strictly needed. FBO blits for example could deal with
@@ -3939,22 +3866,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3886,22 +3831,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
TRACE("Depth fill.\n");
if (!wined3d_format_convert_color_to_float(dst_texture->resource.format, NULL, fx->fill_color, &color))
@ -300,7 +232,7 @@ index 347a8097484..c0b34e20b83 100644
}
}
else
@@ -3990,7 +3911,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3937,7 +3876,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color)))
@ -309,7 +241,7 @@ index 347a8097484..c0b34e20b83 100644
}
else
{
@@ -4034,7 +3955,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3981,7 +3920,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context, dst_texture->resource.draw_binding);
context_release(context);
}
@ -318,7 +250,7 @@ index 347a8097484..c0b34e20b83 100644
}
}
}
@@ -4058,7 +3979,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4005,7 +3944,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -327,7 +259,7 @@ index 347a8097484..c0b34e20b83 100644
}
if (fbo_blit_supported(&device->adapter->gl_info, blit_op,
@@ -4079,7 +4000,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4026,7 +3965,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
~dst_texture->resource.draw_binding);
@ -336,7 +268,7 @@ index 347a8097484..c0b34e20b83 100644
}
blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
@@ -4089,7 +4010,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4036,7 +3975,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
{
blitter->blit_surface(device, blit_op, filter, src_surface,
src_rect, dst_surface, dst_rect, color_key);
@ -345,7 +277,7 @@ index 347a8097484..c0b34e20b83 100644
}
}
}
@@ -4097,9 +4018,134 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4044,9 +3983,120 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
fallback:
/* Special cases for render targets. */
if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter)))
@ -362,14 +294,17 @@ index 347a8097484..c0b34e20b83 100644
+ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
+ const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
+{
+ struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1};
+ struct wined3d_box src_box = {src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1};
+ struct wined3d_texture *dst_texture = dst_surface->container;
+ struct wined3d_texture *src_texture = NULL;
+ struct wined3d_device *device = dst_texture->resource.device;
+ unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface), src_sub_resource_idx;
+ struct wined3d_texture_sub_resource *dst_sub_resource =
+ &dst_texture->sub_resources[dst_sub_resource_idx];
+ struct wined3d_texture_sub_resource *src_sub_resource = NULL;
+ unsigned int dst_w, dst_h, src_w, src_h;
+ DWORD src_ds_flags, dst_ds_flags;
+ HRESULT hr;
+
+ TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
+ dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
@ -390,6 +325,7 @@ index 347a8097484..c0b34e20b83 100644
+
+ if (src_surface)
+ {
+ src_texture = src_surface->container;
+ src_sub_resource_idx = surface_get_sub_resource_idx(src_surface);
+ src_sub_resource = &src_surface->container->sub_resources[src_sub_resource_idx];
+ }
@ -404,30 +340,12 @@ index 347a8097484..c0b34e20b83 100644
+ }
+ }
+
+ dst_w = wined3d_texture_get_level_width(dst_texture, dst_surface->texture_level);
+ dst_h = wined3d_texture_get_level_height(dst_texture, dst_surface->texture_level);
+ if (IsRectEmpty(dst_rect) || dst_rect->left > dst_w || dst_rect->left < 0
+ || dst_rect->top > dst_h || dst_rect->top < 0
+ || dst_rect->right > dst_w || dst_rect->right < 0
+ || dst_rect->bottom > dst_h || dst_rect->bottom < 0)
+ {
+ WARN("The application gave us a bad destination rectangle.\n");
+ return WINEDDERR_INVALIDRECT;
+ }
+ if (FAILED(hr = wined3d_texture_check_box_dimensions(dst_texture, dst_surface->texture_level, &dst_box)))
+ return hr;
+
+ if (src_surface)
+ {
+ src_w = wined3d_texture_get_level_width(src_surface->container, src_surface->texture_level);
+ src_h = wined3d_texture_get_level_height(src_surface->container, src_surface->texture_level);
+ if (IsRectEmpty(src_rect) || src_rect->left > src_w || src_rect->left < 0
+ || src_rect->top > src_h || src_rect->top < 0
+ || src_rect->right > src_w || src_rect->right < 0
+ || src_rect->bottom > src_h || src_rect->bottom < 0)
+ {
+ WARN("The application gave us a bad source rectangle.\n");
+ return WINEDDERR_INVALIDRECT;
+ }
+ }
+ if (src_texture && FAILED(hr = wined3d_texture_check_box_dimensions(src_texture,
+ src_surface->texture_level, &src_box)))
+ return hr;
+
+ dst_ds_flags = dst_texture->resource.format_flags
+ & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
@ -483,10 +401,10 @@ index 347a8097484..c0b34e20b83 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c62c64e7d3d..62f9c484287 100644
index a3716e937a5..1c3ba4644f1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3048,6 +3048,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3067,6 +3067,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@ -496,7 +414,7 @@ index c62c64e7d3d..62f9c484287 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -3199,6 +3202,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
@@ -3218,6 +3221,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 71236080e419dcf33176b5f8f54bbaf2dbefb630 Mon Sep 17 00:00:00 2001
From da8e396548580773fb77f92c866163693dd576e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 21:10:16 +0200
Subject: wined3d: Send render target view clears through the command stream
@ -24,18 +24,18 @@ index 8e5be756654..88e0e44c4d3 100644
* supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET
* when created as texture. */
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1517df9da95..ebc4e4f15e5 100644
index f2eb87e35b8..c38bbbd2754 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,6 +67,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP,
@@ -68,6 +68,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_BLT,
+ WINED3D_CS_OP_CLEAR_RTV,
};
struct wined3d_cs_sync
@@ -379,6 +380,18 @@ struct wined3d_cs_blt
@@ -389,6 +390,18 @@ struct wined3d_cs_blt
enum wined3d_texture_filter_type filter;
};
@ -54,7 +54,7 @@ index 1517df9da95..ebc4e4f15e5 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1827,6 +1840,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1908,6 +1921,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
cs->ops->submit(cs);
}
@ -96,8 +96,8 @@ index 1517df9da95..ebc4e4f15e5 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1870,6 +1918,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
@@ -1952,6 +2000,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
+ /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
@ -105,10 +105,10 @@ index 1517df9da95..ebc4e4f15e5 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7644e2aa250..35c57ff7b94 100644
index a06cae6412e..0e491b3b8cd 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4283,10 +4283,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4246,10 +4246,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
return WINED3DERR_INVALIDCALL;
}
@ -122,10 +122,10 @@ index 7644e2aa250..35c57ff7b94 100644
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 62f9c484287..334cdf0fb8b 100644
index 1c3ba4644f1..6fbfa5d9c9c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3208,6 +3208,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3227,6 +3227,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 91f8e688a10e60bf4240ec172bc4a56d6c2f59d9 Mon Sep 17 00:00:00 2001
From ae3267b2c9b77715d189c233472c870a0f55d41b 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
@ -11,10 +11,10 @@ FIXME: This logic duplication is ugly.
3 files changed, 141 insertions(+), 75 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ebc4e4f15e5..461ef30f17a 100644
index c38bbbd2754..47678602fed 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,7 @@ enum wined3d_cs_op
@@ -69,6 +69,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
@ -22,7 +22,7 @@ index ebc4e4f15e5..461ef30f17a 100644
};
struct wined3d_cs_sync
@@ -392,6 +393,12 @@ struct wined3d_cs_clear_rtv
@@ -402,6 +403,12 @@ struct wined3d_cs_clear_rtv
const struct blit_shader *blitter;
};
@ -35,7 +35,7 @@ index ebc4e4f15e5..461ef30f17a 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1875,6 +1882,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1956,6 +1963,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs);
}
@ -71,7 +71,7 @@ index ebc4e4f15e5..461ef30f17a 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1919,6 +1955,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2001,6 +2037,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
@ -80,7 +80,7 @@ index ebc4e4f15e5..461ef30f17a 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 72cf63af27f..8f7640cadc2 100644
index 2fdfd944b7e..d244091782f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3627,34 +3627,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@ -316,10 +316,10 @@ index 72cf63af27f..8f7640cadc2 100644
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 334cdf0fb8b..81bcadc927f 100644
index 6fbfa5d9c9c..5b68475945d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2683,6 +2683,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2702,6 +2702,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
@ -328,10 +328,10 @@ index 334cdf0fb8b..81bcadc927f 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3272,6 +3274,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void wined3d_cs_emit_sync(struct wined3d_cs *cs);
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@@ -3294,6 +3296,8 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, 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) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
+ struct wined3d_texture *dst) DECLSPEC_HIDDEN;
void wined3d_cs_init_object(struct wined3d_cs *cs,

View File

@ -1,190 +0,0 @@
From 816ad331869dde6ef0c3326e010ef672e55e8b9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 4 Sep 2015 15:22:49 +0200
Subject: wined3d: Send update_sub_resource calls through the command stream.
---
dlls/wined3d/cs.c | 67 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 22 +-------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/wined3d_private.h | 5 ++++
4 files changed, 74 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 6ffdd920403..ac9e09345dd 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
WINED3D_CS_OP_UPDATE_TEXTURE,
+ WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
};
struct wined3d_cs_sync
@@ -405,6 +406,15 @@ struct wined3d_cs_update_texture
struct wined3d_texture *src, *dst;
};
+struct wined3d_cs_update_sub_resource
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_resource *resource;
+ unsigned int sub_resource_idx, row_pitch, depth_pitch;
+ const struct wined3d_box *box;
+ const void *data;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1928,6 +1938,62 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_update_sub_resource *op = data;
+ struct wined3d_const_bo_address addr;
+ struct wined3d_context *context;
+ struct wined3d_texture *texture;
+ unsigned int width, height, depth, level;
+
+ texture = wined3d_texture_from_resource(op->resource);
+
+ level = op->sub_resource_idx % texture->level_count;
+ width = wined3d_texture_get_level_width(texture, level);
+ height = wined3d_texture_get_level_height(texture, level);
+ depth = wined3d_texture_get_level_depth(texture, level);
+
+ addr.buffer_object = 0;
+ addr.addr = op->data;
+
+ context = context_acquire(texture->resource.device, NULL, 0);
+
+ /* Only load the sub-resource for partial updates. */
+ if (!op->box || (!op->box->left && !op->box->top && !op->box->front
+ && op->box->right == width && op->box->bottom == height && op->box->back == depth))
+ wined3d_texture_prepare_texture(texture, context, FALSE);
+ else
+ wined3d_texture_load_location(texture, op->sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_texture_bind_and_dirtify(texture, context, FALSE);
+
+ wined3d_texture_upload_data(texture, op->sub_resource_idx, context, op->box, &addr, op->row_pitch, op->depth_pitch);
+
+ context_release(context);
+
+ wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
+}
+
+void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
+ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
+ unsigned int depth_pitch)
+{
+ struct wined3d_cs_update_sub_resource *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
+ op->resource = resource;
+ op->sub_resource_idx = sub_resource_idx;
+ op->box = box;
+ op->data = data;
+ op->row_pitch = row_pitch;
+ op->depth_pitch = depth_pitch;
+
+ /* The data pointer may go away, need to wait until the data is read. Copying the data may be faster.
+ * Don't forget to copy box as well in this case. */
+ cs->ops->submit_and_wait(cs);
+}
+
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1974,6 +2040,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
+ /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6e7d4f800b3..86b1808463e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4171,8 +4171,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
unsigned int depth_pitch)
{
unsigned int width, height, depth, level;
- struct wined3d_const_bo_address addr;
- struct wined3d_context *context;
struct wined3d_texture *texture;
TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n",
@@ -4222,25 +4220,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
return;
}
- addr.buffer_object = 0;
- addr.addr = data;
-
- context = context_acquire(resource->device, NULL, 0);
-
- /* Only load the sub-resource for partial updates. */
- if (!box || (!box->left && !box->top && !box->front
- && box->right == width && box->bottom == height && box->back == depth))
- wined3d_texture_prepare_texture(texture, context, FALSE);
- else
- wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
- wined3d_texture_bind_and_dirtify(texture, context, FALSE);
-
- wined3d_texture_upload_data(texture, sub_resource_idx, context, box, &addr, row_pitch, depth_pitch);
-
- context_release(context);
-
- wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
}
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 74b1ca2c546..5673a93f791 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1498,7 +1498,7 @@ void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture)
FIXME("texture %p stub!\n", texture);
}
-static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
+struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
unsigned int sub_resource_idx)
{
UINT sub_count = texture->level_count * texture->layer_count;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9e2c272eeda..17cb43771d8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2919,6 +2919,8 @@ BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN;
+struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
@@ -3264,6 +3266,9 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void wined3d_cs_emit_sync(struct wined3d_cs *cs);
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
+ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
+ unsigned int depth_pitch) DECLSPEC_HIDDEN;
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
struct wined3d_texture *dst) DECLSPEC_HIDDEN;
void wined3d_cs_init_object(struct wined3d_cs *cs,
--
2.11.0

View File

@ -1,4 +1,4 @@
From 5cde9b1eaee021e59d3a7b17bfdc69270771003d Mon Sep 17 00:00:00 2001
From 41decdb7669a8e83c5c6a244b50822d93ad8d1db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 16 Mar 2014 14:13:42 +0100
Subject: wined3d: Send getdc and releasedc through the command stream.
@ -11,20 +11,20 @@ Another hacky patch to avoid using GL outside the worker thread.
3 files changed, 119 insertions(+), 29 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e2b756eecb9..86ae7eb89c8 100644
index 47678602fed..735991db6e2 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
+ WINED3D_CS_OP_GET_DC,
+ WINED3D_CS_OP_RELEASE_DC,
};
struct wined3d_cs_sync
@@ -409,6 +411,14 @@ struct wined3d_cs_update_sub_resource
const void *data;
@@ -409,6 +411,14 @@ struct wined3d_cs_update_texture
struct wined3d_texture *src, *dst;
};
+struct wined3d_cs_get_release_dc
@ -38,8 +38,8 @@ index e2b756eecb9..86ae7eb89c8 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1977,6 +1987,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->submit_and_wait(cs);
@@ -1992,6 +2002,54 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_get_dc(struct wined3d_cs *cs, const void *data)
@ -93,20 +93,20 @@ index e2b756eecb9..86ae7eb89c8 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2023,6 +2081,8 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2038,6 +2096,8 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
+ /* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
+ /* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 65777aad7be..644637696ea 100644
index 378ce476ca0..5c9cadef95a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -3486,13 +3486,41 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
@@ -3473,13 +3473,41 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
return WINED3D_OK;
}
@ -150,7 +150,7 @@ index 65777aad7be..644637696ea 100644
TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc);
@@ -3517,28 +3545,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -3504,28 +3532,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
return WINED3DERR_INVALIDCALL;
@ -200,7 +200,7 @@ index 65777aad7be..644637696ea 100644
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
@@ -3569,14 +3601,5 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
@@ -3556,14 +3588,5 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
@ -217,18 +217,18 @@ index 65777aad7be..644637696ea 100644
+ return wined3d_cs_emit_release_dc(device->cs, texture, sub_resource_idx);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9cd5c2e316a..822d951b80f 100644
index 5b68475945d..0d85fadec75 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2928,6 +2928,7 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
@@ -2947,6 +2947,7 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
HRESULT wined3d_texture_check_box_dimensions(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
+HRESULT wined3d_texture_get_dc_cs(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN;
@@ -2945,6 +2946,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -2962,6 +2963,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
@ -237,7 +237,7 @@ index 9cd5c2e316a..822d951b80f 100644
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -3220,6 +3223,8 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -3237,6 +3240,8 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
@ -246,7 +246,7 @@ index 9cd5c2e316a..822d951b80f 100644
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -3227,6 +3232,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -3244,6 +3249,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 207bfb3829ccd61de999f5d1797fabee9cb44e4c Mon Sep 17 00:00:00 2001
From 6f0d725b9aad64432838ef31d2d4a69336a4839d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Sat, 7 May 2016 21:58:06 +0100
Subject: wined3d: Update the swap interval through the CS in reset.
@ -10,11 +10,11 @@ Subject: wined3d: Update the swap interval through the CS in reset.
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index eaa9267e5ba..770760f78c7 100644
index 07fccb41bfd..53883ff103c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
@ -34,7 +34,7 @@ index eaa9267e5ba..770760f78c7 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2067,6 +2074,24 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2083,6 +2090,24 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -59,8 +59,8 @@ index eaa9267e5ba..770760f78c7 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2116,6 +2141,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
@@ -2132,6 +2157,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
+ /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval,
@ -68,10 +68,10 @@ index eaa9267e5ba..770760f78c7 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 03361548a89..3870ecf3f0d 100644
index d244091782f..d0af77483e7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4850,7 +4850,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4833,7 +4833,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
if (reset_state)
hr = wined3d_device_create_primary_opengl_context(device);
@ -81,13 +81,13 @@ index 03361548a89..3870ecf3f0d 100644
/* All done. There is no need to reload resources or shaders, this will happen automatically on the
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 667b66f8231..6e215b8f2c4 100644
index 05c1b2d32a3..b8f2ade12dd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3301,6 +3301,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -3304,6 +3304,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int depth_pitch) DECLSPEC_HIDDEN;
unsigned int slice_pitch) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
struct wined3d_texture *dst) DECLSPEC_HIDDEN;

View File

@ -1,59 +0,0 @@
From 6f933585f6c0fb35a9e3ef65645c86f8ecb6f4da Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 7 Feb 2017 14:01:52 +0100
Subject: wined3d: Send buffer update subresource requests through CS.
---
dlls/wined3d/cs.c | 11 +++++++++++
dlls/wined3d/device.c | 7 +------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 5b529d000f4..7e032d8ec05 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2012,6 +2012,17 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
struct wined3d_texture *texture;
unsigned int width, height, depth, level;
+ if (op->resource->type == WINED3D_RTYPE_BUFFER)
+ {
+ struct wined3d_buffer *buffer = buffer_from_resource(op->resource);
+ HRESULT hr;
+
+ if (FAILED(hr = wined3d_buffer_upload_data(buffer, op->box, op->data)))
+ WARN("Failed to update buffer data, hr %#x.\n", hr);
+
+ return;
+ }
+
texture = wined3d_texture_from_resource(op->resource);
level = op->sub_resource_idx % texture->level_count;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bd3a132c496..bf647d5241c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4178,18 +4178,13 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
if (resource->type == WINED3D_RTYPE_BUFFER)
{
- struct wined3d_buffer *buffer = buffer_from_resource(resource);
- HRESULT hr;
-
if (sub_resource_idx > 0)
{
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
return;
}
- if (FAILED(hr = wined3d_buffer_upload_data(buffer, box, data)))
- WARN("Failed to update buffer data, hr %#x.\n", hr);
-
+ wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
return;
}
--
2.11.0

View File

@ -1,206 +0,0 @@
From 24eb775d29ee3563667d35b3319dddcb7830eddf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 7 Feb 2017 22:37:58 +0100
Subject: wined3d: Map vertex buffers through cs.
---
dlls/wined3d/cs.c | 71 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 45 +-------------------------
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 74 insertions(+), 44 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 54b81f74f64..b5c7432fec3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -78,6 +78,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
WINED3D_CS_OP_BUFFER_COPY,
+ WINED3D_CS_OP_MAP_VERTEX_BUFFERS,
};
struct wined3d_cs_sync
@@ -468,6 +469,13 @@ struct wined3d_cs_buffer_copy
unsigned int size;
};
+struct wined3d_cs_map_vertex_buffers
+{
+ enum wined3d_cs_op opcode;
+ UINT src_start_idx;
+ struct wined3d_stream_info *stream_info;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2243,6 +2251,68 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_map_vertex_buffers *op = data;
+ struct wined3d_state *state = &cs->device->state;
+ const struct wined3d_gl_info *gl_info;
+ struct wined3d_context *context;
+ struct wined3d_shader *vs;
+ unsigned int i;
+ WORD map;
+
+ /* Need any context to write to the vbo. */
+ context = context_acquire(cs->device, NULL, 0);
+ gl_info = context->gl_info;
+
+ vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
+ state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL;
+ context_stream_info_from_declaration(context, state, op->stream_info);
+ state->shader[WINED3D_SHADER_TYPE_VERTEX] = vs;
+
+ /* We can't convert FROM a VBO, and vertex buffers used to source into
+ * process_vertices() are unlikely to ever be used for drawing. Release
+ * VBOs in those buffers and fix up the stream_info structure.
+ *
+ * Also apply the start index. */
+ for (i = 0, map = op->stream_info->use_map; map; map >>= 1, ++i)
+ {
+ struct wined3d_stream_info_element *e;
+ struct wined3d_buffer *buffer;
+
+ if (!(map & 1))
+ continue;
+
+ e = &op->stream_info->elements[i];
+ buffer = state->streams[e->stream_idx].buffer;
+ e->data.buffer_object = 0;
+ e->data.addr += (ULONG_PTR)wined3d_buffer_load_sysmem(buffer, context);
+ if (buffer->buffer_object)
+ {
+ GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object));
+ buffer->buffer_object = 0;
+ wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER);
+ }
+ if (e->data.addr)
+ e->data.addr += e->stride * op->src_start_idx;
+ }
+
+ context_release(context);
+}
+
+void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_idx,
+ struct wined3d_stream_info *stream_info)
+{
+ struct wined3d_cs_map_vertex_buffers *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_MAP_VERTEX_BUFFERS;
+ op->src_start_idx = src_start_idx;
+ op->stream_info = stream_info;
+
+ cs->ops->submit_and_wait(cs);
+}
+
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2297,6 +2367,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval,
/* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region,
/* WINED3D_CS_OP_BUFFER_COPY */ wined3d_cs_exec_buffer_copy,
+ /* WINED3D_CS_OP_MAP_VERTEX_BUFFERS */ wined3d_cs_exec_map_vertex_buffers,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 32d25cd1d0f..cd0ffbe32f7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2811,7 +2811,6 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic
wined3d_device_set_pipeline_unordered_access_view(device, WINED3D_PIPELINE_GRAPHICS, idx, uav);
}
-/* Context activation is done by the caller. */
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount,
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags,
@@ -3087,14 +3086,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer,
const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
{
- struct wined3d_state *state = &device->state;
struct wined3d_stream_info stream_info;
- const struct wined3d_gl_info *gl_info;
- struct wined3d_context *context;
- struct wined3d_shader *vs;
- unsigned int i;
HRESULT hr;
- WORD map;
TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, "
"dst_buffer %p, declaration %p, flags %#x, dst_fvf %#x.\n",
@@ -3104,47 +3097,11 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
if (declaration)
FIXME("Output vertex declaration not implemented yet.\n");
- /* Need any context to write to the vbo. */
- context = context_acquire(device, NULL, 0);
- gl_info = context->gl_info;
-
- vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
- state->shader[WINED3D_SHADER_TYPE_VERTEX] = NULL;
- context_stream_info_from_declaration(context, state, &stream_info);
- state->shader[WINED3D_SHADER_TYPE_VERTEX] = vs;
-
- /* We can't convert FROM a VBO, and vertex buffers used to source into
- * process_vertices() are unlikely to ever be used for drawing. Release
- * VBOs in those buffers and fix up the stream_info structure.
- *
- * Also apply the start index. */
- for (i = 0, map = stream_info.use_map; map; map >>= 1, ++i)
- {
- struct wined3d_stream_info_element *e;
- struct wined3d_buffer *buffer;
-
- if (!(map & 1))
- continue;
-
- e = &stream_info.elements[i];
- buffer = state->streams[e->stream_idx].buffer;
- e->data.buffer_object = 0;
- e->data.addr += (ULONG_PTR)wined3d_buffer_load_sysmem(buffer, context);
- if (buffer->buffer_object)
- {
- GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object));
- buffer->buffer_object = 0;
- wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER);
- }
- if (e->data.addr)
- e->data.addr += e->stride * src_start_idx;
- }
+ wined3d_cs_emit_map_vertex_buffers(device->cs, src_start_idx, &stream_info);
hr = process_vertices_strided(device, dst_idx, vertex_count,
&stream_info, dst_buffer, flags, dst_fvf);
- context_release(context);
-
return hr;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9fa4d00c24f..38693a52b29 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3328,6 +3328,8 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN;
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_idx,
+ struct wined3d_stream_info *stream_info) DECLSPEC_HIDDEN;
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
--
2.11.0

View File

@ -1,96 +1,62 @@
From 65c46cb888fd621f85b2ea35f011bbdb5042ba22 Mon Sep 17 00:00:00 2001
From 399b96f2a004f607fe917225e390a6efff7169b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 20 Feb 2017 00:27:25 +0100
Subject: wined3d: Improve wined3d_cs_emit_update_sub_resource.
---
dlls/wined3d/cs.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++---
dlls/wined3d/cs.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
dlls/wined3d/device.c | 2 --
2 files changed, 78 insertions(+), 6 deletions(-)
2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 67d6b736dab..b43130b0ab0 100644
index d3bcc49e6ee..94f46d289a6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -427,10 +427,13 @@ struct wined3d_cs_update_texture
@@ -380,10 +380,12 @@ struct wined3d_cs_unmap
struct wined3d_cs_update_sub_resource
{
enum wined3d_cs_op opcode;
+ unsigned int size;
struct wined3d_resource *resource;
unsigned int sub_resource_idx, row_pitch, depth_pitch;
const struct wined3d_box *box;
const void *data;
+ struct wined3d_box copy_box;
unsigned int sub_resource_idx;
struct wined3d_box box;
struct wined3d_sub_resource_data data;
+ BYTE copy_data[1];
};
struct wined3d_cs_get_release_dc
@@ -2146,7 +2149,9 @@ static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
if (FAILED(hr = wined3d_buffer_upload_data(buffer, op->box, op->data)))
WARN("Failed to update buffer data, hr %#x.\n", hr);
- return sizeof(*op);
+ wined3d_resource_release(op->resource);
+
+ return op->size;
}
texture = wined3d_texture_from_resource(op->resource);
@@ -2176,7 +2181,9 @@ static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
struct wined3d_cs_push_constants
@@ -1973,7 +1975,7 @@ static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
done:
wined3d_resource_release(op->resource);
- return sizeof(*op);
+ wined3d_resource_release(op->resource);
+
+ return op->size;
}
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -2184,9 +2191,76 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
unsigned int depth_pitch)
@@ -1981,9 +1983,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
unsigned int slice_pitch)
{
struct wined3d_cs_update_sub_resource *op;
+ unsigned int update_w, update_h, update_d;
+ size_t data_size, size;
+
+ if (resource->type != WINED3D_RTYPE_BUFFER && resource->format_flags & WINED3DFMT_FLAG_BLOCKS)
+ goto no_async;
+
+ if (box)
+ {
+ update_w = box->right - box->left;
+ update_h = box->bottom - box->top;
+ update_d = box->back - box->front;
+ }
+ else if (resource->type != WINED3D_RTYPE_BUFFER)
+ {
+ struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
+ unsigned int level = sub_resource_idx % texture->level_count;
+ update_w = wined3d_texture_get_level_width(texture, level);
+ update_h = wined3d_texture_get_level_height(texture, level);
+ update_d = wined3d_texture_get_level_depth(texture, level);
+ }
+ else
+ {
+ update_w = resource->size;
+ }
+
+ data_size = 0;
+ switch (resource->type)
+ {
+ case WINED3D_RTYPE_TEXTURE_3D:
+ data_size += max(update_d - 1, 0) * depth_pitch;
+ data_size += (box->back - box->front - 1) * slice_pitch;
+ /* fall-through */
+ case WINED3D_RTYPE_TEXTURE_2D:
+ data_size += max(update_h - 1, 0) * row_pitch;
+ data_size += (box->bottom - box->top - 1) * row_pitch;
+ /* fall-through */
+ case WINED3D_RTYPE_TEXTURE_1D:
+ data_size += update_w * resource->format->byte_count;
+ data_size += (box->right - box->left) * resource->format->byte_count;
+ break;
+ case WINED3D_RTYPE_BUFFER:
+ data_size = update_w;
+ data_size = box->right - box->left;
+ break;
+ }
+
@ -103,12 +69,10 @@ index 67d6b736dab..b43130b0ab0 100644
+ op->size = size;
+ op->resource = resource;
+ op->sub_resource_idx = sub_resource_idx;
+ op->box = box ? &op->copy_box : NULL;
+ op->data = op->copy_data;
+ op->row_pitch = row_pitch;
+ op->depth_pitch = depth_pitch;
+
+ if (box) op->copy_box = *box;
+ op->box = *box;
+ op->data.row_pitch = row_pitch;
+ op->data.slice_pitch = slice_pitch;
+ op->data.data = op->copy_data;
+ memcpy(op->copy_data, data, data_size);
+
+ wined3d_resource_acquire(resource);
@ -124,23 +88,12 @@ index 67d6b736dab..b43130b0ab0 100644
+ op->size = sizeof(*op);
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
op->box = box;
@@ -2194,8 +2268,8 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
op->row_pitch = row_pitch;
op->depth_pitch = depth_pitch;
- /* The data pointer may go away, need to wait until the data is read. Copying the data may be faster.
- * Don't forget to copy box as well in this case. */
+ wined3d_resource_acquire(resource);
+
cs->ops->submit_and_wait(cs);
}
op->box = *box;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c32d967df88..1b77fa7d09d 100644
index b413de95858..0efd687b747 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4112,8 +4112,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4163,8 +4163,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch);

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 77e96719b681f37950972bd78478c1c08a5faebc Mon Sep 17 00:00:00 2001
From 331d0798182a0e5fab1fe59e6503d5e8597ff403 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 19:35:36 +0100
Subject: Revert "wined3d: Implement wined3d_buffer_upload_data() on top of
@ -7,15 +7,15 @@ Subject: Revert "wined3d: Implement wined3d_buffer_upload_data() on top of
This reverts commit e2dbbec1af8ae2ea8813148d56e14c8c211ee334.
---
dlls/wined3d/buffer.c | 30 +++++++++++++++++++-----------
dlls/wined3d/device.c | 14 +++-----------
dlls/wined3d/cs.c | 13 +++----------
dlls/wined3d/wined3d_private.h | 2 +-
3 files changed, 23 insertions(+), 23 deletions(-)
3 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index fa3e3a7380a..5cf7b1068f9 100644
index c584147717b..18933d1f6df 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -532,7 +532,7 @@ ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
@@ -525,7 +525,7 @@ ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
/* Context activation is done by the caller. */
static void wined3d_buffer_upload_ranges(struct wined3d_buffer *buffer, struct wined3d_context *context,
@ -24,7 +24,7 @@ index fa3e3a7380a..5cf7b1068f9 100644
{
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_map_range *range;
@@ -543,7 +543,7 @@ static void wined3d_buffer_upload_ranges(struct wined3d_buffer *buffer, struct w
@@ -536,7 +536,7 @@ static void wined3d_buffer_upload_ranges(struct wined3d_buffer *buffer, struct w
{
range = &ranges[range_count];
GL_EXTCALL(glBufferSubData(buffer->buffer_type_hint,
@ -33,7 +33,7 @@ index fa3e3a7380a..5cf7b1068f9 100644
}
checkGLcall("glBufferSubData");
}
@@ -599,7 +599,7 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
@@ -592,7 +592,7 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
}
}
@ -42,7 +42,7 @@ index fa3e3a7380a..5cf7b1068f9 100644
HeapFree(GetProcessHeap(), 0, data);
}
@@ -683,7 +683,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
@@ -676,7 +676,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
case WINED3D_LOCATION_BUFFER:
if (!buffer->conversion_map)
wined3d_buffer_upload_ranges(buffer, context, buffer->resource.heap_memory,
@ -51,7 +51,7 @@ index fa3e3a7380a..5cf7b1068f9 100644
else
buffer_conversion_upload(buffer, context);
break;
@@ -1267,23 +1267,31 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
@@ -1261,23 +1261,31 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
return WINED3D_OK;
}
@ -90,43 +90,37 @@ index fa3e3a7380a..5cf7b1068f9 100644
}
static ULONG buffer_resource_incref(struct wined3d_resource *resource)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a7ee5bc099d..a3adf3255f1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4127,6 +4127,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
if (resource->type == WINED3D_RTYPE_BUFFER)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 9f3de815be5..39071faef32 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1669,18 +1669,11 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
if (op->resource->type == WINED3D_RTYPE_BUFFER)
{
struct wined3d_buffer *buffer = buffer_from_resource(resource);
struct wined3d_buffer *buffer = buffer_from_resource(op->resource);
+ HRESULT hr;
if (sub_resource_idx > 0)
{
@@ -4134,17 +4135,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
return;
}
- context = context_acquire(resource->device, NULL, 0);
- context = context_acquire(op->resource->device, NULL, 0);
- if (!wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_BUFFER))
- {
- ERR("Failed to load buffer location.\n");
- context_release(context);
- return;
- goto done;
- }
-
- wined3d_buffer_upload_data(buffer, context, box, data);
- wined3d_buffer_invalidate_location(buffer, ~WINED3D_LOCATION_BUFFER);
- context_release(context);
+ if (FAILED(hr = wined3d_buffer_upload_data(buffer, box, data)))
+ if (FAILED(hr = wined3d_buffer_upload_data(buffer, box, op->data.data)))
+ WARN("Failed to update buffer data, hr %#x.\n", hr);
return;
- wined3d_buffer_upload_data(buffer, context, box, op->data.data);
- wined3d_buffer_invalidate_location(buffer, ~WINED3D_LOCATION_BUFFER);
- context_release(context);
goto done;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 50b7c93cad8..30de702098a 100644
index 48f2f368d20..3883792f6fe 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3300,7 +3300,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
@@ -3343,7 +3343,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN;
HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset,
struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) DECLSPEC_HIDDEN;