mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against cfb67712ce35c05d6b7d27ece84c9192e66290b4
This commit is contained in:
parent
b05c091935
commit
e38104d365
@ -152,7 +152,7 @@ index dfe2f871d42..808547ddbc0 100644
|
||||
|
||||
+ AllocateAndInitializeSid(&domain_ident, 4, SECURITY_NT_NON_UNIQUE, 0, 0, 0, 0, 0, 0, 0, &domain_sid);
|
||||
+
|
||||
for(i = 0; i < sizeof(strsid_table) / sizeof(strsid_table[0]); i++)
|
||||
for(i = 0; i < ARRAY_SIZE(strsid_table); i++)
|
||||
{
|
||||
- char *temp;
|
||||
-
|
||||
|
@ -1,239 +0,0 @@
|
||||
From a33160eef805e950e8b3c36c74f0688ca9e2328e Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 7 Feb 2016 12:52:26 +0800
|
||||
Subject: avifil32: Add support for AVIFile interface proxies. [v2]
|
||||
|
||||
---
|
||||
dlls/avifil32/Makefile.in | 4 +-
|
||||
dlls/avifil32/avifil32.idl | 25 ++++++----
|
||||
dlls/avifil32/avifile_ifaces.idl | 105 +++++++++++++++++++++++++++++++++++++++
|
||||
dlls/avifil32/avifile_private.h | 1 +
|
||||
dlls/avifil32/factory.c | 8 ++-
|
||||
5 files changed, 130 insertions(+), 13 deletions(-)
|
||||
create mode 100644 dlls/avifil32/avifile_ifaces.idl
|
||||
|
||||
diff --git a/dlls/avifil32/Makefile.in b/dlls/avifil32/Makefile.in
|
||||
index 81d2ff8..4030514 100644
|
||||
--- a/dlls/avifil32/Makefile.in
|
||||
+++ b/dlls/avifil32/Makefile.in
|
||||
@@ -1,6 +1,6 @@
|
||||
MODULE = avifil32.dll
|
||||
IMPORTLIB = avifil32
|
||||
-IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32
|
||||
+IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32 rpcrt4
|
||||
|
||||
C_SRCS = \
|
||||
acmstream.c \
|
||||
@@ -17,3 +17,5 @@ C_SRCS = \
|
||||
IDL_SRCS = avifil32.idl
|
||||
|
||||
RC_SRCS = avifil32.rc
|
||||
+
|
||||
+dlldata_EXTRADEFS = -DENTRY_PREFIX=avifil32_
|
||||
diff --git a/dlls/avifil32/avifil32.idl b/dlls/avifil32/avifil32.idl
|
||||
index 1f50f15..e23c176 100644
|
||||
--- a/dlls/avifil32/avifil32.idl
|
||||
+++ b/dlls/avifil32/avifil32.idl
|
||||
@@ -18,39 +18,42 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
+#pragma makedep proxy
|
||||
#pragma makedep register
|
||||
|
||||
+#include "avifile_ifaces.idl"
|
||||
+
|
||||
+[
|
||||
+ helpstring("IAVIStream & IAVIFile Proxy"),
|
||||
+ threading(both),
|
||||
+ uuid(0002000d-0000-0000-c000-000000000046)
|
||||
+]
|
||||
+coclass PSFactoryBuffer { interface IFactoryBuffer; }
|
||||
+
|
||||
[
|
||||
helpstring("Microsoft AVI Files"),
|
||||
- threading(apartment),
|
||||
+ threading(both),
|
||||
uuid(00020000-0000-0000-C000-000000000046)
|
||||
]
|
||||
coclass AVIFile { interface IAVIFile; }
|
||||
|
||||
[
|
||||
helpstring("AVI Compressed Stream"),
|
||||
- threading(apartment),
|
||||
+ threading(both),
|
||||
uuid(00020001-0000-0000-c000-000000000046)
|
||||
]
|
||||
coclass ICMStream { interface IAVIStream; }
|
||||
|
||||
[
|
||||
helpstring("Microsoft Wave File"),
|
||||
- threading(apartment),
|
||||
+ threading(both),
|
||||
uuid(00020003-0000-0000-c000-000000000046)
|
||||
]
|
||||
coclass WAVFile { interface IAVIFile; }
|
||||
|
||||
[
|
||||
- helpstring("IAVIStream & IAVIFile Proxy"),
|
||||
- threading(apartment),
|
||||
- uuid(0002000d-0000-0000-c000-000000000046)
|
||||
-]
|
||||
-coclass AVIProxy { }
|
||||
-
|
||||
-[
|
||||
helpstring("ACM Compressed Audio Stream"),
|
||||
- threading(apartment),
|
||||
+ threading(both),
|
||||
uuid(0002000f-0000-0000-c000-000000000046)
|
||||
]
|
||||
coclass ACMStream { interface IAVIStream; }
|
||||
diff --git a/dlls/avifil32/avifile_ifaces.idl b/dlls/avifil32/avifile_ifaces.idl
|
||||
new file mode 100644
|
||||
index 0000000..f9280e5
|
||||
--- /dev/null
|
||||
+++ b/dlls/avifil32/avifile_ifaces.idl
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * Proxy support for avifil32
|
||||
+ *
|
||||
+ * Copyright 2016 Dmitry Timoshkov
|
||||
+ *
|
||||
+ * 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
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * These interface descriptions are supposed to be used for automatic proxy
|
||||
+ * generation by an IDL compiler.
|
||||
+ *
|
||||
+ * While it's possible to convert include/vfw.h to an .idl, that's proved to
|
||||
+ * be a major waste of an effort because the resulting interface descriptions
|
||||
+ * can't be used for automatic proxy generation since they are not compatible
|
||||
+ * with IDL compiler restrictions for proxies, and fixing them up would make
|
||||
+ * generated vfw.h source incompatible with PSDK's equivalent.
|
||||
+ */
|
||||
+
|
||||
+import "wtypes.idl";
|
||||
+import "unknwn.idl";
|
||||
+
|
||||
+typedef struct _AVISTREAMINFOW
|
||||
+{
|
||||
+ DWORD fccType;
|
||||
+ DWORD fccHandler;
|
||||
+ DWORD dwFlags;
|
||||
+ DWORD dwCaps;
|
||||
+ WORD wPriority;
|
||||
+ WORD wLanguage;
|
||||
+ DWORD dwScale;
|
||||
+ DWORD dwRate;
|
||||
+ DWORD dwStart;
|
||||
+ DWORD dwLength;
|
||||
+ DWORD dwInitialFrames;
|
||||
+ DWORD dwSuggestedBufferSize;
|
||||
+ DWORD dwQuality;
|
||||
+ DWORD dwSampleSize;
|
||||
+ RECT rcFrame;
|
||||
+ DWORD dwEditCount;
|
||||
+ DWORD dwFormatChangeCount;
|
||||
+ WCHAR szName[64];
|
||||
+} AVISTREAMINFOW;
|
||||
+
|
||||
+[
|
||||
+ object,
|
||||
+ uuid(00020021-0000-0000-c000-000000000046)
|
||||
+]
|
||||
+interface IAVIStream : IUnknown
|
||||
+{
|
||||
+ HRESULT Create(LPARAM lParam1, LPARAM lParam2);
|
||||
+ HRESULT Info(AVISTREAMINFOW *psi, LONG lSize);
|
||||
+ LONG FindSample(LONG lPos, LONG lFlags);
|
||||
+ HRESULT ReadFormat(LONG lPos, [out,size_is(*lpcbFormat)] char *lpFormat, [in,out] LONG *lpcbFormat);
|
||||
+ HRESULT SetFormat(LONG lPos, [in,size_is(cbFormat)] char *lpFormat, LONG cbFormat);
|
||||
+ HRESULT Read(LONG lStart, LONG lSamples, [out,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples);
|
||||
+ HRESULT Write(LONG lStart, LONG lSamples, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten);
|
||||
+ HRESULT Delete(LONG lStart, LONG lSamples);
|
||||
+ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer);
|
||||
+ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer);
|
||||
+ HRESULT SetInfo(AVISTREAMINFOW *plInfo, LONG cbInfo);
|
||||
+};
|
||||
+
|
||||
+typedef struct _AVIFILEINFOW
|
||||
+{
|
||||
+ DWORD dwMaxBytesPerSec;
|
||||
+ DWORD dwFlags;
|
||||
+ DWORD dwCaps;
|
||||
+ DWORD dwStreams;
|
||||
+ DWORD dwSuggestedBufferSize;
|
||||
+ DWORD dwWidth;
|
||||
+ DWORD dwHeight;
|
||||
+ DWORD dwScale;
|
||||
+ DWORD dwRate;
|
||||
+ DWORD dwLength;
|
||||
+ DWORD dwEditCount;
|
||||
+ WCHAR szFileType[64];
|
||||
+} AVIFILEINFOW;
|
||||
+
|
||||
+[
|
||||
+ object,
|
||||
+ uuid(00020020-0000-0000-c000-000000000046)
|
||||
+]
|
||||
+interface IAVIFile : IUnknown
|
||||
+{
|
||||
+ HRESULT Info(AVIFILEINFOW *pfi, LONG lSize);
|
||||
+ HRESULT GetStream(IAVIStream **ppStream, DWORD fccType, LONG lParam);
|
||||
+ HRESULT CreateStream(IAVIStream **ppStream, AVISTREAMINFOW *psi);
|
||||
+ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer);
|
||||
+ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer);
|
||||
+ HRESULT EndRecord(void);
|
||||
+ HRESULT DeleteStream(DWORD fccType, LONG lParam);
|
||||
+};
|
||||
diff --git a/dlls/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h
|
||||
index 0fd74c4..9cce2d3 100644
|
||||
--- a/dlls/avifil32/avifile_private.h
|
||||
+++ b/dlls/avifil32/avifile_private.h
|
||||
@@ -67,5 +67,6 @@ extern PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pstream) DECLSPEC_HIDDEN;
|
||||
extern PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, const PAVISTREAM *ppStreams) DECLSPEC_HIDDEN;
|
||||
|
||||
extern LPCWSTR AVIFILE_BasenameW(LPCWSTR szFileName) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI avifil32_DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c
|
||||
index c74a716..1b8988d 100644
|
||||
--- a/dlls/avifil32/factory.c
|
||||
+++ b/dlls/avifil32/factory.c
|
||||
@@ -195,12 +195,18 @@ LPCWSTR AVIFILE_BasenameW(LPCWSTR szPath)
|
||||
*/
|
||||
HRESULT WINAPI DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv)
|
||||
{
|
||||
+ HRESULT hr;
|
||||
+
|
||||
TRACE("(%s,%s,%p)\n", debugstr_guid(pclsid), debugstr_guid(piid), ppv);
|
||||
|
||||
if (pclsid == NULL || piid == NULL || ppv == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
- return AVIFILE_CreateClassFactory(pclsid,piid,ppv);
|
||||
+ hr = AVIFILE_CreateClassFactory(pclsid,piid,ppv);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ return hr;
|
||||
+
|
||||
+ return avifil32_DllGetClassObject(pclsid,piid,ppv);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
--
|
||||
2.7.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [38564] Add support for AVIFile interface proxies
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "ae5d0b22291d866a49f293e782b43ba025ab77ec"
|
||||
echo "cfb67712ce35c05d6b7d27ece84c9192e66290b4"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -96,7 +96,6 @@ patch_enable_all ()
|
||||
enable_advapi32_Token_Integrity_Level="$1"
|
||||
enable_advapi32_WinBuiltinAnyPackageSid="$1"
|
||||
enable_api_ms_win_Stub_DLLs="$1"
|
||||
enable_avifil32_AVIFile_Proxies="$1"
|
||||
enable_avifil32_IGetFrame_fnSetFormat="$1"
|
||||
enable_avifile_dll16_AVIStreamGetFrame="$1"
|
||||
enable_bcrypt_Improvements="$1"
|
||||
@ -503,9 +502,6 @@ patch_enable ()
|
||||
api-ms-win-Stub_DLLs)
|
||||
enable_api_ms_win_Stub_DLLs="$2"
|
||||
;;
|
||||
avifil32-AVIFile_Proxies)
|
||||
enable_avifil32_AVIFile_Proxies="$2"
|
||||
;;
|
||||
avifil32-IGetFrame_fnSetFormat)
|
||||
enable_avifil32_IGetFrame_fnSetFormat="$2"
|
||||
;;
|
||||
@ -2995,22 +2991,6 @@ if test "$enable_api_ms_win_Stub_DLLs" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset avifil32-AVIFile_Proxies
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#38564] Add support for AVIFile interface proxies
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/avifil32/Makefile.in, dlls/avifil32/avifil32.idl, dlls/avifil32/avifile_ifaces.idl,
|
||||
# | dlls/avifil32/avifile_private.h, dlls/avifil32/factory.c
|
||||
# |
|
||||
if test "$enable_avifil32_AVIFile_Proxies" -eq 1; then
|
||||
patch_apply avifil32-AVIFile_Proxies/0001-avifil32-Add-support-for-AVIFile-interface-proxies.-.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "avifil32: Add support for AVIFile interface proxies.", 2 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset avifil32-IGetFrame_fnSetFormat
|
||||
# |
|
||||
# | Modified files:
|
||||
|
@ -1,15 +1,15 @@
|
||||
From 011a76f062774cfa6a4f6081d3ab773ffbb9f93f Mon Sep 17 00:00:00 2001
|
||||
From 1cf2b72c0c5760e6cae88c0f5a0327193899f591 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 19:24:47 +0200
|
||||
Subject: [PATCH] wined3d: Create dummy 1d textures and surfaces.
|
||||
|
||||
---
|
||||
dlls/wined3d/resource.c | 1 +
|
||||
dlls/wined3d/texture.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 168 insertions(+)
|
||||
dlls/wined3d/texture.c | 163 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 164 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 97f7aec4e12..f3402179acf 100644
|
||||
index 8968c164ed5..bcd06103bde 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -75,6 +75,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
@ -21,23 +21,25 @@ index 97f7aec4e12..f3402179acf 100644
|
||||
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_RECT},
|
||||
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_RB},
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 9fc0d22ed41..73874725ca6 100644
|
||||
index 907d5bec69c..71f59d74258 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1715,6 +1715,40 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||
context, box, data, row_pitch, slice_pitch);
|
||||
@@ -1758,6 +1758,36 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||
format, src_box, data, row_pitch, slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
}
|
||||
|
||||
+
|
||||
+/* This call just uploads data, the caller is responsible for binding the
|
||||
+ * correct texture. */
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ 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)
|
||||
+ const struct wined3d_context *context, const struct wined3d_format *format, const struct wined3d_box *src_box,
|
||||
+ const struct wined3d_const_bo_address *data, unsigned int src_row_pitch, unsigned int src_slice_pitch,
|
||||
+ unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
||||
+{
|
||||
+ FIXME("texture %p, sub_resource_idx %u, context %p, box %p, data {%#x:%p}, row_pitch %#x, slice_pitch %#x: stub.\n",
|
||||
+ texture, sub_resource_idx, context, box, data->buffer_object, data->addr, row_pitch, slice_pitch);
|
||||
+ FIXME("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
+ "src_row_pitch %#x, src_slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u, srgb %#x.\n",
|
||||
+ texture, sub_resource_idx, context, debug_d3dformat(format->id), debug_box(src_box),
|
||||
+ data->buffer_object, data->addr, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
+}
|
||||
+
|
||||
+/* Context activation is done by the caller. */
|
||||
@ -50,22 +52,16 @@ index 9fc0d22ed41..73874725ca6 100644
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static void texture1d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
|
||||
+{
|
||||
+ FIXME("stub.\n");
|
||||
+}
|
||||
+
|
||||
+static const struct wined3d_texture_ops texture1d_ops =
|
||||
+{
|
||||
+ texture1d_upload_data,
|
||||
+ texture1d_load_location,
|
||||
+ texture1d_prepare_texture
|
||||
+ texture1d_load_location
|
||||
+};
|
||||
+
|
||||
static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
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)
|
||||
@@ -2411,6 +2445,135 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -2534,6 +2564,135 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@ -201,7 +197,7 @@ index 9fc0d22ed41..73874725ca6 100644
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -2985,6 +3148,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
@@ -3073,6 +3232,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
|
||||
switch (desc->resource_type)
|
||||
{
|
||||
|
@ -1,81 +1,48 @@
|
||||
From 47673255ab05a81d7fd5e917d7ffc749c269af29 Mon Sep 17 00:00:00 2001
|
||||
From 5a362a78214110a3671d6aeab8d60f79164c6f28 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:22:26 +0200
|
||||
Subject: [PATCH] wined3d: Implement preparation for 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 57 insertions(+), 1 deletion(-)
|
||||
dlls/wined3d/texture.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 5685acc..718c939 100644
|
||||
index 71f59d74258..6957e01e556 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1825,7 +1825,63 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
|
||||
static void texture1d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
|
||||
{
|
||||
- FIXME("stub.\n");
|
||||
+ const struct wined3d_format *format = texture->resource.format;
|
||||
+ unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+ unsigned int width;
|
||||
+ GLenum internal;
|
||||
+
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, srgb);
|
||||
+
|
||||
+ if (srgb)
|
||||
+ internal = format->glGammaInternal;
|
||||
+ else if (texture->resource.usage & WINED3DUSAGE_RENDERTARGET
|
||||
+ && wined3d_resource_is_offscreen(&texture->resource))
|
||||
+ internal = format->rtInternal;
|
||||
+ else
|
||||
+ internal = format->glInternal;
|
||||
+
|
||||
+ if (wined3d_texture_use_immutable_storage(texture, gl_info))
|
||||
+ {
|
||||
+ width = wined3d_texture_get_level_width(texture, 0);
|
||||
+
|
||||
+ if (texture->target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ GL_EXTCALL(glTexStorage2D(texture->target, texture->level_count, internal, width, texture->layer_count));
|
||||
+ checkGLcall("glTexStorage2D");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GL_EXTCALL(glTexStorage1D(texture->target, texture->level_count, internal, width));
|
||||
+ checkGLcall("glTexStorage1D");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < sub_count; ++i)
|
||||
+ {
|
||||
+ GLenum target;
|
||||
+ unsigned int level = i % texture->level_count;
|
||||
+
|
||||
+ width = wined3d_texture_get_level_width(texture, level);
|
||||
+ target = wined3d_texture_get_sub_resource_target(texture, i);
|
||||
+
|
||||
+ if (texture->target == GL_TEXTURE_1D_ARRAY)
|
||||
@@ -477,6 +477,18 @@ static void wined3d_texture_allocate_gl_mutable_storage(struct wined3d_texture *
|
||||
format->glFormat, format->glType, NULL));
|
||||
checkGLcall("glTexImage3D");
|
||||
}
|
||||
+ else if (texture->target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexImage2D(target, level,
|
||||
+ internal, width, texture->layer_count, 0, format->glFormat, format->glType, NULL);
|
||||
+ gl_info->gl_ops.gl.p_glTexImage2D(target, level, gl_internal_format,
|
||||
+ width, height, 0, format->glFormat, format->glType, NULL);
|
||||
+ checkGLcall("glTexImage2D");
|
||||
+ }
|
||||
+ else
|
||||
+ else if (texture->target == GL_TEXTURE_1D)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexImage1D(target, level,
|
||||
+ internal, width, 0, format->glFormat, format->glType, NULL);
|
||||
+ gl_internal_format, width, 0, format->glFormat, format->glType, NULL);
|
||||
+ checkGLcall("glTexImage1D");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
static const struct wined3d_texture_ops texture1d_ops =
|
||||
else
|
||||
{
|
||||
gl_info->gl_ops.gl.p_glTexImage2D(target, level, gl_internal_format,
|
||||
@@ -514,6 +526,12 @@ static void wined3d_texture_allocate_gl_immutable_storage(struct wined3d_texture
|
||||
GL_EXTCALL(glTexStorage3DMultisample(texture->target, samples,
|
||||
gl_internal_format, width, height, texture->layer_count, GL_FALSE));
|
||||
break;
|
||||
+ case GL_TEXTURE_1D:
|
||||
+ GL_EXTCALL(glTexStorage1D(texture->target, texture->level_count, gl_internal_format, width));
|
||||
+ break;
|
||||
+ case GL_TEXTURE_1D_ARRAY:
|
||||
+ GL_EXTCALL(glTexStorage2D(texture->target, texture->level_count, gl_internal_format, width, height));
|
||||
+ break;
|
||||
default:
|
||||
GL_EXTCALL(glTexStorage2D(texture->target, texture->level_count,
|
||||
gl_internal_format, width, height));
|
||||
--
|
||||
1.9.1
|
||||
2.16.2
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
From d0d4a459ee524b4c91fa4591386f7f5e7af8a3dc Mon Sep 17 00:00:00 2001
|
||||
From af097346c9265b21cc2f823cdd347a976fa7c09b 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: [PATCH] wined3d: Implement uploading for 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 3 ++-
|
||||
dlls/wined3d/texture.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 71 insertions(+), 2 deletions(-)
|
||||
dlls/wined3d/texture.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 70 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index bdc551e..bb61f78 100644
|
||||
index bdc551e5054..bb61f78d62d 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4272,7 +4272,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
|
||||
@ -23,15 +23,14 @@ index bdc551e..bb61f78 100644
|
||||
struct wined3d_texture *texture = texture_from_resource(resource);
|
||||
unsigned int level;
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 718c939..c19849f 100644
|
||||
index 6957e01e556..fd95963b7dc 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1809,8 +1809,76 @@ 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)
|
||||
@@ -1784,10 +1784,77 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
const struct wined3d_const_bo_address *data, unsigned int src_row_pitch, unsigned int src_slice_pitch,
|
||||
unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
||||
{
|
||||
- FIXME("texture %p, sub_resource_idx %u, context %p, box %p, data {%#x:%p}, row_pitch %#x, slice_pitch %#x: stub.\n",
|
||||
+ const struct wined3d_format *format = texture->resource.format;
|
||||
- FIXME("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
+ unsigned int level = sub_resource_idx % texture->level_count;
|
||||
+ unsigned int layer = sub_resource_idx / texture->level_count;
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
@ -40,20 +39,22 @@ index 718c939..c19849f 100644
|
||||
+ unsigned int width, x, update_w;
|
||||
+ GLenum target;
|
||||
+
|
||||
+ TRACE("texture %p, sub_resource_idx %u, context %p, box %p, data {%#x:%p}, row_pitch %#x, slice_pitch %#x.\n",
|
||||
texture, sub_resource_idx, context, box, data->buffer_object, data->addr, row_pitch, slice_pitch);
|
||||
+ TRACE("texture %p, sub_resource_idx %u, context %p, format %s, src_box %s, data {%#x:%p}, "
|
||||
"src_row_pitch %#x, src_slice_pitch %#x, dst_x %u, dst_y %u, dst_z %u, srgb %#x.\n",
|
||||
texture, sub_resource_idx, context, debug_d3dformat(format->id), debug_box(src_box),
|
||||
data->buffer_object, data->addr, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
|
||||
+
|
||||
+ width = wined3d_texture_get_level_width(texture, level);
|
||||
+
|
||||
+ if (!box)
|
||||
+ if (!src_box)
|
||||
+ {
|
||||
+ x = 0;
|
||||
+ update_w = width;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ x = box->left;
|
||||
+ update_w = box->right - box->left;
|
||||
+ x = src_box->left;
|
||||
+ update_w = src_box->right - src_box->left;
|
||||
+ }
|
||||
+
|
||||
+ if (format->upload)
|
||||
@ -68,7 +69,7 @@ index 718c939..c19849f 100644
|
||||
+ dst_row_pitch = update_w * format->conv_byte_count;
|
||||
+
|
||||
+ converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_row_pitch);
|
||||
+ format->upload(data->addr, converted_mem, row_pitch, slice_pitch, dst_row_pitch, dst_row_pitch, update_w, 1, 1);
|
||||
+ format->upload(data->addr, converted_mem, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_row_pitch, update_w, 1, 1);
|
||||
+ mem = converted_mem;
|
||||
+ }
|
||||
+
|
||||
@ -81,7 +82,7 @@ index 718c939..c19849f 100644
|
||||
+ target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
|
||||
+ if (target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, row_pitch / format->byte_count);
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, src_row_pitch / format->byte_count);
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, x, layer, update_w, 1, format->glFormat, format->glType, mem);
|
||||
+ checkGLcall("glTexSubImage2D");
|
||||
@ -105,5 +106,5 @@ index 718c939..c19849f 100644
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
--
|
||||
1.9.1
|
||||
2.16.2
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
From 001138256720603e42416e17d89f23b871857624 Mon Sep 17 00:00:00 2001
|
||||
From 0e991598b502b33723a96212a3509c37c8054ab5 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:38:47 +0200
|
||||
Subject: [PATCH] wined3d: Implement loading from system memory and buffers to
|
||||
(s)rgb 1d textures.
|
||||
Subject: [PATCH 1/3] wined3d: Implement loading from system memory and buffers
|
||||
to (s)rgb 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 67 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c19849f..40ce11b 100644
|
||||
index fd95963b7dc..6c8e09db4f2 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1885,10 +1885,75 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1861,10 +1861,75 @@ static void texture1d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@ -61,14 +61,14 @@ index c19849f..40ce11b 100644
|
||||
+ data.addr += sub_resource->offset;
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+ }
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
+ {
|
||||
+ struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
@ -89,7 +89,7 @@ index c19849f..40ce11b 100644
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
static void texture1d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
|
||||
static const struct wined3d_texture_ops texture1d_ops =
|
||||
--
|
||||
1.9.1
|
||||
2.16.2
|
||||
|
||||
|
@ -31,8 +31,8 @@ index 81a638e..0755d4d 100644
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, !dest_is_srgb);
|
||||
+ texture1d_download_data(texture, sub_resource_idx, context, &data);
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, dest_is_srgb);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL,
|
||||
+ wined3d_const_bo_address(&data), row_pitch, slice_pitch);
|
||||
+ texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL,
|
||||
+ wined3d_const_bo_address(&data), row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, data.addr);
|
||||
+}
|
||||
@ -43,7 +43,7 @@ index 81a638e..0755d4d 100644
|
||||
{
|
||||
@@ -2009,6 +2032,14 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
}
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ {
|
||||
|
@ -471,7 +471,7 @@ index c3f98ba..33165fb 100644
|
||||
+#endif /* STAGING_CSMT */
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
@@ -2078,7 +2139,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
|
Loading…
Reference in New Issue
Block a user