Rebase against e4c9a2ec81b8029876d588e09587db40ab65ee69.

This commit is contained in:
Sebastian Lackner 2017-06-06 10:12:28 +02:00
parent 6ca029a4f6
commit d0ac86031a
13 changed files with 26 additions and 1244 deletions

View File

@ -1,25 +0,0 @@
From 8093970096f440a6accd5930a59fc44d32269356 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:52:21 +0200
Subject: d3d11: Remove duplicate const.
---
dlls/d3d11/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index fcf5d10a3b2..e84c3655e08 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3324,7 +3324,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
struct wined3d *wined3d;
unsigned int i;
- static const const struct
+ static const struct
{
enum wined3d_resource_type rtype;
unsigned int usage;
--
2.13.0

View File

@ -1,52 +0,0 @@
From e10972fe82b97754ac4fcce78adb52e629b753f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 26 Mar 2016 04:22:16 +0100
Subject: mf: Add stub for MFCreateMediaSession.
---
dlls/mf/main.c | 15 +++++++++++++++
dlls/mf/mf.spec | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/main.c b/dlls/mf/main.c
index 1b223ad..86f2774 100644
--- a/dlls/mf/main.c
+++ b/dlls/mf/main.c
@@ -21,6 +21,21 @@
#include "windef.h"
#include "winbase.h"
+#include "wine/debug.h"
+
+#include "mfidl.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mf);
+
+/***********************************************************************
+ * MFCreateMediaSession (mf.@)
+ */
+HRESULT WINAPI MFCreateMediaSession(IMFAttributes *configuration, IMFMediaSession **ms)
+{
+ FIXME("(%p, %p): stub\n", configuration, ms);
+
+ return E_NOTIMPL;
+}
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
diff --git a/dlls/mf/mf.spec b/dlls/mf/mf.spec
index 10b682a..546a697 100644
--- a/dlls/mf/mf.spec
+++ b/dlls/mf/mf.spec
@@ -39,7 +39,7 @@
@ stub MFCreateMP3MediaSink
@ stub MFCreateMPEG4MediaSink
@ stub MFCreateMediaProcessor
-@ stub MFCreateMediaSession
+@ stdcall MFCreateMediaSession(ptr ptr)
@ stub MFCreateNSCByteStreamPlugin
@ stub MFCreateNetSchemePlugin
@ stub MFCreatePMPHost
--
2.7.1

View File

@ -1,324 +0,0 @@
From 880ddd6aceac678a7059dea7b2673acd1a75bb77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 26 Mar 2016 06:05:20 +0100
Subject: mf: Implement IMFMediaSession stub interface.
---
dlls/mf/Makefile.in | 1 +
dlls/mf/main.c | 5 +-
dlls/mf/mf_private.h | 28 +++++++
dlls/mf/session.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++
dlls/mf/topology.c | 1 -
5 files changed, 253 insertions(+), 3 deletions(-)
create mode 100644 dlls/mf/mf_private.h
create mode 100644 dlls/mf/session.c
diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in
index 6725d5bf14a..9c61d94c8aa 100644
--- a/dlls/mf/Makefile.in
+++ b/dlls/mf/Makefile.in
@@ -3,4 +3,5 @@ IMPORTLIB = mf
C_SRCS = \
main.c \
+ session.c \
topology.c
diff --git a/dlls/mf/main.c b/dlls/mf/main.c
index 86f27741c9e..702618ffba5 100644
--- a/dlls/mf/main.c
+++ b/dlls/mf/main.c
@@ -23,7 +23,8 @@
#include "winbase.h"
#include "wine/debug.h"
-#include "mfidl.h"
+#include "initguid.h"
+#include "mf_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(mf);
@@ -34,7 +35,7 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *configuration, IMFMediaSessio
{
FIXME("(%p, %p): stub\n", configuration, ms);
- return E_NOTIMPL;
+ return create_session(ms);
}
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
diff --git a/dlls/mf/mf_private.h b/dlls/mf/mf_private.h
new file mode 100644
index 00000000000..36c05e7b050
--- /dev/null
+++ b/dlls/mf/mf_private.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 Michael Müller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_MF_MF_PRIVATE_H
+#define __WINE_MF_MF_PRIVATE_H
+
+#include "windef.h"
+#include "winbase.h"
+#include "mfidl.h"
+
+HRESULT create_session(IMFMediaSession **iface);
+
+#endif /* __WINE_MF_MF_PRIVATE_H */
diff --git a/dlls/mf/session.c b/dlls/mf/session.c
new file mode 100644
index 00000000000..931e53af5bd
--- /dev/null
+++ b/dlls/mf/session.c
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2016 Michael Müller
+ *
+ * iface library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * iface library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+#define COBJMACROS
+#include "mf_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mf);
+
+struct media_session
+{
+ IMFMediaSession IMFMediaSession_iface;
+ LONG ref;
+};
+
+static inline struct media_session *impl_from_IMFMediaSession(IMFMediaSession *iface)
+{
+ return CONTAINING_RECORD(iface, struct media_session, IMFMediaSession_iface);
+}
+
+static HRESULT WINAPI session_QueryInterface(IMFMediaSession *iface, REFIID riid, void **ppvObject)
+{
+ struct media_session *This = impl_from_IMFMediaSession(iface);
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
+
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IMFMediaEventGenerator) ||
+ IsEqualGUID(riid, &IID_IMFMediaSession))
+ {
+ *ppvObject = iface;
+ }
+ else
+ {
+ TRACE("Unsupported interface %s\n", debugstr_guid(riid));
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IMFMediaSession_AddRef(iface);
+ return S_OK;
+}
+
+static ULONG WINAPI session_AddRef(IMFMediaSession *iface)
+{
+ struct media_session *This = impl_from_IMFMediaSession(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p)->(%d)\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI session_Release(IMFMediaSession *iface)
+{
+ struct media_session *This = impl_from_IMFMediaSession(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p)->(%d)\n", This, ref);
+
+ if (!ref)
+ {
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI session_GetEvent(IMFMediaSession *iface, DWORD flags, IMFMediaEvent **event)
+{
+ FIXME("(%p, %d, %p): stub", iface, flags, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_BeginGetEvent(IMFMediaSession *iface, IMFAsyncCallback *callback, IUnknown *unk_state)
+{
+ FIXME("(%p, %p, %p): stub", iface, callback, unk_state);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_EndGetEvent(IMFMediaSession *iface, IMFAsyncResult *result, IMFMediaEvent **event)
+{
+ FIXME("(%p, %p, %p): stub", iface, result, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_QueueEvent(IMFMediaSession *iface, MediaEventType met, REFGUID extended_type, HRESULT status, const PROPVARIANT *value)
+{
+ FIXME("(%p, %d, %s, %x, %p): stub", iface, met, wine_dbgstr_guid(extended_type), status, value);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_SetTopology(IMFMediaSession *iface, DWORD flags, IMFTopology *topology)
+{
+ FIXME("(%p, %d, %p): stub", iface, flags, topology);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_ClearTopologies(IMFMediaSession *iface)
+{
+ FIXME("(%p): stub", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_Start(IMFMediaSession *iface, const GUID *format, const PROPVARIANT *start)
+{
+ FIXME("(%p, %s, %p): stub", iface, wine_dbgstr_guid(format), start);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_Pause(IMFMediaSession *iface)
+{
+ FIXME("(%p): stub", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_Stop(IMFMediaSession *iface)
+{
+ FIXME("(%p): stub", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_Close(IMFMediaSession *iface)
+{
+ FIXME("(%p): stub", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_Shutdown(IMFMediaSession *iface)
+{
+ FIXME("(%p): stub", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_GetClock(IMFMediaSession *iface, IMFClock **clock)
+{
+ FIXME("(%p, %p): stub", iface, clock);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_GetSessionCapabilities(IMFMediaSession *iface, DWORD *caps)
+{
+ FIXME("(%p, %p): stub", iface, caps);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI session_GetFullTopology(IMFMediaSession *iface, DWORD flags, TOPOID id, IMFTopology **topology)
+{
+ FIXME("(%p, %d, %s, %p): stub", iface, flags, wine_dbgstr_longlong(id), topology);
+
+ return E_NOTIMPL;
+}
+
+static const IMFMediaSessionVtbl sessionVtbl =
+{
+ session_QueryInterface,
+ session_AddRef,
+ session_Release,
+ session_GetEvent,
+ session_BeginGetEvent,
+ session_EndGetEvent,
+ session_QueueEvent,
+ session_SetTopology,
+ session_ClearTopologies,
+ session_Start,
+ session_Pause,
+ session_Stop,
+ session_Close,
+ session_Shutdown,
+ session_GetClock,
+ session_GetSessionCapabilities,
+ session_GetFullTopology
+};
+
+HRESULT create_session(IMFMediaSession **iface)
+{
+ struct media_session *This;
+
+ This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This));
+ if (!This) return E_OUTOFMEMORY;
+
+ This->IMFMediaSession_iface.lpVtbl = &sessionVtbl;
+ This->ref = 1;
+
+ *iface = &This->IMFMediaSession_iface;
+ return S_OK;
+}
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c
index 924d3863c85..40df4948b38 100644
--- a/dlls/mf/topology.c
+++ b/dlls/mf/topology.c
@@ -23,7 +23,6 @@
#include "windef.h"
#include "winbase.h"
-#include "initguid.h"
#include "mfidl.h"
#include "wine/debug.h"
--
2.13.0

View File

@ -1,2 +0,0 @@
Fixes: [39367] Return stub interface from mf.MFCreateMediaSession

View File

@ -1,71 +0,0 @@
From 265879650f33f8c39fb2ed7a1b08cb33f064fcb2 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 16:26:03 +0200
Subject: ntdll: Do not cast unaligned pointer to M128A in set_context_reg.
---
dlls/ntdll/signal_x86_64.c | 48 +++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index f3f14c998d8..6edf4b9a90d 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -1154,30 +1154,30 @@ static void set_context_reg( CONTEXT *context, ULONG_PTR dw_reg, void *val )
case 14: context->R14 = *(ULONG64 *)val; break;
case 15: context->R15 = *(ULONG64 *)val; break;
case 16: context->Rip = *(ULONG64 *)val; break;
- case 17: context->u.s.Xmm0 = *(M128A *)val; break;
- case 18: context->u.s.Xmm1 = *(M128A *)val; break;
- case 19: context->u.s.Xmm2 = *(M128A *)val; break;
- case 20: context->u.s.Xmm3 = *(M128A *)val; break;
- case 21: context->u.s.Xmm4 = *(M128A *)val; break;
- case 22: context->u.s.Xmm5 = *(M128A *)val; break;
- case 23: context->u.s.Xmm6 = *(M128A *)val; break;
- case 24: context->u.s.Xmm7 = *(M128A *)val; break;
- case 25: context->u.s.Xmm8 = *(M128A *)val; break;
- case 26: context->u.s.Xmm9 = *(M128A *)val; break;
- case 27: context->u.s.Xmm10 = *(M128A *)val; break;
- case 28: context->u.s.Xmm11 = *(M128A *)val; break;
- case 29: context->u.s.Xmm12 = *(M128A *)val; break;
- case 30: context->u.s.Xmm13 = *(M128A *)val; break;
- case 31: context->u.s.Xmm14 = *(M128A *)val; break;
- case 32: context->u.s.Xmm15 = *(M128A *)val; break;
- case 33: context->u.s.Legacy[0] = *(M128A *)val; break;
- case 34: context->u.s.Legacy[1] = *(M128A *)val; break;
- case 35: context->u.s.Legacy[2] = *(M128A *)val; break;
- case 36: context->u.s.Legacy[3] = *(M128A *)val; break;
- case 37: context->u.s.Legacy[4] = *(M128A *)val; break;
- case 38: context->u.s.Legacy[5] = *(M128A *)val; break;
- case 39: context->u.s.Legacy[6] = *(M128A *)val; break;
- case 40: context->u.s.Legacy[7] = *(M128A *)val; break;
+ case 17: memcpy( &context->u.s.Xmm0, val, sizeof(M128A) ); break;
+ case 18: memcpy( &context->u.s.Xmm1, val, sizeof(M128A) ); break;
+ case 19: memcpy( &context->u.s.Xmm2, val, sizeof(M128A) ); break;
+ case 20: memcpy( &context->u.s.Xmm3, val, sizeof(M128A) ); break;
+ case 21: memcpy( &context->u.s.Xmm4, val, sizeof(M128A) ); break;
+ case 22: memcpy( &context->u.s.Xmm5, val, sizeof(M128A) ); break;
+ case 23: memcpy( &context->u.s.Xmm6, val, sizeof(M128A) ); break;
+ case 24: memcpy( &context->u.s.Xmm7, val, sizeof(M128A) ); break;
+ case 25: memcpy( &context->u.s.Xmm8, val, sizeof(M128A) ); break;
+ case 26: memcpy( &context->u.s.Xmm9, val, sizeof(M128A) ); break;
+ case 27: memcpy( &context->u.s.Xmm10, val, sizeof(M128A) ); break;
+ case 28: memcpy( &context->u.s.Xmm11, val, sizeof(M128A) ); break;
+ case 29: memcpy( &context->u.s.Xmm12, val, sizeof(M128A) ); break;
+ case 30: memcpy( &context->u.s.Xmm13, val, sizeof(M128A) ); break;
+ case 31: memcpy( &context->u.s.Xmm14, val, sizeof(M128A) ); break;
+ case 32: memcpy( &context->u.s.Xmm15, val, sizeof(M128A) ); break;
+ case 33: memcpy( &context->u.s.Legacy[0], val, sizeof(M128A) ); break;
+ case 34: memcpy( &context->u.s.Legacy[1], val, sizeof(M128A) ); break;
+ case 35: memcpy( &context->u.s.Legacy[2], val, sizeof(M128A) ); break;
+ case 36: memcpy( &context->u.s.Legacy[3], val, sizeof(M128A) ); break;
+ case 37: memcpy( &context->u.s.Legacy[4], val, sizeof(M128A) ); break;
+ case 38: memcpy( &context->u.s.Legacy[5], val, sizeof(M128A) ); break;
+ case 39: memcpy( &context->u.s.Legacy[6], val, sizeof(M128A) ); break;
+ case 40: memcpy( &context->u.s.Legacy[7], val, sizeof(M128A) ); break;
}
}
--
2.13.0

View File

@ -1 +0,0 @@
Fixes: [43127] Avoid conversion from unaligned pointer to M128A

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "e5733e7cd40b41bb4d8c0409e9ed5be8fe6d5618"
echo "e4c9a2ec81b8029876d588e09587db40ab65ee69"
}
# Show version information
@ -204,7 +204,6 @@ patch_enable_all ()
enable_libs_Debug_Channel="$1"
enable_libs_Unicode_Collation="$1"
enable_makedep_PARENTSPEC="$1"
enable_mfplat_MFTRegister="$1"
enable_mmsystem_dll16_MIDIHDR_Refcount="$1"
enable_mountmgr_DosDevices="$1"
enable_mpr_WNetGetUniversalNameW="$1"
@ -281,7 +280,6 @@ patch_enable_all ()
enable_ntdll_Zero_mod_name="$1"
enable_ntdll__aulldvrm="$1"
enable_ntdll_call_thread_func_wrapper="$1"
enable_ntdll_set_context_reg="$1"
enable_ntoskrnl_DriverTest="$1"
enable_ntoskrnl_Stubs="$1"
enable_nvapi_Stub_DLL="$1"
@ -851,9 +849,6 @@ patch_enable ()
makedep-PARENTSPEC)
enable_makedep_PARENTSPEC="$2"
;;
mfplat-MFTRegister)
enable_mfplat_MFTRegister="$2"
;;
mmsystem.dll16-MIDIHDR_Refcount)
enable_mmsystem_dll16_MIDIHDR_Refcount="$2"
;;
@ -1082,9 +1077,6 @@ patch_enable ()
ntdll-call_thread_func_wrapper)
enable_ntdll_call_thread_func_wrapper="$2"
;;
ntdll-set_context_reg)
enable_ntdll_set_context_reg="$2"
;;
ntoskrnl-DriverTest)
enable_ntoskrnl_DriverTest="$2"
;;
@ -2621,17 +2613,16 @@ fi
# Patchset Compiler_Warnings
# |
# | Modified files:
# | * dlls/amstream/mediastreamfilter.c, dlls/d2d1/brush.c, dlls/d2d1/geometry.c, dlls/d3d11/device.c, dlls/d3d11/view.c,
# | dlls/d3d8/texture.c, dlls/d3d9/tests/visual.c, dlls/d3d9/texture.c, dlls/ddraw/viewport.c, dlls/dsound/primary.c,
# | dlls/dwrite/font.c, dlls/dwrite/layout.c, dlls/fusion/tests/asmenum.c, dlls/fusion/tests/asmname.c,
# | dlls/kernel32/oldconfig.c, dlls/kernel32/tests/heap.c, dlls/msxml3/schema.c, dlls/netapi32/netapi32.c,
# | dlls/ole32/storage32.h, dlls/oleaut32/oleaut.c, dlls/rpcrt4/cstub.c, dlls/rsaenh/rsaenh.c, dlls/shell32/shfldr_fs.c,
# | dlls/vbscript/vbdisp.c, dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c, dlls/ws2_32/tests/sock.c,
# | include/wine/list.h, include/wine/rbtree.h, include/winnt.h, tools/makedep.c
# | * dlls/amstream/mediastreamfilter.c, dlls/d2d1/brush.c, dlls/d2d1/geometry.c, dlls/d3d11/view.c, dlls/d3d8/texture.c,
# | dlls/d3d9/tests/visual.c, dlls/d3d9/texture.c, dlls/ddraw/viewport.c, dlls/dsound/primary.c, dlls/dwrite/font.c,
# | dlls/dwrite/layout.c, dlls/fusion/tests/asmenum.c, dlls/fusion/tests/asmname.c, dlls/kernel32/oldconfig.c,
# | dlls/kernel32/tests/heap.c, dlls/msxml3/schema.c, dlls/netapi32/netapi32.c, dlls/ole32/storage32.h,
# | dlls/oleaut32/oleaut.c, dlls/rpcrt4/cstub.c, dlls/rsaenh/rsaenh.c, dlls/shell32/shfldr_fs.c, dlls/vbscript/vbdisp.c,
# | dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c, dlls/ws2_32/tests/sock.c, include/wine/list.h,
# | include/wine/rbtree.h, include/winnt.h, tools/makedep.c
# |
if test "$enable_Compiler_Warnings" -eq 1; then
patch_apply Compiler_Warnings/0001-ole32-Fix-compilation-with-recent-versions-of-gcc.patch
patch_apply Compiler_Warnings/0002-d3d11-Remove-duplicate-const.patch
patch_apply Compiler_Warnings/0003-shell32-Fix-length-parameter-for-ZeroMemory.patch
patch_apply Compiler_Warnings/0004-fusion-Fix-length-parameter-for-ZeroMemory.patch
patch_apply Compiler_Warnings/0005-fusion-tests-Avoid-compiler-warnings-with-GCC-7.patch
@ -2655,7 +2646,6 @@ if test "$enable_Compiler_Warnings" -eq 1; then
patch_apply Compiler_Warnings/0031-include-Check-element-type-in-CONTAINING_RECORD-and-.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "ole32: Fix compilation with recent versions of gcc.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "d3d11: Remove duplicate const.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "shell32: Fix length parameter for ZeroMemory.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "fusion: Fix length parameter for ZeroMemory.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "fusion/tests: Avoid compiler warnings with GCC 7.", 1 },';
@ -5105,23 +5095,6 @@ if test "$enable_makedep_PARENTSPEC" -eq 1; then
) >> "$patchlist"
fi
# Patchset mfplat-MFTRegister
# |
# | This patchset fixes the following Wine bugs:
# | * [#39367] Return stub interface from mf.MFCreateMediaSession
# |
# | Modified files:
# | * dlls/mf/Makefile.in, dlls/mf/main.c, dlls/mf/mf.spec, dlls/mf/mf_private.h, dlls/mf/session.c, dlls/mf/topology.c
# |
if test "$enable_mfplat_MFTRegister" -eq 1; then
patch_apply mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch
patch_apply mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch
(
printf '%s\n' '+ { "Michael Müller", "mf: Add stub for MFCreateMediaSession.", 1 },';
printf '%s\n' '+ { "Michael Müller", "mf: Implement IMFMediaSession stub interface.", 1 },';
) >> "$patchlist"
fi
# Patchset mmsystem.dll16-MIDIHDR_Refcount
# |
# | This patchset fixes the following Wine bugs:
@ -6293,21 +6266,6 @@ if test "$enable_ntdll_call_thread_func_wrapper" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-set_context_reg
# |
# | This patchset fixes the following Wine bugs:
# | * [#43127] Avoid conversion from unaligned pointer to M128A
# |
# | Modified files:
# | * dlls/ntdll/signal_x86_64.c
# |
if test "$enable_ntdll_set_context_reg" -eq 1; then
patch_apply ntdll-set_context_reg/0001-ntdll-Do-not-cast-unaligned-pointer-to-M128A-in-set_.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Do not cast unaligned pointer to M128A in set_context_reg.", 1 },';
) >> "$patchlist"
fi
# Patchset ntoskrnl-DriverTest
# |
# | Modified files:
@ -8868,19 +8826,12 @@ fi
# | * [#20776] Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW
# |
# | Modified files:
# | * dlls/d3d10core/tests/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/context.c, dlls/wined3d/directx.c,
# | dlls/wined3d/query.c, dlls/wined3d/wined3d_gl.h, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h
# | * dlls/d3d10core/tests/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/query.c
# |
if test "$enable_wined3d_QUERY_Stubs" -eq 1; then
patch_apply wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch
patch_apply wined3d-QUERY_Stubs/0002-d3d11-Add-dummy-support-for-D3D11_QUERY_PIPELINE_STA.patch
patch_apply wined3d-QUERY_Stubs/0004-wined3d-Implement-WINED3D_QUERY_TYPE_PIPELINE_STATIS.patch
patch_apply wined3d-QUERY_Stubs/0005-d3d11-tests-Add-basic-test-for-D3D11_QUERY_PIPELINE_.patch
(
printf '%s\n' '+ { "Michael Müller", "wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW.", 1 },';
printf '%s\n' '+ { "Michael Müller", "d3d11: Add dummy support for D3D11_QUERY_PIPELINE_STATISTICS query.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Implement WINED3D_QUERY_TYPE_PIPELINE_STATISTICS.", 1 },';
printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add basic test for D3D11_QUERY_PIPELINE_STATISTICS.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,4 +1,4 @@
From 4d4320e632de06b391bb6ddff4376f7aabe92d51 Mon Sep 17 00:00:00 2001
From b73fce3206de216ebb9423caae4bcc02d64de261 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 3 Aug 2014 02:23:44 +0200
Subject: shell32: Add support for extra large and jumbo icon lists. (v2)
@ -340,11 +340,11 @@ index 0ea2eb9e0e8..767c90e8e71 100644
* PidlToSicIndex [INTERNAL]
*
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 941ca74f321..3007bbf4539 100644
index fc2a5ba8a86..b91bb5528ad 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -236,4 +236,7 @@ static inline WCHAR *strdupW(const WCHAR *src)
return dest;
@@ -251,4 +251,7 @@ static inline WCHAR *strdupAtoW(const char *str)
return ret;
}
+void SHELL_GetInternalImageLists(HIMAGELIST *lpSmallList, HIMAGELIST *lpLargeList,
@ -413,5 +413,5 @@ index ad254c83498..03878af46dd 100644
IImageList_GetIconSize( list, &width, &height );
switch (i)
--
2.12.2
2.13.0

View File

@ -1,4 +1,4 @@
From e673885709da5bb4d6e13bb9c005ef590768e198 Mon Sep 17 00:00:00 2001
From 80ad1268188358c71be2e7320e3169a7df6995d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 16 Apr 2016 18:18:54 +0200
Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and
@ -11,12 +11,12 @@ Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and
3 files changed, 104 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 364a2abfe7f..c08004723cc 100644
index 311ffeb82ba..9958feb1c25 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -3826,8 +3826,8 @@ static void test_create_query(void)
{D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE},
{D3D10_QUERY_PIPELINE_STATISTICS, FALSE, TRUE},
{D3D10_QUERY_PIPELINE_STATISTICS, FALSE, FALSE},
{D3D10_QUERY_OCCLUSION_PREDICATE, TRUE, FALSE},
- {D3D10_QUERY_SO_STATISTICS, FALSE, TRUE},
- {D3D10_QUERY_SO_OVERFLOW_PREDICATE, TRUE, TRUE},
@ -26,12 +26,12 @@ index 364a2abfe7f..c08004723cc 100644
ULONG refcount, expected_refcount;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index b160977caec..a56bcd91f70 100644
index a3f2c9879b4..28859f897bd 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4600,8 +4600,8 @@ static void test_create_query(void)
{D3D11_QUERY_TIMESTAMP_DISJOINT, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
{D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_OCCLUSION_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
- {D3D11_QUERY_SO_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
- {D3D11_QUERY_SO_OVERFLOW_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, TRUE},
@ -41,10 +41,10 @@ index b160977caec..a56bcd91f70 100644
{D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, D3D_FEATURE_LEVEL_11_0, TRUE, FALSE, TRUE},
{D3D11_QUERY_SO_STATISTICS_STREAM1, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, FALSE},
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 55871130ce0..3c7a3ae4f8a 100644
index 8445922423f..30b1d8d7a70 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -729,6 +729,34 @@ static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, D
@@ -860,6 +860,34 @@ static BOOL wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD
return poll;
}
@ -79,7 +79,7 @@ index 55871130ce0..3c7a3ae4f8a 100644
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
{
struct wined3d_event_query *event_query = wined3d_event_query_from_query(query);
@@ -981,6 +1009,72 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
@@ -1143,6 +1171,72 @@ static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
@ -152,9 +152,9 @@ index 55871130ce0..3c7a3ae4f8a 100644
HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
{
@@ -1008,6 +1102,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3:
return wined3d_so_statistics_query_create(device, type, parent, parent_ops, query);
@@ -1173,6 +1267,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_PIPELINE_STATISTICS:
return wined3d_pipeline_query_create(device, type, parent, parent_ops, query);
+ case WINED3D_QUERY_TYPE_SO_STATISTICS:
+ return wined3d_statistics_query_create(device, type, parent, parent_ops, query);
@ -166,5 +166,5 @@ index 55871130ce0..3c7a3ae4f8a 100644
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
--
2.12.2
2.13.0

View File

@ -1,142 +0,0 @@
From 6313efefb1d2dc0adaaae123cee74678e0709fee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 22 Jan 2017 01:51:51 +0100
Subject: d3d11: Add dummy support for D3D11_QUERY_PIPELINE_STATISTICS query.
---
dlls/d3d10core/tests/device.c | 2 +-
dlls/d3d11/tests/d3d11.c | 2 +-
dlls/wined3d/query.c | 50 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 15 +++++++++++++
4 files changed, 67 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index c08004723cc..9958feb1c25 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -3824,7 +3824,7 @@ static void test_create_query(void)
{D3D10_QUERY_OCCLUSION, FALSE, FALSE},
{D3D10_QUERY_TIMESTAMP, FALSE, FALSE},
{D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE},
- {D3D10_QUERY_PIPELINE_STATISTICS, FALSE, TRUE},
+ {D3D10_QUERY_PIPELINE_STATISTICS, FALSE, FALSE},
{D3D10_QUERY_OCCLUSION_PREDICATE, TRUE, FALSE},
{D3D10_QUERY_SO_STATISTICS, FALSE, FALSE},
{D3D10_QUERY_SO_OVERFLOW_PREDICATE, TRUE, FALSE},
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index a56bcd91f70..9c4b0392014 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4598,7 +4598,7 @@ static void test_create_query(void)
{D3D11_QUERY_OCCLUSION, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_TIMESTAMP, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_TIMESTAMP_DISJOINT, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
- {D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
+ {D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_OCCLUSION_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
{D3D11_QUERY_SO_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_SO_OVERFLOW_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 3c7a3ae4f8a..1da1b3ea7ae 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -757,6 +757,20 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
return FALSE;
}
+static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD flags)
+{
+ TRACE("query %p, flags %#x.\n", query, flags);
+
+ return TRUE;
+}
+
+static BOOL wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD flags)
+{
+ FIXME("query %p, flags %#x.\n", query, flags);
+
+ return FALSE;
+}
+
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
{
struct wined3d_event_query *event_query = wined3d_event_query_from_query(query);
@@ -1075,6 +1089,39 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
+static void wined3d_pipeline_query_ops_destroy(struct wined3d_query *query)
+{
+ HeapFree(GetProcessHeap(), 0, query);
+}
+
+static const struct wined3d_query_ops pipeline_query_ops =
+{
+ wined3d_pipeline_query_ops_poll,
+ wined3d_pipeline_query_ops_issue,
+ wined3d_pipeline_query_ops_destroy,
+};
+
+static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
+ enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops,
+ struct wined3d_query **query)
+{
+ static const struct wined3d_query_data_pipeline_statistics data;
+ struct wined3d_query *object;
+
+ FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query);
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ wined3d_query_init(object, device, type, &data,
+ sizeof(data), &pipeline_query_ops, parent, parent_ops);
+
+ TRACE("Created query %p.\n", object);
+ *query = object;
+
+ return WINED3D_OK;
+}
+
HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
{
@@ -1108,6 +1155,9 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_SO_OVERFLOW:
return wined3d_overflow_query_create(device, type, parent, parent_ops, query);
+ case WINED3D_QUERY_TYPE_PIPELINE_STATISTICS:
+ return wined3d_pipeline_query_create(device, type, parent, parent_ops, query);
+
default:
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 8697fbfa935..b81bc437efe 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -725,6 +725,21 @@ struct wined3d_query_data_so_statistics
UINT64 primitives_generated;
};
+struct wined3d_query_data_pipeline_statistics
+{
+ UINT64 ia_vertices;
+ UINT64 ia_primitives;
+ UINT64 vs_invocations;
+ UINT64 gs_invocations;
+ UINT64 gs_primitives;
+ UINT64 c_invocations;
+ UINT64 c_primitives;
+ UINT64 ps_invocations;
+ UINT64 hs_invocations;
+ UINT64 ds_invocations;
+ UINT64 cs_invocations;
+};
+
#define WINED3DISSUE_BEGIN (1u << 1)
#define WINED3DISSUE_END (1u << 0)
#define WINED3DGETDATA_FLUSH (1u << 0)
--
2.12.2

View File

@ -1,444 +0,0 @@
From a36cd6cf41376b8dae38c289d353da26ecf53ee3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 28 May 2017 04:49:57 +0200
Subject: wined3d: Implement WINED3D_QUERY_TYPE_PIPELINE_STATISTICS.
---
dlls/wined3d/context.c | 58 ++++++++++++
dlls/wined3d/directx.c | 1 +
dlls/wined3d/query.c | 197 +++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/wined3d_gl.h | 1 +
dlls/wined3d/wined3d_private.h | 39 ++++++++
5 files changed, 287 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8ab0e10d815..b03287f5029 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -933,6 +933,43 @@ void context_free_so_statistics_query(struct wined3d_so_statistics_query *query)
context->free_so_statistics_queries[context->free_so_statistics_query_count++] = query->u;
}
+void context_alloc_pipeline_statistics_query(struct wined3d_context *context,
+ struct wined3d_pipeline_statistics_query *query)
+{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+
+ if (context->free_pipeline_statistics_query_count)
+ {
+ query->u = context->free_pipeline_statistics_queries[--context->free_pipeline_statistics_query_count];
+ }
+ else
+ {
+ GL_EXTCALL(glGenQueries(ARRAY_SIZE(query->u.id), query->u.id));
+ checkGLcall("glGenQueries");
+ }
+
+ query->context = context;
+ list_add_head(&context->pipeline_statistics_queries, &query->entry);
+}
+
+void context_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query)
+{
+ struct wined3d_context *context = query->context;
+
+ list_remove(&query->entry);
+ query->context = NULL;
+
+ if (!wined3d_array_reserve((void **)&context->free_pipeline_statistics_queries,
+ &context->free_pipeline_statistics_query_size, context->free_pipeline_statistics_query_count + 1,
+ sizeof(*context->free_pipeline_statistics_queries)))
+ {
+ ERR("Failed to grow free list, leaking GL queries in context %p.\n", context);
+ return;
+ }
+
+ context->free_pipeline_statistics_queries[context->free_pipeline_statistics_query_count++] = query->u;
+}
+
typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry);
static void context_enum_fbo_entries(const struct wined3d_device *device,
@@ -1225,6 +1262,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_so_statistics_query *so_statistics_query;
+ struct wined3d_pipeline_statistics_query *pipeline_statistics_query;
struct wined3d_timestamp_query *timestamp_query;
struct wined3d_occlusion_query *occlusion_query;
struct wined3d_event_query *event_query;
@@ -1249,6 +1287,14 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
so_statistics_query->context = NULL;
}
+ LIST_FOR_EACH_ENTRY(pipeline_statistics_query, &context->pipeline_statistics_queries,
+ struct wined3d_pipeline_statistics_query, entry)
+ {
+ if (context->valid)
+ GL_EXTCALL(glDeleteQueries(ARRAY_SIZE(pipeline_statistics_query->u.id), pipeline_statistics_query->u.id));
+ pipeline_statistics_query->context = NULL;
+ }
+
LIST_FOR_EACH_ENTRY(timestamp_query, &context->timestamp_queries, struct wined3d_timestamp_query, entry)
{
if (context->valid)
@@ -1305,6 +1351,15 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
}
}
+ if (gl_info->supported[ARB_PIPELINE_STATISTICS_QUERY])
+ {
+ for (i = 0; i < context->free_pipeline_statistics_query_count; ++i)
+ {
+ union wined3d_gl_pipeline_statistics_query *q = &context->free_pipeline_statistics_queries[i];
+ GL_EXTCALL(glDeleteQueries(ARRAY_SIZE(q->id), q->id));
+ }
+ }
+
if (gl_info->supported[ARB_TIMER_QUERY])
GL_EXTCALL(glDeleteQueries(context->free_timestamp_query_count, context->free_timestamp_queries));
@@ -1337,6 +1392,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
}
HeapFree(GetProcessHeap(), 0, context->free_so_statistics_queries);
+ HeapFree(GetProcessHeap(), 0, context->free_pipeline_statistics_queries);
HeapFree(GetProcessHeap(), 0, context->free_timestamp_queries);
HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, context->free_event_queries);
@@ -1801,6 +1857,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
list_init(&ret->so_statistics_queries);
+ list_init(&ret->pipeline_statistics_queries);
+
list_init(&ret->fbo_list);
list_init(&ret->fbo_destroy_list);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e6cefbd2cf2..ec53192b76f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -144,6 +144,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_ARB_multisample", ARB_MULTISAMPLE },
{"GL_ARB_multitexture", ARB_MULTITEXTURE },
{"GL_ARB_occlusion_query", ARB_OCCLUSION_QUERY },
+ {"GL_ARB_pipeline_statistics_query", ARB_PIPELINE_STATISTICS_QUERY },
{"GL_ARB_pixel_buffer_object", ARB_PIXEL_BUFFER_OBJECT },
{"GL_ARB_point_parameters", ARB_POINT_PARAMETERS },
{"GL_ARB_point_sprite", ARB_POINT_SPRITE },
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 1da1b3ea7ae..3bac4e1d28f 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -61,6 +61,11 @@ static struct wined3d_so_statistics_query *wined3d_so_statistics_query_from_quer
return CONTAINING_RECORD(query, struct wined3d_so_statistics_query, query);
}
+static struct wined3d_pipeline_statistics_query *wined3d_pipeline_statistics_query_from_query(struct wined3d_query *query)
+{
+ return CONTAINING_RECORD(query, struct wined3d_pipeline_statistics_query, query);
+}
+
BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info)
{
return gl_info->supported[ARB_SYNC] || gl_info->supported[NV_FENCE] || gl_info->supported[APPLE_FENCE];
@@ -759,16 +764,179 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD flags)
{
+ struct wined3d_pipeline_statistics_query *pq = wined3d_pipeline_statistics_query_from_query(query);
+ struct wined3d_device *device = query->device;
+ const struct wined3d_gl_info *gl_info;
+ struct wined3d_context *context;
+ GLuint available;
+ int i;
+
TRACE("query %p, flags %#x.\n", query, flags);
- return TRUE;
+ if (!(context = context_reacquire(device, pq->context)))
+ {
+ FIXME("%p Wrong thread, returning 0 primitives.\n", query);
+ memset(&pq->statistics, 0, sizeof(pq->statistics));
+ return TRUE;
+ }
+ gl_info = context->gl_info;
+
+ for (i = 0; i < ARRAY_SIZE(pq->u.id); i++)
+ {
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.id[i], GL_QUERY_RESULT_AVAILABLE, &available));
+ if (!available) goto done;
+ }
+
+ if (gl_info->supported[ARB_TIMER_QUERY])
+ {
+ GLuint64 result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.vertices, GL_QUERY_RESULT, &result));
+ pq->statistics.ia_vertices = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.primitives, GL_QUERY_RESULT, &result));
+ pq->statistics.ia_primitives = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.vertex_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.vs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.tess_control_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.hs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.tess_eval_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.ds_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.geometry_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.gs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.geometry_primitives, GL_QUERY_RESULT, &result));
+ pq->statistics.gs_primitives = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.fragment_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.ps_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.compute_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.cs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.clipping_input, GL_QUERY_RESULT, &result));
+ pq->statistics.c_invocations = result;
+ GL_EXTCALL(glGetQueryObjectui64v(pq->u.query.clipping_output, GL_QUERY_RESULT, &result));
+ pq->statistics.c_primitives = result;
+ }
+ else
+ {
+ GLuint result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.vertices, GL_QUERY_RESULT, &result));
+ pq->statistics.ia_vertices = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.primitives, GL_QUERY_RESULT, &result));
+ pq->statistics.ia_primitives = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.vertex_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.vs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.tess_control_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.hs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.tess_eval_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.ds_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.geometry_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.gs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.geometry_primitives, GL_QUERY_RESULT, &result));
+ pq->statistics.gs_primitives = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.fragment_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.ps_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.compute_shader, GL_QUERY_RESULT, &result));
+ pq->statistics.cs_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.clipping_input, GL_QUERY_RESULT, &result));
+ pq->statistics.c_invocations = result;
+ GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.clipping_output, GL_QUERY_RESULT, &result));
+ pq->statistics.c_primitives = result;
+ }
+
+done:
+ checkGLcall("poll pipeline statistics query");
+ context_release(context);
+ return available;
}
static BOOL wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD flags)
{
- FIXME("query %p, flags %#x.\n", query, flags);
+ struct wined3d_pipeline_statistics_query *pq = wined3d_pipeline_statistics_query_from_query(query);
+ struct wined3d_device *device = query->device;
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
+ struct wined3d_context *context;
+ BOOL poll = FALSE;
- return FALSE;
+ TRACE("query %p, flags %#x.\n", query, flags);
+
+ if (flags & WINED3DISSUE_BEGIN)
+ {
+ if (pq->started)
+ {
+ if ((context = context_reacquire(device, pq->context)))
+ {
+ GL_EXTCALL(glEndQuery(GL_VERTICES_SUBMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_PRIMITIVES_SUBMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_VERTEX_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_TESS_CONTROL_SHADER_PATCHES_ARB));
+ GL_EXTCALL(glEndQuery(GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_GEOMETRY_SHADER_INVOCATIONS));
+ GL_EXTCALL(glEndQuery(GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_FRAGMENT_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_COMPUTE_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_CLIPPING_INPUT_PRIMITIVES_ARB));
+ GL_EXTCALL(glEndQuery(GL_CLIPPING_OUTPUT_PRIMITIVES_ARB));
+ }
+ else
+ {
+ FIXME("Wrong thread, can't restart query.\n");
+ context_free_pipeline_statistics_query(pq);
+ context = context_acquire(device, NULL, 0);
+ context_alloc_pipeline_statistics_query(context, pq);
+ }
+ }
+ else
+ {
+ if (pq->context)
+ context_free_pipeline_statistics_query(pq);
+ context = context_acquire(device, NULL, 0);
+ context_alloc_pipeline_statistics_query(context, pq);
+ }
+
+ GL_EXTCALL(glBeginQuery(GL_VERTICES_SUBMITTED_ARB, pq->u.query.vertices));
+ GL_EXTCALL(glBeginQuery(GL_PRIMITIVES_SUBMITTED_ARB, pq->u.query.primitives));
+ GL_EXTCALL(glBeginQuery(GL_VERTEX_SHADER_INVOCATIONS_ARB, pq->u.query.vertex_shader));
+ GL_EXTCALL(glBeginQuery(GL_TESS_CONTROL_SHADER_PATCHES_ARB, pq->u.query.tess_control_shader));
+ GL_EXTCALL(glBeginQuery(GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB, pq->u.query.tess_eval_shader));
+ GL_EXTCALL(glBeginQuery(GL_GEOMETRY_SHADER_INVOCATIONS, pq->u.query.geometry_shader));
+ GL_EXTCALL(glBeginQuery(GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB, pq->u.query.geometry_primitives));
+ GL_EXTCALL(glBeginQuery(GL_FRAGMENT_SHADER_INVOCATIONS_ARB, pq->u.query.fragment_shader));
+ GL_EXTCALL(glBeginQuery(GL_COMPUTE_SHADER_INVOCATIONS_ARB, pq->u.query.compute_shader));
+ GL_EXTCALL(glBeginQuery(GL_CLIPPING_INPUT_PRIMITIVES_ARB, pq->u.query.clipping_input));
+ GL_EXTCALL(glBeginQuery(GL_CLIPPING_OUTPUT_PRIMITIVES_ARB, pq->u.query.clipping_output));
+ checkGLcall("begin query");
+
+ context_release(context);
+ pq->started = TRUE;
+ }
+ if (flags & WINED3DISSUE_END)
+ {
+ if (pq->started)
+ {
+ if ((context = context_reacquire(device, pq->context)))
+ {
+ GL_EXTCALL(glEndQuery(GL_VERTICES_SUBMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_PRIMITIVES_SUBMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_VERTEX_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_TESS_CONTROL_SHADER_PATCHES_ARB));
+ GL_EXTCALL(glEndQuery(GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_GEOMETRY_SHADER_INVOCATIONS));
+ GL_EXTCALL(glEndQuery(GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB));
+ GL_EXTCALL(glEndQuery(GL_FRAGMENT_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_COMPUTE_SHADER_INVOCATIONS_ARB));
+ GL_EXTCALL(glEndQuery(GL_CLIPPING_INPUT_PRIMITIVES_ARB));
+ GL_EXTCALL(glEndQuery(GL_CLIPPING_OUTPUT_PRIMITIVES_ARB));
+ checkGLcall("end query");
+
+ context_release(context);
+ poll = TRUE;
+ }
+ else
+ {
+ FIXME("Wrong thread, can't end query.\n");
+ }
+ }
+ pq->started = FALSE;
+ }
+
+ return poll;
}
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
@@ -1091,6 +1259,10 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
static void wined3d_pipeline_query_ops_destroy(struct wined3d_query *query)
{
+ struct wined3d_pipeline_statistics_query *pq = wined3d_pipeline_statistics_query_from_query(query);
+
+ if (pq->context)
+ context_free_pipeline_statistics_query(pq);
HeapFree(GetProcessHeap(), 0, query);
}
@@ -1105,19 +1277,26 @@ static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_query **query)
{
- static const struct wined3d_query_data_pipeline_statistics data;
- struct wined3d_query *object;
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
+ struct wined3d_pipeline_statistics_query *object;
- FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query);
+ TRACE("device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
+ device, type, parent, parent_ops, query);
+
+ if (!gl_info->supported[ARB_PIPELINE_STATISTICS_QUERY])
+ {
+ WARN("OpenGL implementation does not support pipeline statistic queries.\n");
+ return WINED3DERR_NOTAVAILABLE;
+ }
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
- wined3d_query_init(object, device, type, &data,
- sizeof(data), &pipeline_query_ops, parent, parent_ops);
+ wined3d_query_init(&object->query, device, type, &object->statistics,
+ sizeof(object->statistics), &pipeline_query_ops, parent, parent_ops);
TRACE("Created query %p.\n", object);
- *query = object;
+ *query = &object->query;
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 3806869fd42..8b25220cd4b 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -78,6 +78,7 @@ enum wined3d_gl_extension
ARB_MULTISAMPLE,
ARB_MULTITEXTURE,
ARB_OCCLUSION_QUERY,
+ ARB_PIPELINE_STATISTICS_QUERY,
ARB_PIXEL_BUFFER_OBJECT,
ARB_POINT_PARAMETERS,
ARB_POINT_SPRITE,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 18109850157..1025c98f180 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1721,6 +1721,40 @@ void context_alloc_so_statistics_query(struct wined3d_context *context,
struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN;
void context_free_so_statistics_query(struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN;
+union wined3d_gl_pipeline_statistics_query
+{
+ GLuint id[11];
+ struct
+ {
+ GLuint vertices;
+ GLuint primitives;
+ GLuint vertex_shader;
+ GLuint tess_control_shader;
+ GLuint tess_eval_shader;
+ GLuint geometry_shader;
+ GLuint geometry_primitives;
+ GLuint fragment_shader;
+ GLuint compute_shader;
+ GLuint clipping_input;
+ GLuint clipping_output;
+ } query;
+};
+
+struct wined3d_pipeline_statistics_query
+{
+ struct wined3d_query query;
+
+ struct list entry;
+ union wined3d_gl_pipeline_statistics_query u;
+ struct wined3d_context *context;
+ struct wined3d_query_data_pipeline_statistics statistics;
+ BOOL started;
+};
+
+void context_alloc_pipeline_statistics_query(struct wined3d_context *context,
+ struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN;
+void context_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN;
+
struct wined3d_gl_view
{
GLenum target;
@@ -1857,6 +1891,11 @@ struct wined3d_context
unsigned int free_so_statistics_query_count;
struct list so_statistics_queries;
+ union wined3d_gl_pipeline_statistics_query *free_pipeline_statistics_queries;
+ SIZE_T free_pipeline_statistics_query_size;
+ unsigned int free_pipeline_statistics_query_count;
+ struct list pipeline_statistics_queries;
+
struct wined3d_stream_info stream_info;
/* Fences for GL_APPLE_flush_buffer_range */
--
2.12.2

View File

@ -1,107 +0,0 @@
From 4aefdfaa464c49aeece5e1803478a63bcdb55562 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 28 May 2017 04:52:59 +0200
Subject: d3d11/tests: Add basic test for D3D11_QUERY_PIPELINE_STATISTICS.
---
dlls/d3d11/tests/d3d11.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 5a14dd4d55c..8fe6835c831 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -5380,6 +5380,82 @@ if (0)
release_test_context(&test_context);
}
+static void test_pipeline_query(void)
+{
+ static const struct vec4 red = {1.0f, 0.0f, 0.0f, 1.0f};
+ static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+
+ D3D11_QUERY_DATA_PIPELINE_STATISTICS data;
+ struct d3d11_test_context test_context;
+ ID3D11DeviceContext *context;
+ D3D11_QUERY_DESC query_desc;
+ ID3D11Asynchronous *query;
+ unsigned int data_size, i;
+ ID3D11Device *device;
+ HRESULT hr;
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+
+ device = test_context.device;
+ context = test_context.immediate_context;
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white);
+
+ query_desc.Query = D3D11_QUERY_PIPELINE_STATISTICS;
+ query_desc.MiscFlags = 0;
+ hr = ID3D11Device_CreateQuery(device, &query_desc, (ID3D11Query **)&query);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ data_size = ID3D11Asynchronous_GetDataSize(query);
+ ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
+
+ memset(&data, 0xff, sizeof(data));
+ hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
+ ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
+
+ ID3D11DeviceContext_End(context, query);
+ ID3D11DeviceContext_Begin(context, query);
+ ID3D11DeviceContext_Begin(context, query);
+
+ memset(&data, 0xff, sizeof(data));
+ hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0);
+ todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
+ todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
+ ok(data.IAVertices == 0xffffffffffffffff, "Data was modified.\n");
+
+ draw_color_quad(&test_context, &red);
+
+ ID3D11DeviceContext_End(context, query);
+ for (i = 0; i < 500; ++i)
+ {
+ if ((hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0)) != S_FALSE)
+ break;
+ Sleep(10);
+ }
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ memset(&data, 0xff, sizeof(data));
+ hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u\n", (unsigned int)data.IAVertices);
+ ok(data.IAPrimitives == 2, "Got unexpected IAPrimitives count: %u\n", (unsigned int)data.IAPrimitives);
+ ok(data.VSInvocations == 4, "Got unexpected VSInvocations count: %u\n", (unsigned int)data.VSInvocations);
+ ok(data.GSInvocations == 0, "Got unexpected GSInvocations count: %u\n", (unsigned int)data.GSInvocations);
+ ok(data.GSPrimitives == 0, "Got unexpected GSPrimitives count: %u\n", (unsigned int)data.GSPrimitives);
+ ok(data.CInvocations == 2, "Got unexpected CInvocations count: %u\n", (unsigned int)data.CInvocations);
+ ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u\n", (unsigned int)data.CPrimitives);
+ ok(data.PSInvocations >= 640*480, "Got unexpected PSInvocations count: %u\n", (unsigned int)data.PSInvocations);
+ ok(data.HSInvocations == 0, "Got unexpected HSInvocations count: %u\n", (unsigned int)data.HSInvocations);
+ ok(data.DSInvocations == 0, "Got unexpected DSInvocations count: %u\n", (unsigned int)data.DSInvocations);
+ ok(data.CSInvocations == 0, "Got unexpected CSInvocations count: %u\n", (unsigned int)data.CSInvocations);
+
+ ID3D11Asynchronous_Release(query);
+ release_test_context(&test_context);
+}
+
static void test_timestamp_query(void)
{
static const struct vec4 red = {1.0f, 0.0f, 0.0f, 1.0f};
@@ -21008,6 +21084,7 @@ START_TEST(d3d11)
test_create_rasterizer_state();
test_create_query();
test_occlusion_query();
+ test_pipeline_query();
test_timestamp_query();
test_device_removed_reason();
test_private_data();
--
2.12.2

View File

@ -1,2 +1 @@
Fixes: [20776] Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW
Fixes: Add implementation for QUERY_TYPE_PIPELINE_STATISTICS