Rebase against ea9253d6d3c9bb60d98b0d917292fc0b4babb3dd.

This commit is contained in:
Zebediah Figura 2018-11-23 20:56:43 -06:00
parent d373c19f75
commit 0a0998b398
7 changed files with 81 additions and 340 deletions

View File

@ -1,7 +1,7 @@
From 29f88a1e1278d0ffec52d4463b3d743765fc1ad2 Mon Sep 17 00:00:00 2001
From d728af2b7217357b79716b0f25d457071c7e52ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 16 Aug 2017 02:45:23 +0200
Subject: [PATCH 1/2] kernelbase: Add semi-stub for PathCchCombineEx.
Subject: [PATCH] kernelbase: Add semi-stub for PathCchCombineEx.
---
.../api-ms-win-core-path-l1-1-0.spec | 2 +-
@ -11,20 +11,20 @@ Subject: [PATCH 1/2] kernelbase: Add semi-stub for PathCchCombineEx.
4 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec b/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
index 61eb220..8c720ee 100644
index 6896e4a8d4..5299b42c91 100644
--- a/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
+++ b/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
@@ -8,7 +8,7 @@
@ stub PathCchCanonicalize
@ stub PathCchCanonicalizeEx
@ stdcall PathCchCanonicalize(ptr long wstr) kernelbase.PathCchCanonicalize
@ stdcall PathCchCanonicalizeEx(ptr long wstr long) kernelbase.PathCchCanonicalizeEx
@ stub PathCchCombine
-@ stub PathCchCombineEx
+@ stdcall PathCchCombineEx(ptr long ptr ptr long) kernelbase.PathCchCombineEx
@ stdcall PathCchFindExtension(wstr long ptr) kernelbase.PathCchFindExtension
@ stdcall PathCchIsRoot(wstr) kernelbase.PathCchIsRoot
@ stub PathCchRemoveBackslash
@ stdcall PathCchRemoveBackslash(wstr long) kernelbase.PathCchRemoveBackslash
diff --git a/dlls/kernelbase/Makefile.in b/dlls/kernelbase/Makefile.in
index a7db45e..78c19bd 100644
index a7db45e4c1..78c19bd2a1 100644
--- a/dlls/kernelbase/Makefile.in
+++ b/dlls/kernelbase/Makefile.in
@@ -1,4 +1,6 @@
@ -36,20 +36,20 @@ index a7db45e..78c19bd 100644
C_SRCS = \
main.c \
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index ffb5a95..53d45c4 100644
index 752d489fba..0f6637cdf2 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1037,7 +1037,7 @@
# @ stub PathCchCanonicalize
# @ stub PathCchCanonicalizeEx
@ stdcall PathCchCanonicalize(ptr long wstr)
@ stdcall PathCchCanonicalizeEx(ptr long wstr long)
# @ stub PathCchCombine
-# @ stub PathCchCombineEx
+@ stdcall PathCchCombineEx(ptr long ptr ptr long)
@ stdcall PathCchFindExtension(wstr long ptr)
@ stdcall PathCchIsRoot(wstr)
# @ stub PathCchRemoveBackslash
@ stdcall PathCchRemoveBackslash(wstr long)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 75faf0b..047149e 100644
index cc15d1c097..ed1ca37280 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -22,6 +22,7 @@
@ -60,7 +60,7 @@ index 75faf0b..047149e 100644
#include "strsafe.h"
#include "wine/debug.h"
@@ -419,3 +420,29 @@ BOOL WINAPI PathIsUNCEx(const WCHAR *path, const WCHAR **server)
@@ -737,3 +738,29 @@ BOOL WINAPI PathIsUNCEx(const WCHAR *path, const WCHAR **server)
if (server) *server = result;
return result ? TRUE : FALSE;
}
@ -91,5 +91,5 @@ index 75faf0b..047149e 100644
+}
+
--
1.9.1
2.14.1

View File

@ -1,258 +0,0 @@
From 1971ae905df4731f0f3f8b3e27329fff1a0c7b92 Mon Sep 17 00:00:00 2001
From: Julien Schueller <schueller@phimeca.com>
Date: Wed, 4 Jul 2018 22:35:16 +0200
Subject: [PATCH 2/2] kernelbase: Implement
PathCchRemoveBackslash()/PathCchRemoveBackslashEx().
---
.../api-ms-win-core-path-l1-1-0.spec | 4 +-
dlls/kernelbase/kernelbase.spec | 4 +-
dlls/kernelbase/path.c | 31 +++++
dlls/kernelbase/tests/path.c | 129 +++++++++++++++++++++
include/pathcch.h | 2 +
5 files changed, 166 insertions(+), 4 deletions(-)
diff --git a/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec b/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
index 8c720ee..418ed61 100644
--- a/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
+++ b/dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
@@ -11,8 +11,8 @@
@ stdcall PathCchCombineEx(ptr long ptr ptr long) kernelbase.PathCchCombineEx
@ stdcall PathCchFindExtension(wstr long ptr) kernelbase.PathCchFindExtension
@ stdcall PathCchIsRoot(wstr) kernelbase.PathCchIsRoot
-@ stub PathCchRemoveBackslash
-@ stub PathCchRemoveBackslashEx
+@ stdcall PathCchRemoveBackslash(wstr long) kernelbase.PathCchRemoveBackslash
+@ stdcall PathCchRemoveBackslashEx(wstr long ptr ptr) kernelbase.PathCchRemoveBackslashEx
@ stdcall PathCchRemoveExtension(wstr long) kernelbase.PathCchRemoveExtension
@ stub PathCchRemoveFileSpec
@ stdcall PathCchRenameExtension(wstr long wstr) kernelbase.PathCchRenameExtension
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 53d45c4..a568627 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1040,8 +1040,8 @@
@ stdcall PathCchCombineEx(ptr long ptr ptr long)
@ stdcall PathCchFindExtension(wstr long ptr)
@ stdcall PathCchIsRoot(wstr)
-# @ stub PathCchRemoveBackslash
-# @ stub PathCchRemoveBackslashEx
+@ stdcall PathCchRemoveBackslash(wstr long)
+@ stdcall PathCchRemoveBackslashEx(wstr long ptr ptr)
@ stdcall PathCchRemoveExtension(wstr long)
# @ stub PathCchRemoveFileSpec
@ stdcall PathCchRenameExtension(wstr long wstr)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 047149e..a413e94 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -446,3 +446,34 @@ HRESULT WINAPI PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, con
return S_OK;
}
+HRESULT WINAPI PathCchRemoveBackslash(WCHAR *path, SIZE_T size)
+{
+ return PathCchRemoveBackslashEx(path, size, NULL, NULL);
+}
+
+HRESULT WINAPI PathCchRemoveBackslashEx(WCHAR *path, SIZE_T size, WCHAR **endptr, SIZE_T *remaining)
+{
+ BOOL needs_trim;
+ SIZE_T length;
+
+ TRACE("%s, %lu, %p, %p\n", debugstr_w(path), size, endptr, remaining);
+
+ if (!path) return E_INVALIDARG;
+ length = strlenW(path);
+ needs_trim = size && length && path[length - 1] == '\\';
+
+ if (needs_trim && (length > 1) && path[length - 2] == ':')
+ needs_trim = 0;
+
+ if (needs_trim)
+ {
+ path[length - 1] = 0;
+ --length;
+ }
+
+ if (endptr) *endptr = path + length;
+ if (remaining) *remaining = size - length;
+
+ return needs_trim ? S_OK : S_FALSE;
+}
+
diff --git a/dlls/kernelbase/tests/path.c b/dlls/kernelbase/tests/path.c
index 2edd49b..97bf7dd 100644
--- a/dlls/kernelbase/tests/path.c
+++ b/dlls/kernelbase/tests/path.c
@@ -33,6 +33,8 @@
HRESULT (WINAPI *pPathCchAddBackslash)(WCHAR *out, SIZE_T size);
HRESULT (WINAPI *pPathCchAddBackslashEx)(WCHAR *out, SIZE_T size, WCHAR **endptr, SIZE_T *remaining);
HRESULT (WINAPI *pPathCchAddExtension)(WCHAR *path, SIZE_T size, const WCHAR *extension);
+HRESULT (WINAPI *pPathCchRemoveBackslash)(WCHAR *out, SIZE_T size);
+HRESULT (WINAPI *pPathCchRemoveBackslashEx)(WCHAR *out, SIZE_T size, WCHAR **endptr, SIZE_T *remaining);
HRESULT (WINAPI *pPathCchCombineEx)(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags);
HRESULT (WINAPI *pPathCchFindExtension)(const WCHAR *path, SIZE_T size, const WCHAR **extension);
BOOL (WINAPI *pPathCchIsRoot)(const WCHAR *path);
@@ -1097,6 +1099,127 @@ static void test_PathIsUNCEx(void)
}
}
+struct removebackslash_test
+{
+ const char *path;
+ const char *result;
+ HRESULT hr;
+ SIZE_T size;
+ SIZE_T remaining;
+};
+
+static const struct removebackslash_test removebackslash_tests[] =
+{
+ { "C:\\", "C:\\", S_FALSE, MAX_PATH, MAX_PATH - 3 },
+ { "a.txt\\", "a.txt", S_OK, MAX_PATH, MAX_PATH - 5 },
+ { "a/b\\", "a/b", S_OK, MAX_PATH, MAX_PATH - 3 },
+ { "C:\\temp\\wine.txt", "C:\\temp\\wine.txt", S_FALSE, MAX_PATH, MAX_PATH - 16 },
+};
+
+static void test_PathCchRemoveBackslash(void)
+{
+ WCHAR pathW[MAX_PATH];
+ unsigned int i;
+ HRESULT hr;
+
+ if (!pPathCchRemoveBackslash)
+ {
+ win_skip("PathCchRemoveBackslash() is not available.\n");
+ return;
+ }
+
+ pathW[0] = 0;
+ hr = pPathCchRemoveBackslash(0, 0);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+
+ pathW[0] = 0;
+ hr = pPathCchRemoveBackslash(pathW, 1);
+ ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+
+ pathW[0] = 0;
+ hr = pPathCchRemoveBackslash(pathW, 2);
+ ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+
+ for (i = 0; i < ARRAY_SIZE(removebackslash_tests); i++)
+ {
+ const struct removebackslash_test *test = &removebackslash_tests[i];
+ char path[MAX_PATH];
+
+ MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW));
+ hr = pPathCchRemoveBackslash(pathW, test->size);
+ ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr);
+
+ WideCharToMultiByte(CP_ACP, 0, pathW, -1, path, ARRAY_SIZE(path), NULL, NULL);
+ ok(!strcmp(path, test->result), "%u: unexpected resulting path %s.\n", i, path);
+ }
+}
+
+static void test_PathCchRemoveBackslashEx(void)
+{
+ WCHAR pathW[MAX_PATH];
+ SIZE_T remaining;
+ unsigned int i;
+ HRESULT hr;
+ WCHAR *ptrW;
+
+ if (!pPathCchRemoveBackslashEx)
+ {
+ win_skip("PathCchRemoveBackslashEx() is not available.\n");
+ return;
+ }
+
+ pathW[0] = 0;
+ hr = pPathCchRemoveBackslashEx(0, 0, NULL, NULL);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+
+ pathW[0] = 0;
+ ptrW = (void *)0xdeadbeef;
+ remaining = 123;
+ hr = pPathCchRemoveBackslashEx(pathW, 1, &ptrW, &remaining);
+ ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+ ok(ptrW == pathW, "Unexpected endptr %p.\n", ptrW);
+ ok(remaining == 1, "Unexpected remaining size.\n");
+
+ pathW[0] = 0;
+ hr = pPathCchRemoveBackslashEx(pathW, 2, NULL, NULL);
+ ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(pathW[0] == 0, "Unexpected path.\n");
+
+ for (i = 0; i < ARRAY_SIZE(removebackslash_tests); i++)
+ {
+ const struct removebackslash_test *test = &removebackslash_tests[i];
+ char path[MAX_PATH];
+
+ MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW));
+ hr = pPathCchRemoveBackslashEx(pathW, test->size, NULL, NULL);
+ ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr);
+
+ WideCharToMultiByte(CP_ACP, 0, pathW, -1, path, ARRAY_SIZE(path), NULL, NULL);
+ ok(!strcmp(path, test->result), "%u: unexpected resulting path %s.\n", i, path);
+
+ ptrW = (void *)0xdeadbeef;
+ remaining = 123;
+ MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW));
+ hr = pPathCchRemoveBackslashEx(pathW, test->size, &ptrW, &remaining);
+ ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr);
+ if (SUCCEEDED(hr))
+ {
+ ok(ptrW == (pathW + lstrlenW(pathW)), "%u: unexpected end pointer.\n", i);
+ ok(remaining == test->remaining, "%u: unexpected remaining buffer length.\n", i);
+ }
+ else
+ {
+ ok(ptrW == NULL, "%u: unexpecred end pointer.\n", i);
+ ok(remaining == 0, "%u: unexpected remaining buffer length.\n", i);
+ }
+ }
+}
+
START_TEST(path)
{
HMODULE hmod = LoadLibraryA("kernelbase.dll");
@@ -1114,6 +1237,9 @@ START_TEST(path)
pPathCchStripToRoot = (void *)GetProcAddress(hmod, "PathCchStripToRoot");
pPathIsUNCEx = (void *)GetProcAddress(hmod, "PathIsUNCEx");
+ pPathCchRemoveBackslash = (void *)GetProcAddress(hmod, "PathCchRemoveBackslash");
+ pPathCchRemoveBackslashEx = (void *)GetProcAddress(hmod, "PathCchRemoveBackslashEx");
+
test_PathCchCombineEx();
test_PathCchAddBackslash();
test_PathCchAddBackslashEx();
@@ -1126,4 +1252,7 @@ START_TEST(path)
test_PathCchStripPrefix();
test_PathCchStripToRoot();
test_PathIsUNCEx();
+
+ test_PathCchRemoveBackslash();
+ test_PathCchRemoveBackslashEx();
}
diff --git a/include/pathcch.h b/include/pathcch.h
index 443ccd3..fec4567 100644
--- a/include/pathcch.h
+++ b/include/pathcch.h
@@ -28,6 +28,8 @@
HRESULT WINAPI PathCchAddBackslash(WCHAR *path, SIZE_T size);
HRESULT WINAPI PathCchAddBackslashEx(WCHAR *path, SIZE_T size, WCHAR **end, SIZE_T *remaining);
HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extension);
+HRESULT WINAPI PathCchRemoveBackslash(WCHAR *path, SIZE_T size);
+HRESULT WINAPI PathCchRemoveBackslashEx(WCHAR *path, SIZE_T size, WCHAR **end, SIZE_T *remaining);
HRESULT WINAPI PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags);
HRESULT WINAPI PathCchFindExtension(const WCHAR *path, SIZE_T size, const WCHAR **extension);
BOOL WINAPI PathCchIsRoot(const WCHAR *path);
--
1.9.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "0c5ce58505e24bf07cbd4c09752ef2f949d64fd0"
echo "ea9253d6d3c9bb60d98b0d917292fc0b4babb3dd"
}
# Show version information
@ -4048,14 +4048,12 @@ fi
# |
# | Modified files:
# | * dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec, dlls/kernelbase/Makefile.in,
# | dlls/kernelbase/kernelbase.spec, dlls/kernelbase/path.c, dlls/kernelbase/tests/path.c, include/pathcch.h
# | dlls/kernelbase/kernelbase.spec, dlls/kernelbase/path.c
# |
if test "$enable_kernelbase_PathCchCombineEx" -eq 1; then
patch_apply kernelbase-PathCchCombineEx/0001-kernelbase-Add-semi-stub-for-PathCchCombineEx.patch
patch_apply kernelbase-PathCchCombineEx/0002-kernelbase-Implement-PathCchRemoveBackslash-PathCchR.patch
(
printf '%s\n' '+ { "Michael Müller", "kernelbase: Add semi-stub for PathCchCombineEx.", 1 },';
printf '%s\n' '+ { "Julien Schueller", "kernelbase: Implement PathCchRemoveBackslash()/PathCchRemoveBackslashEx().", 1 },';
) >> "$patchlist"
fi

View File

@ -1,8 +1,8 @@
From 8a2cfa7797641f79216ab21b6e027f908879c2a2 Mon Sep 17 00:00:00 2001
From b1218833ac88f9706094427eefa09ee91aa97667 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 11 Feb 2016 03:20:33 +0100
Subject: setupapi: Handle the case that a full driver path is passed to
SetupDiGetClassDevs.
Subject: [PATCH] setupapi: Handle the case that a full driver path is passed
to SetupDiGetClassDevs.
---
dlls/setupapi/devinst.c | 26 ++++++++++++++++++++++++--
@ -10,10 +10,10 @@ Subject: setupapi: Handle the case that a full driver path is passed to
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 74a8e2b..4291c09 100644
index d9517bdcab..fa04816242 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -2340,8 +2340,30 @@ static void SETUPDI_EnumerateDevices(HDEVINFO DeviceInfoSet, const GUID *class,
@@ -2370,8 +2370,30 @@ static void SETUPDI_EnumerateDevices(HDEVINFO DeviceInfoSet, const GUID *class,
&enumStrKey);
if (!l)
{
@ -47,10 +47,10 @@ index 74a8e2b..4291c09 100644
}
}
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 9a8ecbc..d2b1500 100644
index c58e35f482..c9f0583825 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -1430,6 +1430,28 @@ static void test_device_interface_key(void)
@@ -1407,6 +1407,28 @@ static void test_device_interface_key(void)
SetupDiDestroyDeviceInfoList(set);
}
@ -66,27 +66,27 @@ index 9a8ecbc..d2b1500 100644
+ ok(EnumDisplayDevicesA(NULL, 0, &disp, 0), "EnumDisplayDevices failed: %08x\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ set = pSetupDiGetClassDevsA(&displayguid, disp.DeviceID, 0, 0);
+ set = SetupDiGetClassDevsA(&displayguid, disp.DeviceID, 0, 0);
+ ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsA failed: %08x\n", GetLastError());
+
+ devinfo.cbSize = sizeof(devinfo);
+ ret = SetupDiEnumDeviceInfo(set, 0, &devinfo);
+ ok(ret, "SetupDiEnumDeviceInfo failed: %08x\n", GetLastError());
+
+ pSetupDiDestroyDeviceInfoList(set);
+ SetupDiDestroyDeviceInfoList(set);
+}
+
START_TEST(devinst)
{
HKEY hkey;
@@ -1467,6 +1489,7 @@ START_TEST(devinst)
testDeviceRegistryPropertyA();
testDeviceRegistryPropertyW();
@@ -1441,6 +1463,7 @@ START_TEST(devinst)
test_registry_property_a();
test_registry_property_w();
testSetupDiGetINFClassA();
+ testSetupDiGetClassDevsA();
test_devnode();
test_device_interface_key();
}
--
2.7.4
2.14.1

View File

@ -1,4 +1,4 @@
From ece98fdbc8cdf819452f91ee713542d7d13b3d49 Mon Sep 17 00:00:00 2001
From 9fc5ac66917f68828d1a4fb0dd935be36cc57711 Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Sat, 26 Aug 2017 00:59:29 +0200
Subject: [PATCH] wined3d: Implement hardware indexed vertex blending with 9
@ -13,10 +13,10 @@ Subject: [PATCH] wined3d: Implement hardware indexed vertex blending with 9
5 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index bb5410e..a6408c0 100644
index c3864b9dd6..1cdeba9fc5 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -20491,7 +20491,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -20573,7 +20573,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
if (caps.MaxVertexBlendMatrixIndex < 7 || caps.MaxVertexBlendMatrices < 4)
{
@ -26,19 +26,19 @@ index bb5410e..a6408c0 100644
return;
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a8ed36a..586991e 100644
index ad59e97e3f..8828749f5a 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -143,7 +143,7 @@ struct glsl_vs_program
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B];
@@ -157,7 +157,7 @@ struct glsl_vs_program
GLint pos_fixup_location;
GLint base_vertex_id_location;
- GLint modelview_matrix_location[MAX_VERTEX_BLENDS];
+ GLint modelview_matrix_location[MAX_VERTEX_INDEX_BLENDS];
GLint projection_matrix_location;
GLint normal_matrix_location;
GLint texture_matrix_location[MAX_TEXTURES];
@@ -1831,7 +1831,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1850,7 +1850,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
{
struct wined3d_matrix mat;
@ -47,7 +47,7 @@ index a8ed36a..586991e 100644
{
if (prog->vs.modelview_matrix_location[i] == -1)
break;
@@ -8956,8 +8956,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9110,8 +9110,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
{
{"vec4", "ffp_attrib_position"}, /* WINED3D_FFP_POSITION */
{"vec4", "ffp_attrib_blendweight"}, /* WINED3D_FFP_BLENDWEIGHT */
@ -57,7 +57,7 @@ index a8ed36a..586991e 100644
{"vec3", "ffp_attrib_normal"}, /* WINED3D_FFP_NORMAL */
{"float", "ffp_attrib_psize"}, /* WINED3D_FFP_PSIZE */
{"vec4", "ffp_attrib_diffuse"}, /* WINED3D_FFP_DIFFUSE */
@@ -8969,6 +8968,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9123,6 +9122,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
BOOL legacy_lighting = priv->legacy_lighting;
GLuint shader_obj;
unsigned int i;
@ -65,7 +65,7 @@ index a8ed36a..586991e 100644
string_buffer_clear(buffer);
@@ -8987,7 +8987,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9141,7 +9141,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
}
shader_addline(buffer, "\n");
@ -74,7 +74,7 @@ index a8ed36a..586991e 100644
shader_addline(buffer, "uniform mat4 ffp_projection_matrix;\n");
shader_addline(buffer, "uniform mat3 ffp_normal_matrix;\n");
shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", MAX_TEXTURES);
@@ -9079,7 +9079,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9233,7 +9233,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_addline(buffer, "vec4 ec_pos = vec4(0.0);\n");
for (i = 0; i < settings->vertexblends + 1; ++i)
@ -86,7 +86,7 @@ index a8ed36a..586991e 100644
shader_addline(buffer, "gl_Position = ffp_projection_matrix * ec_pos;\n");
if (settings->clipping)
@@ -9103,7 +9106,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9257,7 +9260,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
else
{
for (i = 0; i < settings->vertexblends + 1; ++i)
@ -98,16 +98,16 @@ index a8ed36a..586991e 100644
}
if (settings->normalize)
@@ -9973,7 +9979,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
@@ -10131,7 +10137,7 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
vs->pos_fixup_location = GL_EXTCALL(glGetUniformLocation(program_id, "pos_fixup"));
vs->base_vertex_id_location = GL_EXTCALL(glGetUniformLocation(program_id, "base_vertex_id"));
- for (i = 0; i < MAX_VERTEX_BLENDS; ++i)
+ for (i = 0; i < MAX_VERTEX_INDEX_BLENDS; ++i)
{
string_buffer_sprintf(name, "ffp_modelview_matrix[%u]", i);
vs->modelview_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
@@ -10565,7 +10571,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
@@ -10711,7 +10717,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW
| WINED3D_SHADER_CONST_FFP_PROJ;
@ -116,7 +116,7 @@ index a8ed36a..586991e 100644
{
if (entry->vs.modelview_matrix_location[i] != -1)
{
@@ -11538,7 +11544,7 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info,
@@ -11680,7 +11686,7 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info,
caps->ffp_generic_attributes = TRUE;
caps->max_active_lights = MAX_ACTIVE_LIGHTS;
caps->max_vertex_blend_matrices = MAX_VERTEX_BLENDS;
@ -125,7 +125,7 @@ index a8ed36a..586991e 100644
caps->vertex_processing_caps = WINED3DVTXPCAPS_TEXGEN
| WINED3DVTXPCAPS_MATERIALSOURCE7
| WINED3DVTXPCAPS_VERTEXFOG
@@ -11916,6 +11922,11 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
@@ -12068,6 +12074,11 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(1)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(2)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
{STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(3)), glsl_vertex_pipe_vertexblend }, WINED3D_GL_EXT_NONE },
@ -138,10 +138,10 @@ index a8ed36a..586991e 100644
{STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_vertex_pipe_texmatrix}, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index ab9fc45..8df1a49 100644
index c6f4dde7e5..e74dea5ef4 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -5910,6 +5910,9 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
@@ -6248,6 +6248,9 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
break;
}
@ -152,7 +152,7 @@ index ab9fc45..8df1a49 100644
&& state->render_states[WINED3D_RS_CLIPPLANEENABLE];
settings->normal = !!(si->use_map & (1u << WINED3D_FFP_NORMAL));
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 3d1518d..82348b4 100644
index 863366b924..980d9acdf6 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -119,6 +119,15 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
@ -172,10 +172,10 @@ index 3d1518d..82348b4 100644
switch(element->format)
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7c813bf..e7892ea 100644
index 0fea6003de..aa620b0c6a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -276,6 +276,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
@@ -272,6 +272,7 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
#define MAX_UNORDERED_ACCESS_VIEWS 8
#define MAX_TGSM_REGISTERS 8192
#define MAX_VERTEX_BLENDS 4
@ -183,7 +183,7 @@ index 7c813bf..e7892ea 100644
#define MAX_RENDER_TARGETS 8
struct min_lookup
@@ -2778,7 +2779,8 @@ struct wined3d_ffp_vs_settings
@@ -2823,7 +2824,8 @@ struct wined3d_ffp_vs_settings
DWORD ortho_fog : 1;
DWORD flatshading : 1;
DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */
@ -193,7 +193,7 @@ index 7c813bf..e7892ea 100644
DWORD texgen[MAX_TEXTURES];
};
@@ -4372,6 +4374,20 @@ static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *forma
@@ -4507,6 +4509,20 @@ static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *forma
return format->id == format->typeless_id && format->id != WINED3DFMT_UNKNOWN;
}
@ -215,5 +215,5 @@ index 7c813bf..e7892ea 100644
{
/* Check state->vertex_declaration to allow this to be used before the
--
1.9.1
2.14.1

View File

@ -1,4 +1,4 @@
From ff076f32b12e12ad59b82a96133c6080022ce25b Mon Sep 17 00:00:00 2001
From 3a66d16e9d18f441382862124e2f8721dfb5d6a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 31 Aug 2017 01:00:04 +0200
Subject: wined3d: Fix calculation of normal when vertex blending is enabled.
@ -9,10 +9,10 @@ Subject: wined3d: Fix calculation of normal when vertex blending is enabled.
2 files changed, 36 insertions(+), 42 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index ae5d76c..517f6c0 100644
index 388e876cce..c27be6beec 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -20580,7 +20580,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
@@ -20693,7 +20693,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char
while (point->x != -1 && point->y != -1)
{
color = getPixelColor(device, point->x, point->y);
@ -22,11 +22,11 @@ index ae5d76c..517f6c0 100644
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 2cad436..ca92f56 100644
index 8828749f5a..c916ecff19 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -144,8 +144,8 @@ struct glsl_vs_program
GLint pos_fixup_location;
@@ -158,8 +158,8 @@ struct glsl_vs_program
GLint base_vertex_id_location;
GLint modelview_matrix_location[MAX_VERTEX_INDEX_BLENDS];
+ GLint normal_matrix_location[MAX_VERTEX_INDEX_BLENDS];
@ -35,7 +35,7 @@ index 2cad436..ca92f56 100644
GLint texture_matrix_location[MAX_TEXTURES];
GLint material_ambient_location;
GLint material_diffuse_location;
@@ -1523,33 +1523,6 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma
@@ -1548,33 +1548,6 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma
*out = temp;
}
@ -69,7 +69,7 @@ index 2cad436..ca92f56 100644
static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context *context,
const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog)
{
@@ -1747,6 +1720,23 @@ static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps
@@ -1772,6 +1745,23 @@ static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps
GL_EXTCALL(glUniform4fv(ps->color_key_location, 2, &float_key[0].r));
}
@ -93,15 +93,15 @@ index 2cad436..ca92f56 100644
/* Context activation is done by the caller (state handler). */
static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context *context,
const struct wined3d_state *state)
@@ -1757,6 +1747,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
const struct wined3d_gl_info *gl_info = context->gl_info;
struct shader_glsl_priv *priv = shader_priv;
@@ -1784,6 +1774,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
float position_fixup[4 * WINED3D_MAX_VIEWPORTS];
struct shader_glsl_priv *priv = shader_priv;
unsigned int constant_version;
+ float normal[3 * 3];
DWORD update_mask;
int i;
struct glsl_shader_prog_link *prog = ctx_data->glsl_program;
@@ -1813,7 +1804,9 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1843,7 +1834,9 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location[0], 1, FALSE, &mat._11));
checkGLcall("glUniformMatrix4fv");
@ -112,7 +112,7 @@ index 2cad436..ca92f56 100644
}
if (update_mask & WINED3D_SHADER_CONST_FFP_VERTEXBLEND)
@@ -1828,6 +1821,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1858,6 +1851,10 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
get_modelview_matrix(context, state, i, &mat);
GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location[i], 1, FALSE, &mat._11));
checkGLcall("glUniformMatrix4fv");
@ -123,7 +123,7 @@ index 2cad436..ca92f56 100644
}
}
@@ -8818,8 +8815,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9142,8 +9139,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_addline(buffer, "\n");
shader_addline(buffer, "uniform mat4 ffp_modelview_matrix[%u];\n", MAX_VERTEX_INDEX_BLENDS);
@ -133,7 +133,7 @@ index 2cad436..ca92f56 100644
shader_addline(buffer, "uniform mat4 ffp_texture_matrix[%u];\n", MAX_TEXTURES);
shader_addline(buffer, "uniform struct\n{\n");
@@ -8929,17 +8926,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
@@ -9253,17 +9250,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_addline(buffer, "vec3 normal = vec3(0.0);\n");
if (settings->normal)
{
@ -154,7 +154,7 @@ index 2cad436..ca92f56 100644
}
if (settings->normalize)
@@ -9814,8 +9804,12 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
@@ -10142,8 +10132,12 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
string_buffer_sprintf(name, "ffp_modelview_matrix[%u]", i);
vs->modelview_matrix_location[i] = GL_EXTCALL(glGetUniformLocation(program_id, name->buffer));
}
@ -169,5 +169,5 @@ index 2cad436..ca92f56 100644
{
string_buffer_sprintf(name, "ffp_texture_matrix[%u]", i);
--
2.7.4
2.14.1

View File

@ -1,4 +1,4 @@
From a769af7ae2309b0bd56753701bdd75daa236885a Mon Sep 17 00:00:00 2001
From 726f9593426745c69d5a907e210c9fcff88a2bbb Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 31 Aug 2017 07:42:31 +0200
Subject: wined3d: Track updates of vertex blend matrices separately.
@ -9,10 +9,10 @@ Subject: wined3d: Track updates of vertex blend matrices separately.
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 3cfa901..28cf2c7 100644
index cc6068cf44..11887b74ff 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1528,6 +1528,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1560,6 +1560,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
{
if (prog->vs.modelview_matrix_location[i] == -1)
break;
@ -21,7 +21,7 @@ index 3cfa901..28cf2c7 100644
get_modelview_matrix(context, state, i, &mat);
GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location[i], 1, FALSE, &mat._11));
@@ -11243,7 +11245,8 @@ static void glsl_vertex_pipe_world(struct wined3d_context *context,
@@ -11612,7 +11614,8 @@ static void glsl_vertex_pipe_world(struct wined3d_context *context,
static void glsl_vertex_pipe_vertexblend(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id)
{
@ -32,10 +32,10 @@ index 3cfa901..28cf2c7 100644
static void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3d08572..8f791cb 100644
index c76a72131f..75697216f1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -440,13 +440,14 @@ enum wined3d_shader_resource_type
@@ -440,7 +440,6 @@ enum wined3d_shader_resource_type
#define WINED3D_SHADER_CONST_PS_Y_CORR 0x00001000
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP 0x00002000
#define WINED3D_SHADER_CONST_FFP_MODELVIEW 0x00004000
@ -43,14 +43,15 @@ index 3d08572..8f791cb 100644
#define WINED3D_SHADER_CONST_FFP_PROJ 0x00010000
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX 0x00020000
#define WINED3D_SHADER_CONST_FFP_MATERIAL 0x00040000
#define WINED3D_SHADER_CONST_FFP_LIGHTS 0x00080000
@@ -448,6 +447,8 @@ enum wined3d_shader_resource_type
#define WINED3D_SHADER_CONST_FFP_PS 0x00100000
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY 0x00200000
#define WINED3D_SHADER_CONST_BASE_VERTEX_ID 0x00400000
+#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND 0xff000000
+#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX(i) (0x01000000 << ((i) - 1))
enum wined3d_shader_register_type
{
--
2.7.4
2.14.1