mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 2986e895015b9785d61e7265763efacc053d7ad6.
This commit is contained in:
parent
2736dff771
commit
0cf0a265da
@ -1,2 +1 @@
|
||||
Fixes: [42191] Add semi-stub for D3D11 deferred context implementation
|
||||
Depends: d3d11-ID3D11Texture1D_Rebased
|
||||
|
@ -1,454 +0,0 @@
|
||||
From 19d3f2a7b2bdd740cc46e4b0f8a08d4c7e3e33bc 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:41:15 +0200
|
||||
Subject: [PATCH] d3d11: Add stub ID3D11Texture2D and ID3D10Texture2D
|
||||
interfaces.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 21 +++
|
||||
dlls/d3d11/device.c | 36 ++++-
|
||||
dlls/d3d11/texture.c | 340 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 393 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 52496d8..bdd7c34 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,27 @@ void skip_dword_unknown(const char **ptr, unsigned int count) DECLSPEC_HIDDEN;
|
||||
HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
||||
HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN;
|
||||
|
||||
+/* ID3D11Texture1D, ID3D10Texture1D */
|
||||
+struct d3d_texture1d
|
||||
+{
|
||||
+ ID3D11Texture1D ID3D11Texture1D_iface;
|
||||
+ ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
+ LONG refcount;
|
||||
+
|
||||
+ D3D11_TEXTURE1D_DESC desc;
|
||||
+ ID3D11Device *device;
|
||||
+};
|
||||
+
|
||||
+static inline struct d3d_texture1d *impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc,
|
||||
+ const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture1d **texture) DECLSPEC_HIDDEN;
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D11Texture1D(ID3D11Texture1D *iface) DECLSPEC_HIDDEN;
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface) DECLSPEC_HIDDEN;
|
||||
+
|
||||
/* ID3D11Texture2D, ID3D10Texture2D */
|
||||
struct d3d_texture2d
|
||||
{
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 6a747d0..b514ebd 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -6028,9 +6028,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device *iface,
|
||||
const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture)
|
||||
{
|
||||
- FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
|
||||
+ struct d3d_device *device = impl_from_ID3D11Device(iface);
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_create(device, desc, data, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *texture = &object->ID3D11Texture1D_iface;
|
||||
+
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device *iface,
|
||||
@@ -8272,9 +8281,28 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device1 *iface,
|
||||
const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture)
|
||||
{
|
||||
- FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture);
|
||||
+ struct d3d_device *device = impl_from_ID3D10Device(iface);
|
||||
+ D3D11_TEXTURE1D_DESC d3d11_desc;
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
|
||||
+
|
||||
+ d3d11_desc.Width = desc->Width;
|
||||
+ d3d11_desc.MipLevels = desc->MipLevels;
|
||||
+ d3d11_desc.ArraySize = desc->ArraySize;
|
||||
+ d3d11_desc.Format = desc->Format;
|
||||
+ d3d11_desc.Usage = d3d11_usage_from_d3d10_usage(desc->Usage);
|
||||
+ d3d11_desc.BindFlags = d3d11_bind_flags_from_d3d10_bind_flags(desc->BindFlags);
|
||||
+ d3d11_desc.CPUAccessFlags = d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(desc->CPUAccessFlags);
|
||||
+ d3d11_desc.MiscFlags = d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(desc->MiscFlags);
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_create(device, &d3d11_desc, (const D3D11_SUBRESOURCE_DATA *)data, &object)))
|
||||
+ return hr;
|
||||
+
|
||||
+ *texture = &object->ID3D10Texture1D_iface;
|
||||
+
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *iface,
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 4315284..00540b5 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -25,6 +25,346 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d11);
|
||||
|
||||
+
|
||||
+/* ID3D11Texture1D methods */
|
||||
+
|
||||
+static inline struct d3d_texture1d *impl_from_ID3D11Texture1D(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_QueryInterface(ID3D11Texture1D *iface, REFIID riid, void **object)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_ID3D11Texture1D)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D11Resource)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D11DeviceChild)
|
||||
+ || IsEqualGUID(riid, &IID_IUnknown))
|
||||
+ {
|
||||
+ *object = &texture->ID3D11Texture1D_iface;
|
||||
+ IUnknown_AddRef((IUnknown *)*object);
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+ else if (IsEqualGUID(riid, &IID_ID3D10Texture1D)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D10Resource)
|
||||
+ || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
|
||||
+ {
|
||||
+ *object = &texture->ID3D10Texture1D_iface;
|
||||
+ IUnknown_AddRef((IUnknown *)*object);
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
+
|
||||
+ *object = NULL;
|
||||
+ return E_NOINTERFACE;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ ULONG refcount = InterlockedIncrement(&texture->refcount);
|
||||
+
|
||||
+ TRACE("%p increasing refcount to %u.\n", texture, refcount);
|
||||
+
|
||||
+ if (refcount == 1)
|
||||
+ {
|
||||
+ ID3D11Device_AddRef(texture->device);
|
||||
+ }
|
||||
+
|
||||
+ return refcount;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ ULONG refcount = InterlockedDecrement(&texture->refcount);
|
||||
+
|
||||
+ TRACE("%p decreasing refcount to %u.\n", texture, refcount);
|
||||
+
|
||||
+ if (!refcount)
|
||||
+ {
|
||||
+ ID3D11Device *device = texture->device;
|
||||
+
|
||||
+ /* Release the device last, it may cause the wined3d device to be
|
||||
+ * destroyed. */
|
||||
+ ID3D11Device_Release(device);
|
||||
+ }
|
||||
+
|
||||
+ return refcount;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetDevice(ID3D11Texture1D *iface, ID3D11Device **device)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, device %p.\n", iface, device);
|
||||
+
|
||||
+ *device = texture->device;
|
||||
+ ID3D11Device_AddRef(*device);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_GetPrivateData(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, UINT *data_size, void *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data_size %p, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, UINT data_size, const void *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data_size %u, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
+ REFGUID guid, const IUnknown *data)
|
||||
+{
|
||||
+ FIXME("iface %p, guid %s, data %p: stub.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetType(ID3D11Texture1D *iface,
|
||||
+ D3D11_RESOURCE_DIMENSION *resource_dimension)
|
||||
+{
|
||||
+ TRACE("iface %p, resource_dimension %p.\n", iface, resource_dimension);
|
||||
+
|
||||
+ *resource_dimension = D3D11_RESOURCE_DIMENSION_TEXTURE1D;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_SetEvictionPriority(ID3D11Texture1D *iface, UINT eviction_priority)
|
||||
+{
|
||||
+ FIXME("iface %p, eviction_priority %#x stub!\n", iface, eviction_priority);
|
||||
+}
|
||||
+
|
||||
+static UINT STDMETHODCALLTYPE d3d11_texture1d_GetEvictionPriority(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ FIXME("iface %p stub!\n", iface);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d11_texture1d_GetDesc(ID3D11Texture1D *iface, D3D11_TEXTURE1D_DESC *desc)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+
|
||||
+ FIXME("iface %p, desc %p: semi-stub.\n", iface, desc);
|
||||
+
|
||||
+ *desc = texture->desc;
|
||||
+}
|
||||
+
|
||||
+static const struct ID3D11Texture1DVtbl d3d11_texture1d_vtbl =
|
||||
+{
|
||||
+ /* IUnknown methods */
|
||||
+ d3d11_texture1d_QueryInterface,
|
||||
+ d3d11_texture1d_AddRef,
|
||||
+ d3d11_texture1d_Release,
|
||||
+ /* ID3D11DeviceChild methods */
|
||||
+ d3d11_texture1d_GetDevice,
|
||||
+ d3d11_texture1d_GetPrivateData,
|
||||
+ d3d11_texture1d_SetPrivateData,
|
||||
+ d3d11_texture1d_SetPrivateDataInterface,
|
||||
+ /* ID3D11Resource methods */
|
||||
+ d3d11_texture1d_GetType,
|
||||
+ d3d11_texture1d_SetEvictionPriority,
|
||||
+ d3d11_texture1d_GetEvictionPriority,
|
||||
+ /* ID3D11Texture1D methods */
|
||||
+ d3d11_texture1d_GetDesc,
|
||||
+};
|
||||
+
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D11Texture1D(ID3D11Texture1D *iface)
|
||||
+{
|
||||
+ if (!iface)
|
||||
+ return NULL;
|
||||
+ assert(iface->lpVtbl == &d3d11_texture1d_vtbl);
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+/* IUnknown methods */
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_QueryInterface(ID3D10Texture1D *iface, REFIID riid, void **object)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
+
|
||||
+ return d3d11_texture1d_QueryInterface(&texture->ID3D11Texture1D_iface, riid, object);
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d10_texture1d_AddRef(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p.\n", iface);
|
||||
+
|
||||
+ return d3d11_texture1d_AddRef(&texture->ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE d3d10_texture1d_Release(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p.\n", iface);
|
||||
+
|
||||
+ return d3d11_texture1d_Release(&texture->ID3D11Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+/* ID3D10DeviceChild methods */
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetDevice(ID3D10Texture1D *iface, ID3D10Device **device)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, device %p.\n", iface, device);
|
||||
+
|
||||
+ ID3D11Device_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_GetPrivateData(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, UINT *data_size, void *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return d3d11_texture1d_GetPrivateData(&texture->ID3D11Texture1D_iface, guid, data_size, data);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_SetPrivateData(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, UINT data_size, const void *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ return d3d11_texture1d_SetPrivateData(&texture->ID3D11Texture1D_iface, guid, data_size, data);
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_SetPrivateDataInterface(ID3D10Texture1D *iface,
|
||||
+ REFGUID guid, const IUnknown *data)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ return d3d11_texture1d_SetPrivateDataInterface(&texture->ID3D11Texture1D_iface, guid, data);
|
||||
+}
|
||||
+
|
||||
+/* ID3D10Resource methods */
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetType(ID3D10Texture1D *iface,
|
||||
+ D3D10_RESOURCE_DIMENSION *resource_dimension)
|
||||
+{
|
||||
+ TRACE("iface %p, resource_dimension %p\n", iface, resource_dimension);
|
||||
+
|
||||
+ *resource_dimension = D3D10_RESOURCE_DIMENSION_TEXTURE1D;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_SetEvictionPriority(ID3D10Texture1D *iface, UINT eviction_priority)
|
||||
+{
|
||||
+ FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
|
||||
+}
|
||||
+
|
||||
+static UINT STDMETHODCALLTYPE d3d10_texture1d_GetEvictionPriority(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ FIXME("iface %p stub!\n", iface);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* ID3D10Texture1D methods */
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE d3d10_texture1d_Map(ID3D10Texture1D *iface, UINT sub_resource_idx,
|
||||
+ D3D10_MAP map_type, UINT map_flags, void **data)
|
||||
+{
|
||||
+ FIXME("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p: stub.\n",
|
||||
+ iface, sub_resource_idx, map_type, map_flags, data);
|
||||
+
|
||||
+ return E_FAIL;
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT sub_resource_idx)
|
||||
+{
|
||||
+ FIXME("iface %p, sub_resource_idx %u: stub.\n", iface, sub_resource_idx);
|
||||
+}
|
||||
+
|
||||
+static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
+{
|
||||
+ FIXME("iface %p, desc %p: stub\n", iface, desc);
|
||||
+}
|
||||
+
|
||||
+static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl =
|
||||
+{
|
||||
+ /* IUnknown methods */
|
||||
+ d3d10_texture1d_QueryInterface,
|
||||
+ d3d10_texture1d_AddRef,
|
||||
+ d3d10_texture1d_Release,
|
||||
+ /* ID3D10DeviceChild methods */
|
||||
+ d3d10_texture1d_GetDevice,
|
||||
+ d3d10_texture1d_GetPrivateData,
|
||||
+ d3d10_texture1d_SetPrivateData,
|
||||
+ d3d10_texture1d_SetPrivateDataInterface,
|
||||
+ /* ID3D10Resource methods */
|
||||
+ d3d10_texture1d_GetType,
|
||||
+ d3d10_texture1d_SetEvictionPriority,
|
||||
+ d3d10_texture1d_GetEvictionPriority,
|
||||
+ /* ID3D10Texture1D methods */
|
||||
+ d3d10_texture1d_Map,
|
||||
+ d3d10_texture1d_Unmap,
|
||||
+ d3d10_texture1d_GetDesc,
|
||||
+};
|
||||
+
|
||||
+struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
+{
|
||||
+ if (!iface)
|
||||
+ return NULL;
|
||||
+ assert(iface->lpVtbl == &d3d10_texture1d_vtbl);
|
||||
+ return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_device *device,
|
||||
+ const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data)
|
||||
+{
|
||||
+ texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
+ texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
+ texture->refcount = 1;
|
||||
+ texture->desc = *desc;
|
||||
+
|
||||
+ texture->device = &device->ID3D11Device_iface;
|
||||
+ ID3D11Device_AddRef(texture->device);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc,
|
||||
+ const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture1d **texture)
|
||||
+{
|
||||
+ struct d3d_texture1d *object;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ if (FAILED(hr = d3d_texture1d_init(object, device, desc, data)))
|
||||
+ {
|
||||
+ WARN("Failed to initialize texture, hr %#x.\n", hr);
|
||||
+ HeapFree(GetProcessHeap(), 0, object);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("Created texture %p.\n", object);
|
||||
+ *texture = object;
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
/* ID3D11Texture2D methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture2d_QueryInterface(ID3D11Texture2D *iface, REFIID riid, void **object)
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,135 +0,0 @@
|
||||
From a1e800ac4f09ae90a19e2503682f069dd81850a5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 31 Aug 2016 16:22:43 +0200
|
||||
Subject: d3d11: Create a texture in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/d3d11/utils.c | 8 ++++++++
|
||||
3 files changed, 59 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 6bd7282..73f4196 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,7 @@ struct d3d_texture1d
|
||||
ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
LONG refcount;
|
||||
|
||||
+ struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
};
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index d201b23..55fb265 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -73,6 +73,9 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
|
||||
if (refcount == 1)
|
||||
{
|
||||
ID3D11Device_AddRef(texture->device);
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_texture_incref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return refcount;
|
||||
@@ -89,6 +92,9 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
|
||||
{
|
||||
ID3D11Device *device = texture->device;
|
||||
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
/* Release the device last, it may cause the wined3d device to be
|
||||
* destroyed. */
|
||||
ID3D11Device_Release(device);
|
||||
@@ -329,14 +335,58 @@ struct d3d_texture1d *unsafe_impl_from_ID3D10Texture1D(ID3D10Texture1D *iface)
|
||||
return CONTAINING_RECORD(iface, struct d3d_texture1d, ID3D10Texture1D_iface);
|
||||
}
|
||||
|
||||
+static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent)
|
||||
+{
|
||||
+ struct d3d_texture1d *texture = parent;
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
+}
|
||||
+
|
||||
+static const struct wined3d_parent_ops d3d_texture1d_wined3d_parent_ops =
|
||||
+{
|
||||
+ d3d_texture1d_wined3d_object_released,
|
||||
+};
|
||||
+
|
||||
static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_device *device,
|
||||
const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data)
|
||||
{
|
||||
+ struct wined3d_resource_desc wined3d_desc;
|
||||
+ unsigned int levels;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
texture->refcount = 1;
|
||||
texture->desc = *desc;
|
||||
|
||||
+ wined3d_mutex_lock();
|
||||
+
|
||||
+ wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_1D;
|
||||
+ wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
+ wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
+ wined3d_desc.multisample_quality = 0;
|
||||
+ wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage);
|
||||
+ wined3d_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
|
||||
+ wined3d_desc.width = desc->Width;
|
||||
+ wined3d_desc.height = 1;
|
||||
+ wined3d_desc.depth = 1;
|
||||
+ wined3d_desc.size = 0;
|
||||
+
|
||||
+ levels = desc->MipLevels ? desc->MipLevels : wined3d_log2i(max(desc->Width, 1)) + 1;
|
||||
+
|
||||
+ if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc,
|
||||
+ desc->ArraySize, levels, 0, (struct wined3d_sub_resource_data *)data,
|
||||
+ texture, &d3d_texture1d_wined3d_parent_ops, &texture->wined3d_texture)))
|
||||
+ {
|
||||
+ WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DERR_INVALIDCALL)
|
||||
+ hr = E_INVALIDARG;
|
||||
+ return hr;
|
||||
+ }
|
||||
+ texture->desc.MipLevels = levels;
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
texture->device = &device->ID3D11Device_iface;
|
||||
ID3D11Device_AddRef(texture->device);
|
||||
|
||||
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
|
||||
index 89dbbda..06f2600 100644
|
||||
--- a/dlls/d3d11/utils.c
|
||||
+++ b/dlls/d3d11/utils.c
|
||||
@@ -566,6 +566,10 @@ struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *re
|
||||
return wined3d_buffer_get_resource(unsafe_impl_from_ID3D11Buffer(
|
||||
(ID3D11Buffer *)resource)->wined3d_buffer);
|
||||
|
||||
+ case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
+ return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture1D(
|
||||
+ (ID3D11Texture1D *)resource)->wined3d_texture);
|
||||
+
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture2D(
|
||||
(ID3D11Texture2D *)resource)->wined3d_texture);
|
||||
@@ -592,6 +596,10 @@ struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *re
|
||||
return wined3d_buffer_get_resource(unsafe_impl_from_ID3D10Buffer(
|
||||
(ID3D10Buffer *)resource)->wined3d_buffer);
|
||||
|
||||
+ case D3D10_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
+ return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture1D(
|
||||
+ (ID3D10Texture1D *)resource)->wined3d_texture);
|
||||
+
|
||||
case D3D10_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture2D(
|
||||
(ID3D10Texture2D *)resource)->wined3d_texture);
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 25be3c1b3ee879ab4dcc4721636042d3bb7c52af Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 31 Aug 2016 16:23:12 +0200
|
||||
Subject: d3d11: Create a private store in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 73f4196..4a18ca7 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -111,6 +111,7 @@ struct d3d_texture1d
|
||||
ID3D10Texture1D ID3D10Texture1D_iface;
|
||||
LONG refcount;
|
||||
|
||||
+ struct wined3d_private_store private_store;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 55fb265..0c269c1 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -339,6 +339,7 @@ static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent
|
||||
{
|
||||
struct d3d_texture1d *texture = parent;
|
||||
|
||||
+ wined3d_private_store_cleanup(&texture->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
|
||||
@@ -360,6 +361,7 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
texture->desc = *desc;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
+ wined3d_private_store_init(&texture->private_store);
|
||||
|
||||
wined3d_desc.resource_type = WINED3D_RTYPE_TEXTURE_1D;
|
||||
wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
|
||||
@@ -379,6 +381,7 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
texture, &d3d_texture1d_wined3d_parent_ops, &texture->wined3d_texture)))
|
||||
{
|
||||
WARN("Failed to create wined3d texture, hr %#x.\n", hr);
|
||||
+ wined3d_private_store_cleanup(&texture->private_store);
|
||||
wined3d_mutex_unlock();
|
||||
if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DERR_INVALIDCALL)
|
||||
hr = E_INVALIDARG;
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,83 +0,0 @@
|
||||
From d29fadf3f80f98f06f955739ede3739dc1425459 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:59:20 +0200
|
||||
Subject: d3d11: Generate dxgi surface in d3d_texture1d_init.
|
||||
|
||||
---
|
||||
dlls/d3d11/d3d11_private.h | 1 +
|
||||
dlls/d3d11/texture.c | 33 +++++++++++++++++++++++++++++++++
|
||||
2 files changed, 34 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
|
||||
index 3bd2dec..edf7217 100644
|
||||
--- a/dlls/d3d11/d3d11_private.h
|
||||
+++ b/dlls/d3d11/d3d11_private.h
|
||||
@@ -112,6 +112,7 @@ struct d3d_texture1d
|
||||
LONG refcount;
|
||||
|
||||
struct wined3d_private_store private_store;
|
||||
+ IUnknown *dxgi_surface;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
D3D11_TEXTURE1D_DESC desc;
|
||||
ID3D11Device *device;
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 2fe7aa4..94f4c57 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -57,6 +57,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture1d_QueryInterface(ID3D11Texture1D
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
+ if (texture->dxgi_surface)
|
||||
+ {
|
||||
+ TRACE("Forwarding to dxgi surface.\n");
|
||||
+ return IUnknown_QueryInterface(texture->dxgi_surface, riid, object);
|
||||
+ }
|
||||
+
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
@@ -339,6 +345,7 @@ static void STDMETHODCALLTYPE d3d_texture1d_wined3d_object_released(void *parent
|
||||
{
|
||||
struct d3d_texture1d *texture = parent;
|
||||
|
||||
+ if (texture->dxgi_surface) IUnknown_Release(texture->dxgi_surface);
|
||||
wined3d_private_store_cleanup(&texture->private_store);
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
@@ -388,6 +395,32 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
return hr;
|
||||
}
|
||||
texture->desc.MipLevels = levels;
|
||||
+
|
||||
+ if (desc->MipLevels == 1 && desc->ArraySize == 1)
|
||||
+ {
|
||||
+ IWineDXGIDevice *wine_device;
|
||||
+
|
||||
+ if (FAILED(hr = ID3D10Device1_QueryInterface(&device->ID3D10Device1_iface, &IID_IWineDXGIDevice,
|
||||
+ (void **)&wine_device)))
|
||||
+ {
|
||||
+ ERR("Device should implement IWineDXGIDevice.\n");
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ hr = IWineDXGIDevice_create_surface(wine_device, texture->wined3d_texture, 0, NULL,
|
||||
+ (IUnknown *)&texture->ID3D10Texture1D_iface, (void **)&texture->dxgi_surface);
|
||||
+ IWineDXGIDevice_Release(wine_device);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ ERR("Failed to create DXGI surface, returning %#x\n", hr);
|
||||
+ texture->dxgi_surface = NULL;
|
||||
+ wined3d_texture_decref(texture->wined3d_texture);
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return hr;
|
||||
+ }
|
||||
+ }
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
texture->device = &device->ID3D11Device_iface;
|
||||
--
|
||||
2.9.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 49ab2b28ef9d217479be639dcc89b689bcbf758c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:34:24 +0200
|
||||
Subject: d3d11: Improve d3d11_texture1d_GetDesc by obtaining the current width
|
||||
and format from wined3d.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index e116994..3336367 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -166,10 +166,21 @@ static UINT STDMETHODCALLTYPE d3d11_texture1d_GetEvictionPriority(ID3D11Texture1
|
||||
static void STDMETHODCALLTYPE d3d11_texture1d_GetDesc(ID3D11Texture1D *iface, D3D11_TEXTURE1D_DESC *desc)
|
||||
{
|
||||
struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ struct wined3d_resource_desc wined3d_desc;
|
||||
|
||||
- FIXME("iface %p, desc %p: semi-stub.\n", iface, desc);
|
||||
+ TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
*desc = texture->desc;
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_resource_get_desc(wined3d_texture_get_resource(texture->wined3d_texture), &wined3d_desc);
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ /* FIXME: Resizing swapchain buffers can cause these to change. We'd like
|
||||
+ * to get everything from wined3d, but e.g. bind flags don't exist as such
|
||||
+ * there (yet). */
|
||||
+ desc->Width = wined3d_desc.width;
|
||||
+ desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format);
|
||||
}
|
||||
|
||||
static const struct ID3D11Texture1DVtbl d3d11_texture1d_vtbl =
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 6709d525107a787f91530b7ffae1e108bd971744 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:36:25 +0200
|
||||
Subject: d3d11: Implement d3d10_texture1d_(Un)map.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 27 ++++++++++++++++++++++++---
|
||||
1 file changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 3336367..204aa98 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -307,15 +307,36 @@ static UINT STDMETHODCALLTYPE d3d10_texture1d_GetEvictionPriority(ID3D10Texture1
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_texture1d_Map(ID3D10Texture1D *iface, UINT sub_resource_idx,
|
||||
D3D10_MAP map_type, UINT map_flags, void **data)
|
||||
{
|
||||
- FIXME("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p: stub.\n",
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+ struct wined3d_map_desc wined3d_map_desc;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p.\n",
|
||||
iface, sub_resource_idx, map_type, map_flags, data);
|
||||
|
||||
- return E_FAIL;
|
||||
+ if (map_flags)
|
||||
+ FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx,
|
||||
+ &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type))))
|
||||
+ {
|
||||
+ *data = wined3d_map_desc.data;
|
||||
+ }
|
||||
+ wined3d_mutex_unlock();
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT sub_resource_idx)
|
||||
{
|
||||
- FIXME("iface %p, sub_resource_idx %u: stub.\n", iface, sub_resource_idx);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+
|
||||
+ TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 94a19771d621239e2a17f94ce89f797fd28877ab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:37:59 +0200
|
||||
Subject: d3d11: Implement d3d10_texture1d_GetDesc.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 204aa98..e8b0047 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -341,7 +341,21 @@ static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
{
|
||||
- FIXME("iface %p, desc %p: stub\n", iface, desc);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
|
||||
+ D3D11_TEXTURE1D_DESC d3d11_desc;
|
||||
+
|
||||
+ TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
+
|
||||
+ d3d11_texture1d_GetDesc(&texture->ID3D11Texture1D_iface, &d3d11_desc);
|
||||
+
|
||||
+ desc->Width = d3d11_desc.Width;
|
||||
+ desc->MipLevels = d3d11_desc.MipLevels;
|
||||
+ desc->ArraySize = d3d11_desc.ArraySize;
|
||||
+ desc->Format = d3d11_desc.Format;
|
||||
+ desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc.Usage);
|
||||
+ desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc.BindFlags);
|
||||
+ desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc.CPUAccessFlags);
|
||||
+ desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc.MiscFlags);
|
||||
}
|
||||
|
||||
static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl =
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
From d204de51fa14b6245cbf4afd0f0ddc01f9aa554b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:39:56 +0200
|
||||
Subject: d3d11: Implement d3d11_texture1d_{G,S}etPrivateData.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 32 ++++++++++++++++++++++++++++----
|
||||
1 file changed, 28 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index e8b0047..411dca6 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -122,17 +122,41 @@ static void STDMETHODCALLTYPE d3d11_texture1d_GetDevice(ID3D11Texture1D *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_GetPrivateData(ID3D11Texture1D *iface,
|
||||
REFGUID guid, UINT *data_size, void *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data_size %p, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_FAIL;
|
||||
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_GetPrivateData(dxgi_surface, guid, data_size, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ return d3d_get_private_data(&texture->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D *iface,
|
||||
REFGUID guid, UINT data_size, const void *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data_size %u, data %p: stub.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
|
||||
- return E_FAIL;
|
||||
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_SetPrivateData(dxgi_surface, guid, data_size, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ return d3d_set_private_data(&texture->private_store, guid, data_size, data);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 950c6ffc394ca315f5769b04ce5390ce8798949d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Aug 2016 23:42:10 +0200
|
||||
Subject: d3d11: Add d3d11_texture1d_SetPrivateDataInterface.
|
||||
|
||||
---
|
||||
dlls/d3d11/texture.c | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index 411dca6..eb39ef8 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -162,9 +162,21 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateData(ID3D11Texture1D
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_texture1d_SetPrivateDataInterface(ID3D11Texture1D *iface,
|
||||
REFGUID guid, const IUnknown *data)
|
||||
{
|
||||
- FIXME("iface %p, guid %s, data %p: stub.\n", iface, debugstr_guid(guid), data);
|
||||
+ struct d3d_texture1d *texture = impl_from_ID3D11Texture1D(iface);
|
||||
+ IDXGISurface *dxgi_surface;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
|
||||
+
|
||||
+ if (texture->dxgi_surface
|
||||
+ && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface)))
|
||||
+ {
|
||||
+ hr = IDXGISurface_SetPrivateDataInterface(dxgi_surface, guid, data);
|
||||
+ IDXGISurface_Release(dxgi_surface);
|
||||
+ return hr;
|
||||
+ }
|
||||
|
||||
- return E_FAIL;
|
||||
+ return d3d_set_private_data_interface(&texture->private_store, guid, data);
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_texture1d_GetType(ID3D11Texture1D *iface,
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 7e3f33623d4ddf7a8fb0bab30b5c9ce18344e0ce Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 21:23:52 +0200
|
||||
Subject: d3d11: Add a hack to prevent creation of 1d cube textures
|
||||
|
||||
There is already a check in wined3d to prevent this, but it is not triggered
|
||||
as the request to create a cube texture is currently not forwarded to wined3d.
|
||||
The correct solution would be to change wined3d_usage_from_d3d11 to translate
|
||||
the D3D11_RESOURCE_MISC_TEXTURECUBE flag into WINED3DUSAGE_LEGACY_CUBEMAP.
|
||||
This would also prevent the creation of 2d cube map arrays which are not
|
||||
supported yet, but some d3d11 tests are based on the fact that wine pretends
|
||||
to support them by simply using 2d array textues and ignoring the cube map flags.
|
||||
---
|
||||
dlls/d3d11/texture.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
|
||||
index eb39ef8..541ed45 100644
|
||||
--- a/dlls/d3d11/texture.c
|
||||
+++ b/dlls/d3d11/texture.c
|
||||
@@ -444,6 +444,9 @@ static HRESULT d3d_texture1d_init(struct d3d_texture1d *texture, struct d3d_devi
|
||||
unsigned int levels;
|
||||
HRESULT hr;
|
||||
|
||||
+ if (desc->MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
texture->ID3D11Texture1D_iface.lpVtbl = &d3d11_texture1d_vtbl;
|
||||
texture->ID3D10Texture1D_iface.lpVtbl = &d3d10_texture1d_vtbl;
|
||||
texture->refcount = 1;
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 7d92409655346368c6af7c90f8285ec1f1b40a94 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:44:57 +0200
|
||||
Subject: d3d11: Add support for 1d textures in normalize_srv_desc.
|
||||
|
||||
---
|
||||
dlls/d3d11/view.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
|
||||
index 205513d..d6974d8 100644
|
||||
--- a/dlls/d3d11/view.c
|
||||
+++ b/dlls/d3d11/view.c
|
||||
@@ -604,6 +604,8 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
{
|
||||
+ const struct d3d_texture1d *texture;
|
||||
+
|
||||
if (desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1D
|
||||
&& desc->ViewDimension != D3D11_SRV_DIMENSION_TEXTURE1DARRAY)
|
||||
{
|
||||
@@ -611,8 +613,16 @@ static HRESULT normalize_srv_desc(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11R
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
- FIXME("Unhandled 1D texture resource.\n");
|
||||
- return S_OK;
|
||||
+ if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
|
||||
+ {
|
||||
+ ERR("Cannot get implementation from ID3D11Texture1D.\n");
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ format = texture->desc.Format;
|
||||
+ miplevel_count = texture->desc.MipLevels;
|
||||
+ layer_count = texture->desc.ArraySize;
|
||||
+ break;
|
||||
}
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 1cb0fbe3fbec0f3acda805b3a4d44b2afb21419e 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:45:05 +0200
|
||||
Subject: d3d11: Add support for 1d textures in normalize_rtv_desc.
|
||||
|
||||
---
|
||||
dlls/d3d11/view.c | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
|
||||
index d6974d8..eb936e3 100644
|
||||
--- a/dlls/d3d11/view.c
|
||||
+++ b/dlls/d3d11/view.c
|
||||
@@ -344,6 +344,8 @@ static HRESULT normalize_rtv_desc(D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11Res
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
{
|
||||
+ const struct d3d_texture1d *texture;
|
||||
+
|
||||
if (desc->ViewDimension != D3D11_RTV_DIMENSION_TEXTURE1D
|
||||
&& desc->ViewDimension != D3D11_RTV_DIMENSION_TEXTURE1DARRAY)
|
||||
{
|
||||
@@ -351,8 +353,15 @@ static HRESULT normalize_rtv_desc(D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11Res
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
- FIXME("Unhandled 1D texture resource.\n");
|
||||
- return S_OK;
|
||||
+ if (!(texture = unsafe_impl_from_ID3D11Texture1D((ID3D11Texture1D *)resource)))
|
||||
+ {
|
||||
+ ERR("Cannot get implementation from ID3D11Texture1D.\n");
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ format = texture->desc.Format;
|
||||
+ layer_count = texture->desc.ArraySize;
|
||||
+ break;
|
||||
}
|
||||
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 96b5e1dd2f60a78037c19e6812b97616412da1b9 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:47:01 +0200
|
||||
Subject: d3d11/tests: Add support for 1d textures in check_srv_desc_.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 26 +++++++++++++++++++++++++-
|
||||
1 file changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index c2b2535..c26d6aa 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -218,7 +218,31 @@ static void check_srv_desc_(unsigned int line, const D3D11_SHADER_RESOURCE_VIEW_
|
||||
if (desc->ViewDimension != expected_desc->dimension)
|
||||
return;
|
||||
|
||||
- if (desc->ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D)
|
||||
+ if (desc->ViewDimension == D3D11_SRV_DIMENSION_TEXTURE1D)
|
||||
+ {
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1D.MostDetailedMip == expected_desc->miplevel_idx,
|
||||
+ "Got MostDetailedMip %u, expected %u.\n",
|
||||
+ U(*desc).Texture1D.MostDetailedMip, expected_desc->miplevel_idx);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1D.MipLevels == expected_desc->miplevel_count,
|
||||
+ "Got MipLevels %u, expected %u.\n",
|
||||
+ U(*desc).Texture1D.MipLevels, expected_desc->miplevel_count);
|
||||
+ }
|
||||
+ else if (desc->ViewDimension == D3D11_SRV_DIMENSION_TEXTURE1DARRAY)
|
||||
+ {
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.MostDetailedMip == expected_desc->miplevel_idx,
|
||||
+ "Got MostDetailedMip %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.MostDetailedMip, expected_desc->miplevel_idx);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.MipLevels == expected_desc->miplevel_count,
|
||||
+ "Got MipLevels %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.MipLevels, expected_desc->miplevel_count);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.FirstArraySlice == expected_desc->layer_idx,
|
||||
+ "Got FirstArraySlice %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.FirstArraySlice, expected_desc->layer_idx);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.ArraySize == expected_desc->layer_count,
|
||||
+ "Got ArraySize %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.ArraySize, expected_desc->layer_count);
|
||||
+ }
|
||||
+ else if (desc->ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D)
|
||||
{
|
||||
ok_(__FILE__, line)(U(*desc).Texture2D.MostDetailedMip == expected_desc->miplevel_idx,
|
||||
"Got MostDetailedMip %u, expected %u.\n",
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From c0da253595db60baf8174abac5d591223d1b570f 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:47:27 +0200
|
||||
Subject: d3d11/tests: Add support for 1d textures in check_rtv_desc_.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 20 +++++++++++++++++++-
|
||||
1 file changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index c26d6aa..639c54f 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -377,7 +377,25 @@ static void check_rtv_desc_(unsigned int line, const D3D11_RENDER_TARGET_VIEW_DE
|
||||
if (desc->ViewDimension != expected_desc->dimension)
|
||||
return;
|
||||
|
||||
- if (desc->ViewDimension == D3D11_RTV_DIMENSION_TEXTURE2D)
|
||||
+ if (desc->ViewDimension == D3D11_RTV_DIMENSION_TEXTURE1D)
|
||||
+ {
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1D.MipSlice == expected_desc->miplevel_idx,
|
||||
+ "Got MipSlice %u, expected %u.\n",
|
||||
+ U(*desc).Texture1D.MipSlice, expected_desc->miplevel_idx);
|
||||
+ }
|
||||
+ else if (desc->ViewDimension == D3D11_RTV_DIMENSION_TEXTURE1DARRAY)
|
||||
+ {
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.MipSlice == expected_desc->miplevel_idx,
|
||||
+ "Got MipSlice %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.MipSlice, expected_desc->miplevel_idx);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.FirstArraySlice == expected_desc->layer_idx,
|
||||
+ "Got FirstArraySlice %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.FirstArraySlice, expected_desc->layer_idx);
|
||||
+ ok_(__FILE__, line)(U(*desc).Texture1DArray.ArraySize == expected_desc->layer_count,
|
||||
+ "Got ArraySize %u, expected %u.\n",
|
||||
+ U(*desc).Texture1DArray.ArraySize, expected_desc->layer_count);
|
||||
+ }
|
||||
+ else if (desc->ViewDimension == D3D11_RTV_DIMENSION_TEXTURE2D)
|
||||
{
|
||||
ok_(__FILE__, line)(U(*desc).Texture2D.MipSlice == expected_desc->miplevel_idx,
|
||||
"Got MipSlice %u, expected %u.\n",
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,219 +0,0 @@
|
||||
From dad1b9f398b041ba706723cc8857fcc2e9cc2669 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:49:52 +0200
|
||||
Subject: d3d11/tests: Add test for creating 1d textures.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 189 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 189 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 8ad94af..2b0b6f6 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -1618,6 +1618,194 @@ static void test_get_immediate_context(void)
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_create_texture1d(void)
|
||||
+{
|
||||
+ ULONG refcount, expected_refcount;
|
||||
+ D3D11_SUBRESOURCE_DATA data = {0};
|
||||
+ D3D_FEATURE_LEVEL feature_level;
|
||||
+ ID3D11Device *device, *tmp;
|
||||
+ D3D11_TEXTURE1D_DESC desc;
|
||||
+ ID3D11Texture1D *texture;
|
||||
+ IDXGISurface *surface;
|
||||
+ unsigned int i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ static const struct
|
||||
+ {
|
||||
+ DXGI_FORMAT format;
|
||||
+ UINT array_size;
|
||||
+ D3D11_BIND_FLAG bind_flags;
|
||||
+ UINT misc_flags;
|
||||
+ BOOL succeeds;
|
||||
+ BOOL todo;
|
||||
+ }
|
||||
+ tests[] =
|
||||
+ {
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_VERTEX_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_INDEX_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_CONSTANT_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 0, D3D11_BIND_SHADER_RESOURCE, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 2, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 3, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 3, D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_TEXTURECUBE,
|
||||
+ FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_TEXTURECUBE,
|
||||
+ FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 5, D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_TEXTURECUBE,
|
||||
+ FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 0, D3D11_BIND_RENDER_TARGET, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 2, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 9, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32A32_SINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32B32_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16G16B16A16_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16G16B16A16_TYPELESS, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G32_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32G8X24_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R10G10B10A2_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R10G10B10A2_TYPELESS, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16G16_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16G16_UNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16G16_SNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32_TYPELESS, 0, D3D11_BIND_SHADER_RESOURCE, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32_TYPELESS, 9, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R32_TYPELESS, 9, D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_TEXTURECUBE,
|
||||
+ FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R32_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_VERTEX_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_INDEX_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_CONSTANT_BUFFER, 0, FALSE, TRUE},
|
||||
+ {DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R24G8_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8_TYPELESS, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8_UNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8_SNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_DEPTH_STENCIL, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16_TYPELESS, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R16_SINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8_TYPELESS, 1, D3D11_BIND_SHADER_RESOURCE, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8B8A8_UNORM, 1, D3D11_BIND_DEPTH_STENCIL, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8B8A8_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8B8A8_SNORM, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_R8G8B8A8_SINT, 1, D3D11_BIND_RENDER_TARGET, 0, TRUE, FALSE},
|
||||
+ {DXGI_FORMAT_D24_UNORM_S8_UINT, 1, D3D11_BIND_RENDER_TARGET, 0, FALSE, FALSE},
|
||||
+ {DXGI_FORMAT_D32_FLOAT, 1, D3D11_BIND_RENDER_TARGET, 0, FALSE, FALSE},
|
||||
+ };
|
||||
+
|
||||
+ if (!(device = create_device(NULL)))
|
||||
+ {
|
||||
+ skip("Failed to create device.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ feature_level = ID3D11Device_GetFeatureLevel(device);
|
||||
+
|
||||
+ desc.Width = 512;
|
||||
+ desc.MipLevels = 1;
|
||||
+ desc.ArraySize = 1;
|
||||
+ desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
+ desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
|
||||
+ desc.CPUAccessFlags = 0;
|
||||
+ desc.MiscFlags = 0;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, &data, &texture);
|
||||
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ expected_refcount = get_refcount((IUnknown *)device) + 1;
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, &texture);
|
||||
+ ok(SUCCEEDED(hr), "Failed to create a 1d texture, hr %#x.\n", hr);
|
||||
+ refcount = get_refcount((IUnknown *)device);
|
||||
+ ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount);
|
||||
+ tmp = NULL;
|
||||
+ expected_refcount = refcount + 1;
|
||||
+ ID3D11Texture1D_GetDevice(texture, &tmp);
|
||||
+ ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device);
|
||||
+ refcount = get_refcount((IUnknown *)device);
|
||||
+ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
|
||||
+ ID3D11Device_Release(tmp);
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
|
||||
+ ok(SUCCEEDED(hr), "Texture should implement IDXGISurface.\n");
|
||||
+ IDXGISurface_Release(surface);
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+
|
||||
+ desc.MipLevels = 0;
|
||||
+ expected_refcount = get_refcount((IUnknown *)device) + 1;
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, &texture);
|
||||
+ ok(SUCCEEDED(hr), "Failed to create a 1d texture, hr %#x.\n", hr);
|
||||
+ refcount = get_refcount((IUnknown *)device);
|
||||
+ ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount);
|
||||
+ tmp = NULL;
|
||||
+ expected_refcount = refcount + 1;
|
||||
+ ID3D11Texture1D_GetDevice(texture, &tmp);
|
||||
+ ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device);
|
||||
+ refcount = get_refcount((IUnknown *)device);
|
||||
+ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
|
||||
+ ID3D11Device_Release(tmp);
|
||||
+
|
||||
+ ID3D11Texture1D_GetDesc(texture, &desc);
|
||||
+ ok(desc.Width == 512, "Got unexpected Width %u.\n", desc.Width);
|
||||
+ ok(desc.MipLevels == 10, "Got unexpected MipLevels %u.\n", desc.MipLevels);
|
||||
+ ok(desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", desc.ArraySize);
|
||||
+ ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format);
|
||||
+ ok(desc.Usage == D3D11_USAGE_DEFAULT, "Got unexpected Usage %u.\n", desc.Usage);
|
||||
+ ok(desc.BindFlags == D3D11_BIND_RENDER_TARGET, "Got unexpected BindFlags %#x.\n", desc.BindFlags);
|
||||
+ ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %#x.\n", desc.CPUAccessFlags);
|
||||
+ ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %#x.\n", desc.MiscFlags);
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
|
||||
+ ok(FAILED(hr), "Texture should not implement IDXGISurface.\n");
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+
|
||||
+ desc.MipLevels = 1;
|
||||
+ desc.ArraySize = 2;
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, &texture);
|
||||
+ ok(SUCCEEDED(hr), "Failed to create a 1d texture, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
|
||||
+ ok(FAILED(hr), "Texture should not implement IDXGISurface.\n");
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+
|
||||
+ for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i)
|
||||
+ {
|
||||
+ HRESULT expected_hr = tests[i].succeeds ? S_OK : E_INVALIDARG;
|
||||
+ BOOL todo = tests[i].todo;
|
||||
+
|
||||
+ if (feature_level < D3D_FEATURE_LEVEL_10_1
|
||||
+ && (tests[i].misc_flags & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
+ && tests[i].array_size > 6)
|
||||
+ {
|
||||
+ expected_hr = E_INVALIDARG;
|
||||
+ todo = TRUE;
|
||||
+ }
|
||||
+
|
||||
+ desc.ArraySize = tests[i].array_size;
|
||||
+ desc.Format = tests[i].format;
|
||||
+ desc.BindFlags = tests[i].bind_flags;
|
||||
+ desc.MiscFlags = tests[i].misc_flags;
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, (ID3D11Texture1D **)&texture);
|
||||
+
|
||||
+ todo_wine_if(todo)
|
||||
+ ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr);
|
||||
+
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+ }
|
||||
+
|
||||
+ refcount = ID3D11Device_Release(device);
|
||||
+ ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
+}
|
||||
+
|
||||
static void test_create_texture2d(void)
|
||||
{
|
||||
ULONG refcount, expected_refcount;
|
||||
@@ -12282,6 +12470,7 @@ START_TEST(d3d11)
|
||||
test_create_device();
|
||||
run_for_each_feature_level(test_device_interfaces);
|
||||
test_get_immediate_context();
|
||||
+ test_create_texture1d();
|
||||
test_create_texture2d();
|
||||
test_texture2d_interfaces();
|
||||
test_create_texture3d();
|
||||
--
|
||||
2.9.0
|
||||
|
@ -1,189 +0,0 @@
|
||||
From a5f4ae0710b650be91c1b4e0e565fa8e816f75b0 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:50:30 +0200
|
||||
Subject: d3d11/tests: Test 1d texture interfaces.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 159 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 02eeb88..861e3fc 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -1801,6 +1801,164 @@ static void test_create_texture1d(void)
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_texture1d_interfaces(void)
|
||||
+{
|
||||
+ ID3D10Texture1D *d3d10_texture;
|
||||
+ D3D11_TEXTURE1D_DESC desc;
|
||||
+ ID3D11Texture1D *texture;
|
||||
+ IDXGISurface *surface;
|
||||
+ ID3D11Device *device;
|
||||
+ unsigned int i;
|
||||
+ ULONG refcount;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ static const struct test
|
||||
+ {
|
||||
+ BOOL implements_d3d10_interfaces;
|
||||
+ UINT bind_flags;
|
||||
+ UINT misc_flags;
|
||||
+ UINT expected_bind_flags;
|
||||
+ UINT expected_misc_flags;
|
||||
+ }
|
||||
+ desc_conversion_tests[] =
|
||||
+ {
|
||||
+ {
|
||||
+ TRUE,
|
||||
+ D3D11_BIND_SHADER_RESOURCE, 0,
|
||||
+ D3D10_BIND_SHADER_RESOURCE, 0
|
||||
+ },
|
||||
+ {
|
||||
+ TRUE,
|
||||
+ D3D11_BIND_UNORDERED_ACCESS, 0,
|
||||
+ D3D11_BIND_UNORDERED_ACCESS, 0
|
||||
+ },
|
||||
+ {
|
||||
+ FALSE,
|
||||
+ 0, D3D11_RESOURCE_MISC_RESOURCE_CLAMP,
|
||||
+ 0, 0
|
||||
+ },
|
||||
+ {
|
||||
+ TRUE,
|
||||
+ 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX,
|
||||
+ 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX
|
||||
+ },
|
||||
+ /* Fails on WARP, needs to be verified using real hardware
|
||||
+ {
|
||||
+ TRUE,
|
||||
+ 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX | D3D11_RESOURCE_MISC_SHARED_NTHANDLE,
|
||||
+ 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX
|
||||
+ },
|
||||
+ */
|
||||
+ };
|
||||
+
|
||||
+ if (!(device = create_device(NULL)))
|
||||
+ {
|
||||
+ skip("Failed to create ID3D11Device, skipping tests.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ desc.Width = 512;
|
||||
+ desc.MipLevels = 0;
|
||||
+ desc.ArraySize = 1;
|
||||
+ desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
+ desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
|
||||
+ desc.CPUAccessFlags = 0;
|
||||
+ desc.MiscFlags = 0;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, &texture);
|
||||
+ ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
|
||||
+ ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n");
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_ID3D10Texture1D, (void **)&d3d10_texture);
|
||||
+ ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
|
||||
+ "Texture should implement ID3D10Texture1D.\n");
|
||||
+ if (SUCCEEDED(hr)) ID3D10Texture1D_Release(d3d10_texture);
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ win_skip("2D textures do not implement ID3D10Texture1D, skipping tests.\n");
|
||||
+ ID3D11Device_Release(device);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i)
|
||||
+ {
|
||||
+ const struct test *current = &desc_conversion_tests[i];
|
||||
+ D3D10_TEXTURE1D_DESC d3d10_desc;
|
||||
+ ID3D10Device *d3d10_device;
|
||||
+
|
||||
+ desc.Width = 512;
|
||||
+ desc.MipLevels = 1;
|
||||
+ desc.ArraySize = 1;
|
||||
+ desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
+ desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ desc.BindFlags = current->bind_flags;
|
||||
+ desc.CPUAccessFlags = 0;
|
||||
+ desc.MiscFlags = current->misc_flags;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &desc, NULL, &texture);
|
||||
+ /* Shared resources are not supported by REF and WARP devices. */
|
||||
+ ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY),
|
||||
+ "Test %u: Failed to create a 1d texture, hr %#x.\n", i, hr);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ win_skip("Failed to create ID3D11Texture1D, skipping test %u.\n", i);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Texture should implement IDXGISurface.\n", i);
|
||||
+ IDXGISurface_Release(surface);
|
||||
+
|
||||
+ hr = ID3D11Texture1D_QueryInterface(texture, &IID_ID3D10Texture1D, (void **)&d3d10_texture);
|
||||
+ ID3D11Texture1D_Release(texture);
|
||||
+
|
||||
+ if (current->implements_d3d10_interfaces)
|
||||
+ {
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Texture should implement ID3D10Texture1D.\n", i);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ todo_wine ok(hr == E_NOINTERFACE, "Test %u: Texture should not implement ID3D10Texture1D.\n", i);
|
||||
+ if (SUCCEEDED(hr)) ID3D10Texture1D_Release(d3d10_texture);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ ID3D10Texture1D_GetDesc(d3d10_texture, &d3d10_desc);
|
||||
+
|
||||
+ ok(d3d10_desc.Width == desc.Width,
|
||||
+ "Test %u: Got unexpected Width %u.\n", i, d3d10_desc.Width);
|
||||
+ ok(d3d10_desc.MipLevels == desc.MipLevels,
|
||||
+ "Test %u: Got unexpected MipLevels %u.\n", i, d3d10_desc.MipLevels);
|
||||
+ ok(d3d10_desc.ArraySize == desc.ArraySize,
|
||||
+ "Test %u: Got unexpected ArraySize %u.\n", i, d3d10_desc.ArraySize);
|
||||
+ ok(d3d10_desc.Format == desc.Format,
|
||||
+ "Test %u: Got unexpected Format %u.\n", i, d3d10_desc.Format);
|
||||
+ ok(d3d10_desc.Usage == (D3D10_USAGE)desc.Usage,
|
||||
+ "Test %u: Got unexpected Usage %u.\n", i, d3d10_desc.Usage);
|
||||
+ ok(d3d10_desc.BindFlags == current->expected_bind_flags,
|
||||
+ "Test %u: Got unexpected BindFlags %#x.\n", i, d3d10_desc.BindFlags);
|
||||
+ ok(d3d10_desc.CPUAccessFlags == desc.CPUAccessFlags,
|
||||
+ "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d10_desc.CPUAccessFlags);
|
||||
+ ok(d3d10_desc.MiscFlags == current->expected_misc_flags,
|
||||
+ "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d10_desc.MiscFlags);
|
||||
+
|
||||
+ d3d10_device = (ID3D10Device *)0xdeadbeef;
|
||||
+ ID3D10Texture1D_GetDevice(d3d10_texture, &d3d10_device);
|
||||
+ todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device);
|
||||
+ if (d3d10_device) ID3D10Device_Release(d3d10_device);
|
||||
+
|
||||
+ ID3D10Texture1D_Release(d3d10_texture);
|
||||
+ }
|
||||
+
|
||||
+ refcount = ID3D11Device_Release(device);
|
||||
+ ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
+}
|
||||
+
|
||||
static void test_create_texture2d(void)
|
||||
{
|
||||
ULONG refcount, expected_refcount;
|
||||
@@ -10990,6 +11148,7 @@ START_TEST(d3d11)
|
||||
run_for_each_feature_level(test_device_interfaces);
|
||||
test_get_immediate_context();
|
||||
test_create_texture1d();
|
||||
+ test_texture1d_interfaces();
|
||||
test_create_texture2d();
|
||||
test_texture2d_interfaces();
|
||||
test_create_texture3d();
|
||||
--
|
||||
2.9.0
|
||||
|
@ -1,93 +0,0 @@
|
||||
From d4e5a58b69c7e8810c811041234134fe5062f931 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:52:23 +0200
|
||||
Subject: d3d11/tests: Test the creation of 1d render buffers in
|
||||
test_create_rendertarget_view.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 41 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 9aa21584d8..063b30ebf1 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -3262,6 +3262,7 @@ static void test_create_rendertarget_view(void)
|
||||
D3D11_RENDER_TARGET_VIEW_DESC rtv_desc;
|
||||
D3D11_TEXTURE3D_DESC texture3d_desc;
|
||||
D3D11_TEXTURE2D_DESC texture2d_desc;
|
||||
+ D3D11_TEXTURE1D_DESC texture1d_desc;
|
||||
D3D11_SUBRESOURCE_DATA data = {0};
|
||||
ULONG refcount, expected_refcount;
|
||||
D3D11_BUFFER_DESC buffer_desc;
|
||||
@@ -3269,6 +3270,7 @@ static void test_create_rendertarget_view(void)
|
||||
ID3D11Device *device, *tmp;
|
||||
ID3D11Texture3D *texture3d;
|
||||
ID3D11Texture2D *texture2d;
|
||||
+ ID3D11Texture1D *texture1d;
|
||||
ID3D11Resource *texture;
|
||||
ID3D11Buffer *buffer;
|
||||
unsigned int i;
|
||||
@@ -3298,6 +3300,23 @@ static void test_create_rendertarget_view(void)
|
||||
}
|
||||
tests[] =
|
||||
{
|
||||
+ {{ 1, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D, 0}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D, 0}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D, 0}, {RGBA8_UNORM, TEX_1D, 0}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D, 1}, {RGBA8_UNORM, TEX_1D, 1}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D, 9}, {RGBA8_UNORM, TEX_1D, 9}},
|
||||
+ {{ 1, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_1D, 0}, {RGBA8_UNORM, TEX_1D, 0}},
|
||||
+ {{10, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_1D, 0}, {RGBA8_UNORM, TEX_1D, 0}},
|
||||
+ {{ 1, 4, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 1, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 1, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 3, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 3, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 5, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 5, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 9, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 9, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, 1, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 1, 3}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, 2, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 2, 2}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, 3, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 3, 1}},
|
||||
{{ 1, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_2D, 0}},
|
||||
{{10, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_2D, 0}},
|
||||
{{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_2D, 0}, {RGBA8_UNORM, TEX_2D, 0}},
|
||||
@@ -3460,6 +3479,12 @@ static void test_create_rendertarget_view(void)
|
||||
ID3D11RenderTargetView_Release(rtview);
|
||||
ID3D11Buffer_Release(buffer);
|
||||
|
||||
+ texture1d_desc.Width = 512;
|
||||
+ texture1d_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ texture1d_desc.BindFlags = D3D11_BIND_RENDER_TARGET;
|
||||
+ texture1d_desc.CPUAccessFlags = 0;
|
||||
+ texture1d_desc.MiscFlags = 0;
|
||||
+
|
||||
texture2d_desc.Width = 512;
|
||||
texture2d_desc.Height = 512;
|
||||
texture2d_desc.SampleDesc.Count = 1;
|
||||
@@ -3480,7 +3505,21 @@ static void test_create_rendertarget_view(void)
|
||||
{
|
||||
D3D11_RENDER_TARGET_VIEW_DESC *current_desc;
|
||||
|
||||
- if (tests[i].expected_rtv_desc.dimension != D3D11_RTV_DIMENSION_TEXTURE3D)
|
||||
+ if (tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE1D ||
|
||||
+ tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE1DARRAY)
|
||||
+ {
|
||||
+ texture1d_desc.MipLevels = tests[i].texture.miplevel_count;
|
||||
+ texture1d_desc.ArraySize = tests[i].texture.depth_or_array_size;
|
||||
+ texture1d_desc.Format = tests[i].texture.format;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &texture1d_desc, NULL, &texture1d);
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
+ texture = (ID3D11Resource *)texture1d;
|
||||
+ }
|
||||
+ else if (tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE2D ||
|
||||
+ tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE2DARRAY ||
|
||||
+ tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE2DMS ||
|
||||
+ tests[i].expected_rtv_desc.dimension == D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY)
|
||||
{
|
||||
texture2d_desc.MipLevels = tests[i].texture.miplevel_count;
|
||||
texture2d_desc.ArraySize = tests[i].texture.depth_or_array_size;
|
||||
--
|
||||
2.12.2
|
||||
|
@ -1,93 +0,0 @@
|
||||
From 2ba57281f31901b2f9ce05947e44b4a6e7035550 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:54:13 +0200
|
||||
Subject: d3d11/tests: Test the creation of 1d shader resource views in
|
||||
test_create_shader_resource_view.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 41 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 063b30ebf1..81cced86c3 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -3609,6 +3609,7 @@ static void test_create_shader_resource_view(void)
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc;
|
||||
D3D11_TEXTURE3D_DESC texture3d_desc;
|
||||
D3D11_TEXTURE2D_DESC texture2d_desc;
|
||||
+ D3D11_TEXTURE1D_DESC texture1d_desc;
|
||||
ULONG refcount, expected_refcount;
|
||||
ID3D11ShaderResourceView *srview;
|
||||
D3D_FEATURE_LEVEL feature_level;
|
||||
@@ -3616,6 +3617,7 @@ static void test_create_shader_resource_view(void)
|
||||
ID3D11Device *device, *tmp;
|
||||
ID3D11Texture3D *texture3d;
|
||||
ID3D11Texture2D *texture2d;
|
||||
+ ID3D11Texture1D *texture1d;
|
||||
ID3D11Resource *texture;
|
||||
ID3D11Buffer *buffer;
|
||||
unsigned int i;
|
||||
@@ -3647,6 +3649,21 @@ static void test_create_shader_resource_view(void)
|
||||
}
|
||||
tests[] =
|
||||
{
|
||||
+ {{10, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D, 0, 10}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D, 0, ~0u}, {RGBA8_UNORM, TEX_1D, 0, 10}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_1D, 0, ~0u}, {RGBA8_UNORM, TEX_1D, 0, 10}},
|
||||
+ {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D, 0, 10}, {RGBA8_UNORM, TEX_1D, 0, 10}},
|
||||
+ {{ 1, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_1D, 0, ~0u}, {RGBA8_UNORM, TEX_1D, 0, 1}},
|
||||
+ {{10, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_1D, 0, ~0u}, {RGBA8_UNORM, TEX_1D, 0, 10}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 10, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, ~0u, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 10, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 1, ~0u, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 1, 9, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 3, ~0u, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 3, 7, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 5, ~0u, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 5, 5, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 9, ~0u, 0, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 9, 1, 0, 4}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, ~0u, 1, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 10, 1, 3}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, ~0u, 2, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 10, 2, 2}},
|
||||
+ {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_1D_ARRAY, 0, ~0u, 3, ~0u}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 10, 3, 1}},
|
||||
{{10, 1, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_2D, 0, 10}},
|
||||
{{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_2D, 0, ~0u}, {RGBA8_UNORM, TEX_2D, 0, 10}},
|
||||
{{10, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_2D, 0, ~0u}, {RGBA8_UNORM, TEX_2D, 0, 10}},
|
||||
@@ -3847,6 +3864,12 @@ static void test_create_shader_resource_view(void)
|
||||
skip("Structured buffers require feature level 11_0.\n");
|
||||
}
|
||||
|
||||
+ texture1d_desc.Width = 512;
|
||||
+ texture1d_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ texture1d_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
+ texture1d_desc.CPUAccessFlags = 0;
|
||||
+ texture1d_desc.MiscFlags = 0;
|
||||
+
|
||||
texture2d_desc.Width = 512;
|
||||
texture2d_desc.Height = 512;
|
||||
texture2d_desc.SampleDesc.Count = 1;
|
||||
@@ -3866,7 +3889,23 @@ static void test_create_shader_resource_view(void)
|
||||
{
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC *current_desc;
|
||||
|
||||
- if (tests[i].expected_srv_desc.dimension != D3D11_SRV_DIMENSION_TEXTURE3D)
|
||||
+ if (tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE1D ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE1DARRAY)
|
||||
+ {
|
||||
+ texture1d_desc.MipLevels = tests[i].texture.miplevel_count;
|
||||
+ texture1d_desc.ArraySize = tests[i].texture.depth_or_array_size;
|
||||
+ texture1d_desc.Format = tests[i].texture.format;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &texture1d_desc, NULL, &texture1d);
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Failed to create 1d texture, hr %#x.\n", i, hr);
|
||||
+ texture = (ID3D11Resource *)texture1d;
|
||||
+ }
|
||||
+ else if (tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE2D ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE2DARRAY ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE2DMS ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURECUBE ||
|
||||
+ tests[i].expected_srv_desc.dimension == D3D11_SRV_DIMENSION_TEXTURECUBEARRAY)
|
||||
{
|
||||
texture2d_desc.MipLevels = tests[i].texture.miplevel_count;
|
||||
texture2d_desc.ArraySize = tests[i].texture.depth_or_array_size;
|
||||
--
|
||||
2.12.2
|
||||
|
@ -1,260 +0,0 @@
|
||||
From 493acad9e14688b4acb817ac1daa59b2f21ef809 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 20:06:28 +0200
|
||||
Subject: d3d11/tests: Prepare test_texture for non 2d textures.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 140 +++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 87 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index a9d03322283..daf5dbdbd55 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -6245,6 +6245,7 @@ static void test_texture(void)
|
||||
};
|
||||
struct texture
|
||||
{
|
||||
+ UINT dimension;
|
||||
UINT width;
|
||||
UINT height;
|
||||
UINT miplevel_count;
|
||||
@@ -6256,7 +6257,7 @@ static void test_texture(void)
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc;
|
||||
struct d3d11_test_context test_context;
|
||||
const struct texture *current_texture;
|
||||
- D3D11_TEXTURE2D_DESC texture_desc;
|
||||
+ D3D11_TEXTURE2D_DESC texture2d_desc;
|
||||
D3D11_SAMPLER_DESC sampler_desc;
|
||||
const struct shader *current_ps;
|
||||
D3D_FEATURE_LEVEL feature_level;
|
||||
@@ -6264,7 +6265,7 @@ static void test_texture(void)
|
||||
ID3D11DeviceContext *context;
|
||||
ID3D11SamplerState *sampler;
|
||||
struct resource_readback rb;
|
||||
- ID3D11Texture2D *texture;
|
||||
+ ID3D11Resource *texture;
|
||||
struct vec4 ps_constant;
|
||||
ID3D11PixelShader *ps;
|
||||
ID3D11Device *device;
|
||||
@@ -6625,6 +6626,7 @@ static void test_texture(void)
|
||||
};
|
||||
static const struct texture rgba_texture =
|
||||
{
|
||||
+ D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
4, 4, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
{
|
||||
{rgba_level_0, 4 * sizeof(*rgba_level_0), 0},
|
||||
@@ -6632,33 +6634,51 @@ static void test_texture(void)
|
||||
{rgba_level_2, sizeof(*rgba_level_2), 0},
|
||||
}
|
||||
};
|
||||
- static const struct texture srgb_texture = {4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
|
||||
- {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
- static const struct texture srgb_typeless = {4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_TYPELESS,
|
||||
- {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
- static const struct texture a8_texture = {4, 4, 1, 1, DXGI_FORMAT_A8_UNORM,
|
||||
- {{a8_data, 4 * sizeof(*a8_data)}}};
|
||||
- static const struct texture bc1_texture = {8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM, {{bc1_data, 2 * 8}}};
|
||||
- static const struct texture bc2_texture = {8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM, {{bc2_data, 2 * 16}}};
|
||||
- static const struct texture bc3_texture = {8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM, {{bc3_data, 2 * 16}}};
|
||||
- static const struct texture bc4_texture = {8, 8, 1, 1, DXGI_FORMAT_BC4_UNORM, {{bc4_data, 2 * 8}}};
|
||||
- static const struct texture bc5_texture = {8, 8, 1, 1, DXGI_FORMAT_BC5_UNORM, {{bc5_data, 2 * 16}}};
|
||||
- static const struct texture bc6h_u_texture = {8, 8, 1, 1, DXGI_FORMAT_BC6H_UF16, {{bc6h_u_data, 2 * 16}}};
|
||||
- static const struct texture bc6h_s_texture = {8, 8, 1, 1, DXGI_FORMAT_BC6H_SF16, {{bc6h_s_data, 2 * 16}}};
|
||||
- static const struct texture bc7_texture = {8, 8, 1, 1, DXGI_FORMAT_BC7_UNORM, {{bc7_data, 2 * 16}}};
|
||||
- static const struct texture bc1_texture_srgb = {8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM_SRGB, {{bc1_data, 2 * 8}}};
|
||||
- static const struct texture bc2_texture_srgb = {8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM_SRGB, {{bc2_data, 2 * 16}}};
|
||||
- static const struct texture bc3_texture_srgb = {8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM_SRGB, {{bc3_data, 2 * 16}}};
|
||||
- static const struct texture bc7_texture_srgb = {8, 8, 1, 1, DXGI_FORMAT_BC7_UNORM_SRGB, {{bc7_data, 2 * 16}}};
|
||||
- static const struct texture bc1_typeless = {8, 8, 1, 1, DXGI_FORMAT_BC1_TYPELESS, {{bc1_data, 2 * 8}}};
|
||||
- static const struct texture bc2_typeless = {8, 8, 1, 1, DXGI_FORMAT_BC2_TYPELESS, {{bc2_data, 2 * 16}}};
|
||||
- static const struct texture bc3_typeless = {8, 8, 1, 1, DXGI_FORMAT_BC3_TYPELESS, {{bc3_data, 2 * 16}}};
|
||||
- static const struct texture sint8_texture = {4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_SINT,
|
||||
+ static const struct texture srgb_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
+ static const struct texture srgb_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_TYPELESS, {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
+ static const struct texture a8_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_A8_UNORM, {{a8_data, 4 * sizeof(*a8_data)}}};
|
||||
+ static const struct texture bc1_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM, {{bc1_data, 2 * 8}}};
|
||||
+ static const struct texture bc2_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM, {{bc2_data, 2 * 16}}};
|
||||
+ static const struct texture bc3_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM, {{bc3_data, 2 * 16}}};
|
||||
+ static const struct texture bc4_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC4_UNORM, {{bc4_data, 2 * 8}}};
|
||||
+ static const struct texture bc5_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC5_UNORM, {{bc5_data, 2 * 16}}};
|
||||
+ static const struct texture bc6h_u_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC6H_UF16, {{bc6h_u_data, 2 * 16}}};
|
||||
+ static const struct texture bc6h_s_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC6H_SF16, {{bc6h_s_data, 2 * 16}}};
|
||||
+ static const struct texture bc7_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC7_UNORM, {{bc7_data, 2 * 16}}};
|
||||
+ static const struct texture bc1_texture_srgb = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC1_UNORM_SRGB, {{bc1_data, 2 * 8}}};
|
||||
+ static const struct texture bc2_texture_srgb = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC2_UNORM_SRGB, {{bc2_data, 2 * 16}}};
|
||||
+ static const struct texture bc3_texture_srgb = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC3_UNORM_SRGB, {{bc3_data, 2 * 16}}};
|
||||
+ static const struct texture bc7_texture_srgb = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC7_UNORM_SRGB, {{bc7_data, 2 * 16}}};
|
||||
+ static const struct texture bc1_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC1_TYPELESS, {{bc1_data, 2 * 8}}};
|
||||
+ static const struct texture bc2_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC2_TYPELESS, {{bc2_data, 2 * 16}}};
|
||||
+ static const struct texture bc3_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 8, 8, 1, 1, DXGI_FORMAT_BC3_TYPELESS, {{bc3_data, 2 * 16}}};
|
||||
+ static const struct texture sint8_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_SINT,
|
||||
{{rgba_level_0, 4 * sizeof(*rgba_level_0)}}};
|
||||
- static const struct texture uint8_texture = {4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
+ static const struct texture uint8_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UINT,
|
||||
{{rgba_level_0, 4 * sizeof(*rgba_level_0)}}};
|
||||
static const struct texture array_2d_texture =
|
||||
{
|
||||
+ D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
4, 4, 1, 3, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
{
|
||||
{red_data, 6 * sizeof(*red_data)},
|
||||
@@ -6666,11 +6686,14 @@ static void test_texture(void)
|
||||
{blue_data, 5 * sizeof(*blue_data)},
|
||||
}
|
||||
};
|
||||
- static const struct texture r32f_typeless = {4, 4, 1, 1, DXGI_FORMAT_R32_TYPELESS,
|
||||
+ static const struct texture r32f_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R32_TYPELESS,
|
||||
{{r32_float, 4 * sizeof(*r32_float)}}};
|
||||
- static const struct texture r32u_typeless = {4, 4, 1, 1, DXGI_FORMAT_R32_TYPELESS,
|
||||
+ static const struct texture r32u_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R32_TYPELESS,
|
||||
{{r32_uint, 4 * sizeof(*r32_uint)}}};
|
||||
- static const struct texture r9g9b9e5_texture = {4, 4, 1, 1, DXGI_FORMAT_R9G9B9E5_SHAREDEXP,
|
||||
+ static const struct texture r9g9b9e5_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
+ 4, 4, 1, 1, DXGI_FORMAT_R9G9B9E5_SHAREDEXP,
|
||||
{{r9g9b9e5_data, 4 * sizeof(*r9g9b9e5_data)}}};
|
||||
static const DWORD red_colors[] =
|
||||
{
|
||||
@@ -6968,12 +6991,12 @@ static void test_texture(void)
|
||||
|
||||
ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &cb);
|
||||
|
||||
- texture_desc.SampleDesc.Count = 1;
|
||||
- texture_desc.SampleDesc.Quality = 0;
|
||||
- texture_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
- texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
- texture_desc.CPUAccessFlags = 0;
|
||||
- texture_desc.MiscFlags = 0;
|
||||
+ texture2d_desc.SampleDesc.Count = 1;
|
||||
+ texture2d_desc.SampleDesc.Quality = 0;
|
||||
+ texture2d_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ texture2d_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
+ texture2d_desc.CPUAccessFlags = 0;
|
||||
+ texture2d_desc.MiscFlags = 0;
|
||||
|
||||
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
|
||||
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
@@ -7031,7 +7054,7 @@ static void test_texture(void)
|
||||
if (current_texture != test->texture)
|
||||
{
|
||||
if (texture)
|
||||
- ID3D11Texture2D_Release(texture);
|
||||
+ ID3D11Resource_Release(texture);
|
||||
if (srv)
|
||||
ID3D11ShaderResourceView_Release(srv);
|
||||
|
||||
@@ -7039,16 +7062,23 @@ static void test_texture(void)
|
||||
|
||||
if (current_texture)
|
||||
{
|
||||
- texture_desc.Width = current_texture->width;
|
||||
- texture_desc.Height = current_texture->height;
|
||||
- texture_desc.MipLevels = current_texture->miplevel_count;
|
||||
- texture_desc.ArraySize = current_texture->array_size;
|
||||
- texture_desc.Format = current_texture->format;
|
||||
+ if (current_texture->dimension == D3D11_RESOURCE_DIMENSION_TEXTURE2D)
|
||||
+ {
|
||||
+ ID3D11Texture2D *texture2d;
|
||||
+
|
||||
+ texture2d_desc.Width = current_texture->width;
|
||||
+ texture2d_desc.Height = current_texture->height;
|
||||
+ texture2d_desc.MipLevels = current_texture->miplevel_count;
|
||||
+ texture2d_desc.ArraySize = current_texture->array_size;
|
||||
+ texture2d_desc.Format = current_texture->format;
|
||||
|
||||
- hr = ID3D11Device_CreateTexture2D(device, &texture_desc, current_texture->data, &texture);
|
||||
- ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
+ hr = ID3D11Device_CreateTexture2D(device, &texture2d_desc, current_texture->data, &texture2d);
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
+ texture = (ID3D11Resource *)texture2d;
|
||||
+ }
|
||||
|
||||
- hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &srv);
|
||||
+
|
||||
+ hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, &srv);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to create shader resource view, hr %#x.\n", i, hr);
|
||||
}
|
||||
else
|
||||
@@ -7102,7 +7132,7 @@ static void test_texture(void)
|
||||
ID3D11ShaderResourceView_Release(srv);
|
||||
ID3D11SamplerState_Release(sampler);
|
||||
if (texture)
|
||||
- ID3D11Texture2D_Release(texture);
|
||||
+ ID3D11Resource_Release(texture);
|
||||
ID3D11PixelShader_Release(ps);
|
||||
|
||||
if (is_warp_device(device) && feature_level < D3D_FEATURE_LEVEL_11_0)
|
||||
@@ -7147,26 +7177,30 @@ static void test_texture(void)
|
||||
|
||||
if (current_texture != test->texture)
|
||||
{
|
||||
+ ID3D11Texture2D *texture2d;
|
||||
+
|
||||
if (texture)
|
||||
- ID3D11Texture2D_Release(texture);
|
||||
+ ID3D11Resource_Release(texture);
|
||||
|
||||
current_texture = test->texture;
|
||||
|
||||
- texture_desc.Width = current_texture->width;
|
||||
- texture_desc.Height = current_texture->height;
|
||||
- texture_desc.MipLevels = current_texture->miplevel_count;
|
||||
- texture_desc.ArraySize = current_texture->array_size;
|
||||
- texture_desc.Format = current_texture->format;
|
||||
+ texture2d_desc.Width = current_texture->width;
|
||||
+ texture2d_desc.Height = current_texture->height;
|
||||
+ texture2d_desc.MipLevels = current_texture->miplevel_count;
|
||||
+ texture2d_desc.ArraySize = current_texture->array_size;
|
||||
+ texture2d_desc.Format = current_texture->format;
|
||||
|
||||
- hr = ID3D11Device_CreateTexture2D(device, &texture_desc, current_texture->data, &texture);
|
||||
+ hr = ID3D11Device_CreateTexture2D(device, &texture2d_desc, current_texture->data, &texture2d);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
+
|
||||
+ texture = (ID3D11Resource *)texture2d;
|
||||
}
|
||||
|
||||
if (srv)
|
||||
ID3D11ShaderResourceView_Release(srv);
|
||||
|
||||
get_srv_desc(&srv_desc, &test->srv_desc);
|
||||
- hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, &srv_desc, &srv);
|
||||
+ hr = ID3D11Device_CreateShaderResourceView(device, texture, &srv_desc, &srv);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to create shader resource view, hr %#x.\n", i, hr);
|
||||
|
||||
ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &srv);
|
||||
@@ -7191,7 +7225,7 @@ static void test_texture(void)
|
||||
release_resource_readback(&rb);
|
||||
}
|
||||
ID3D11PixelShader_Release(ps);
|
||||
- ID3D11Texture2D_Release(texture);
|
||||
+ ID3D11Resource_Release(texture);
|
||||
ID3D11ShaderResourceView_Release(srv);
|
||||
ID3D11SamplerState_Release(sampler);
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,72 +0,0 @@
|
||||
From f37e1685852b44f4ecb3a6d20a1aa54adfeb2c6d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 20:08:56 +0200
|
||||
Subject: d3d11/tests: Prepare test_texture for 1d textures.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 24 +++++++++++++++++++++++-
|
||||
1 file changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 7768cdb..50dc3b9 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -5684,6 +5684,7 @@ static void test_texture(void)
|
||||
struct d3d11_test_context test_context;
|
||||
const struct texture *current_texture;
|
||||
D3D11_TEXTURE2D_DESC texture2d_desc;
|
||||
+ D3D11_TEXTURE1D_DESC texture1d_desc;
|
||||
D3D11_SAMPLER_DESC sampler_desc;
|
||||
const struct shader *current_ps;
|
||||
D3D_FEATURE_LEVEL feature_level;
|
||||
@@ -6365,6 +6366,11 @@ static void test_texture(void)
|
||||
texture2d_desc.CPUAccessFlags = 0;
|
||||
texture2d_desc.MiscFlags = 0;
|
||||
|
||||
+ texture1d_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
+ texture1d_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
+ texture1d_desc.CPUAccessFlags = 0;
|
||||
+ texture1d_desc.MiscFlags = 0;
|
||||
+
|
||||
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
|
||||
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
@@ -6443,7 +6449,19 @@ static void test_texture(void)
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
texture = (ID3D11Resource *)texture2d;
|
||||
}
|
||||
+ else if (current_texture->dimension == D3D11_RESOURCE_DIMENSION_TEXTURE1D)
|
||||
+ {
|
||||
+ ID3D11Texture1D *texture1d;
|
||||
|
||||
+ texture1d_desc.Width = current_texture->width;
|
||||
+ texture1d_desc.MipLevels = current_texture->miplevel_count;
|
||||
+ texture1d_desc.ArraySize = current_texture->array_size;
|
||||
+ texture1d_desc.Format = current_texture->format;
|
||||
+
|
||||
+ hr = ID3D11Device_CreateTexture1D(device, &texture1d_desc, current_texture->data, &texture1d);
|
||||
+ ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
|
||||
+ texture = (ID3D11Resource *)texture1d;
|
||||
+ }
|
||||
|
||||
hr = ID3D11Device_CreateShaderResourceView(device, texture, NULL, &srv);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to create shader resource view, hr %#x.\n", i, hr);
|
||||
@@ -6486,10 +6504,14 @@ static void test_texture(void)
|
||||
get_texture_readback(test_context.backbuffer, 0, &rb);
|
||||
for (y = 0; y < 4; ++y)
|
||||
{
|
||||
+ int row = y;
|
||||
+ if (test->texture && test->texture->dimension == D3D11_RESOURCE_DIMENSION_TEXTURE1D)
|
||||
+ row = 0;
|
||||
+
|
||||
for (x = 0; x < 4; ++x)
|
||||
{
|
||||
color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120);
|
||||
- ok(compare_color(color, test->expected_colors[y * 4 + x], 2),
|
||||
+ ok(compare_color(color, test->expected_colors[row * 4 + x], 2),
|
||||
"Test %u: Got unexpected color 0x%08x at (%u, %u).\n", i, color, x, y);
|
||||
}
|
||||
}
|
||||
--
|
||||
2.8.1
|
||||
|
@ -1,169 +0,0 @@
|
||||
From b2cf9ce61714a32e5f1727711b349a42b372bf10 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 20:15:54 +0200
|
||||
Subject: d3d11/tests: Add some basic 1d texture tests in test_texture.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 109 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 268ba4cc77d..28802d3ea8f 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -6017,6 +6017,38 @@ static void test_texture(void)
|
||||
0x00107e46, 0x00000000, 0x0100003e,
|
||||
};
|
||||
static const struct shader ps_ld = {ps_ld_code, sizeof(ps_ld_code)};
|
||||
+ static const DWORD ps_ld_1d_code[] =
|
||||
+ {
|
||||
+#if 0
|
||||
+ Texture1D t;
|
||||
+
|
||||
+ float miplevel;
|
||||
+
|
||||
+ float4 main(float4 position : SV_POSITION) : SV_TARGET
|
||||
+ {
|
||||
+ float2 p;
|
||||
+ t.GetDimensions(miplevel, p.x, p.y);
|
||||
+ p.y = miplevel;
|
||||
+ p *= float2(position.x / 640.0f, 1.0f);
|
||||
+ return t.Load(int2(p));
|
||||
+ }
|
||||
+#endif
|
||||
+ 0x43425844, 0x7b0c6359, 0x598178f6, 0xef2ddbdb, 0x88fc794c, 0x00000001, 0x000001ac, 0x00000003,
|
||||
+ 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
|
||||
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000010f, 0x505f5653, 0x5449534f, 0x004e4f49,
|
||||
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
|
||||
+ 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000110, 0x00000040,
|
||||
+ 0x00000044, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04001058, 0x00107000, 0x00000000,
|
||||
+ 0x00005555, 0x04002064, 0x00101012, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
|
||||
+ 0x02000068, 0x00000001, 0x0600001c, 0x00100012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000,
|
||||
+ 0x0700003d, 0x001000f2, 0x00000000, 0x0010000a, 0x00000000, 0x00107e46, 0x00000000, 0x07000038,
|
||||
+ 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010100a, 0x00000000, 0x06000036, 0x001000e2,
|
||||
+ 0x00000000, 0x00208006, 0x00000000, 0x00000000, 0x0a000038, 0x001000f2, 0x00000000, 0x00100e46,
|
||||
+ 0x00000000, 0x00004002, 0x3acccccd, 0x3f800000, 0x3f800000, 0x3f800000, 0x0500001b, 0x001000f2,
|
||||
+ 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000,
|
||||
+ 0x00107e46, 0x00000000, 0x0100003e,
|
||||
+ };
|
||||
+ static const struct shader ps_ld_1d = {ps_ld_1d_code, sizeof(ps_ld_1d_code)};
|
||||
static const DWORD ps_ld_sint8_code[] =
|
||||
{
|
||||
#if 0
|
||||
@@ -6175,6 +6207,38 @@ static void test_texture(void)
|
||||
0x0020800a, 0x00000000, 0x00000000, 0x0100003e,
|
||||
};
|
||||
static const struct shader ps_sample_l = {ps_sample_l_code, sizeof(ps_sample_l_code)};
|
||||
+ static const DWORD ps_sample_1d_array_code[] =
|
||||
+ {
|
||||
+#if 0
|
||||
+ Texture1DArray t;
|
||||
+ SamplerState s;
|
||||
+
|
||||
+ float layer;
|
||||
+
|
||||
+ float4 main(float4 position : SV_POSITION) : SV_TARGET
|
||||
+ {
|
||||
+ float2 d;
|
||||
+ float2 p = float2(position.x / 640.0f, 1.0f);
|
||||
+ t.GetDimensions(d.x, d.y);
|
||||
+ d.y = layer;
|
||||
+ return t.Sample(s, p * d);
|
||||
+ }
|
||||
+#endif
|
||||
+ 0x43425844, 0xea01b174, 0x353dc8ae, 0x8723fd43, 0x7c530e08, 0x00000001, 0x00000188, 0x00000003,
|
||||
+ 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
|
||||
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000010f, 0x505f5653, 0x5449534f, 0x004e4f49,
|
||||
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
|
||||
+ 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x000000ec, 0x00000040,
|
||||
+ 0x0000003b, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000, 0x00000000,
|
||||
+ 0x04003858, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101012, 0x00000000, 0x00000001,
|
||||
+ 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0700003d, 0x001000f2, 0x00000000,
|
||||
+ 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x07000038, 0x00100022, 0x00000000, 0x0010100a,
|
||||
+ 0x00000000, 0x00004001, 0x3acccccd, 0x07000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
|
||||
+ 0x0010001a, 0x00000000, 0x06000036, 0x00100022, 0x00000000, 0x0020800a, 0x00000000, 0x00000000,
|
||||
+ 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000,
|
||||
+ 0x00000000, 0x0100003e,
|
||||
+ };
|
||||
+ static const struct shader ps_sample_1d_array = {ps_sample_1d_array_code, sizeof(ps_sample_1d_array_code)};
|
||||
static const DWORD ps_sample_2d_array_code[] =
|
||||
{
|
||||
#if 0
|
||||
@@ -6338,8 +6402,20 @@ static void test_texture(void)
|
||||
{rgba_level_2, sizeof(*rgba_level_2), 0},
|
||||
}
|
||||
};
|
||||
+ static const struct texture rgba_texture_1d =
|
||||
+ {
|
||||
+ D3D11_RESOURCE_DIMENSION_TEXTURE1D,
|
||||
+ 4, 1, 3, 1, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
+ {
|
||||
+ {rgba_level_0, 0, 0},
|
||||
+ {rgba_level_1, 0, 0},
|
||||
+ {rgba_level_2, 0, 0},
|
||||
+ }
|
||||
+ };
|
||||
static const struct texture srgb_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
+ static const struct texture srgb_texture_1d = {D3D11_RESOURCE_DIMENSION_TEXTURE1D,
|
||||
+ 4, 1, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, {{srgb_data, 0}}};
|
||||
static const struct texture srgb_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
4, 4, 1, 1, DXGI_FORMAT_R8G8B8A8_TYPELESS, {{srgb_data, 4 * sizeof(*srgb_data)}}};
|
||||
static const struct texture a8_texture = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
@@ -6390,6 +6466,16 @@ static void test_texture(void)
|
||||
{blue_data, 5 * sizeof(*blue_data)},
|
||||
}
|
||||
};
|
||||
+ static const struct texture array_1d_texture =
|
||||
+ {
|
||||
+ D3D11_RESOURCE_DIMENSION_TEXTURE1D,
|
||||
+ 4, 1, 1, 3, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
+ {
|
||||
+ {red_data, 0},
|
||||
+ {green_data, 0},
|
||||
+ {blue_data, 0},
|
||||
+ }
|
||||
+ };
|
||||
static const struct texture r32f_typeless = {D3D11_RESOURCE_DIMENSION_TEXTURE2D,
|
||||
4, 4, 1, 1, DXGI_FORMAT_R32_TYPELESS,
|
||||
{{r32_float, 4 * sizeof(*r32_float)}}};
|
||||
@@ -6513,6 +6599,11 @@ static void test_texture(void)
|
||||
#define POINT D3D11_FILTER_MIN_MAG_MIP_POINT
|
||||
#define POINT_LINEAR D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR
|
||||
#define MIP_MAX D3D11_FLOAT32_MAX
|
||||
+ {&ps_ld_1d, &rgba_texture_1d, POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0},
|
||||
+ {&ps_ld_1d, &rgba_texture_1d, POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors},
|
||||
+ {&ps_ld_1d, &rgba_texture_1d, POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors},
|
||||
+ {&ps_ld_1d, &rgba_texture_1d, POINT, 0.0f, 0.0f, 0.0f, 3.0f, zero_colors},
|
||||
+ {&ps_ld_1d, &srgb_texture_1d, POINT, 0.0f, 0.0f, 0.0f, 0.0f, srgb_colors},
|
||||
{&ps_ld, &rgba_texture, POINT, 0.0f, 0.0f, 0.0f, 0.0f, rgba_level_0},
|
||||
{&ps_ld, &rgba_texture, POINT, 0.0f, 0.0f, 0.0f, 1.0f, level_1_colors},
|
||||
{&ps_ld, &rgba_texture, POINT, 0.0f, 0.0f, 0.0f, 2.0f, level_2_colors},
|
||||
@@ -6598,6 +6689,24 @@ static void test_texture(void)
|
||||
{&ps_sample_l, NULL, POINT, 2.0f, 2.0f, 0.0f, 1.0f, zero_colors},
|
||||
{&ps_sample_l, NULL, POINT, 2.0f, 2.0f, MIP_MAX, 0.0f, zero_colors},
|
||||
{&ps_sample_l, NULL, POINT, 2.0f, 2.0f, MIP_MAX, 1.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, -9.0f, red_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, -1.0f, red_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 0.0f, red_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 0.4f, red_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 0.5f, red_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 1.0f, green_data},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 1.4f, green_data},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 2.0f, blue_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 2.1f, blue_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 3.0f, blue_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 3.1f, blue_colors},
|
||||
+ {&ps_sample_1d_array, &array_1d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 9.0f, blue_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, 0.0f, 0.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, 0.0f, 1.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, 0.0f, 2.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, MIP_MAX, 0.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, MIP_MAX, 1.0f, zero_colors},
|
||||
+ {&ps_sample_1d_array, NULL, POINT, 0.0f, 0.0f, MIP_MAX, 2.0f, zero_colors},
|
||||
{&ps_sample_2d_array, &array_2d_texture, POINT, 0.0f, 0.0f, MIP_MAX, -9.0f, red_colors},
|
||||
{&ps_sample_2d_array, &array_2d_texture, POINT, 0.0f, 0.0f, MIP_MAX, -1.0f, red_colors},
|
||||
{&ps_sample_2d_array, &array_2d_texture, POINT, 0.0f, 0.0f, MIP_MAX, 0.0f, red_colors},
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,3 +0,0 @@
|
||||
Depends: wined3d-1DTextures
|
||||
Fixes: [40976] Implement support for ID3D11Texture1D
|
||||
Disabled: true
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
Fixes: [40976] Implement support for ID3D11Texture1D
|
@ -1,227 +0,0 @@
|
||||
From 999f0ce5c12d8956c25fd3b8ca83ab55f530f41d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 21 Jan 2017 22:54:40 +0100
|
||||
Subject: ntdll: Implement _alldvrm/_aulldvrm and add tests.
|
||||
|
||||
---
|
||||
dlls/ntdll/large_int.c | 62 +++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/ntdll.spec | 4 +--
|
||||
dlls/ntdll/tests/large_int.c | 68 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 +--
|
||||
4 files changed, 134 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/large_int.c b/dlls/ntdll/large_int.c
|
||||
index a0d465c..18f0688 100644
|
||||
--- a/dlls/ntdll/large_int.c
|
||||
+++ b/dlls/ntdll/large_int.c
|
||||
@@ -660,4 +660,66 @@ ULONGLONG WINAPI _aullshr( ULONGLONG a, LONG b )
|
||||
return a >> b;
|
||||
}
|
||||
|
||||
+void CDECL _alldvrm_helper( LONGLONG *res, LONGLONG *arg )
|
||||
+{
|
||||
+ res[0] = arg[0] / arg[1];
|
||||
+ res[1] = arg[0] % arg[1];
|
||||
+}
|
||||
+
|
||||
+void CDECL _aulldvrm_helper( ULONGLONG *res, ULONGLONG *arg )
|
||||
+{
|
||||
+ res[0] = arg[0] / arg[1];
|
||||
+ res[1] = arg[0] % arg[1];
|
||||
+}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * _alldvrm (NTDLL.@)
|
||||
+ */
|
||||
+__ASM_GLOBAL_FUNC( _alldvrm,
|
||||
+ "pushl %ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
||||
+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
|
||||
+ "movl %esp,%ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
|
||||
+ "subl $20,%esp\n\t"
|
||||
+ "leal 8(%ebp),%eax\n\t"
|
||||
+ "leal -16(%ebp),%ecx\n\t"
|
||||
+ "pushl %eax\n\t"
|
||||
+ "pushl %ecx\n\t"
|
||||
+ "call " __ASM_NAME("_alldvrm_helper") "\n\t"
|
||||
+ "leal -16(%ebp),%esp\n\t"
|
||||
+ "popl %eax\n\t"
|
||||
+ "popl %edx\n\t"
|
||||
+ "popl %ecx\n\t"
|
||||
+ "popl %ebx\n\t"
|
||||
+ "popl %ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
||||
+ __ASM_CFI(".cfi_same_value %ebp\n\t")
|
||||
+ "ret $16" )
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * _aulldvrm (NTDLL.@)
|
||||
+ */
|
||||
+__ASM_GLOBAL_FUNC( _aulldvrm,
|
||||
+ "pushl %ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
||||
+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
|
||||
+ "movl %esp,%ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
|
||||
+ "subl $20,%esp\n\t"
|
||||
+ "leal 8(%ebp),%eax\n\t"
|
||||
+ "leal -16(%ebp),%ecx\n\t"
|
||||
+ "pushl %eax\n\t"
|
||||
+ "pushl %ecx\n\t"
|
||||
+ "call " __ASM_NAME("_aulldvrm_helper") "\n\t"
|
||||
+ "leal -16(%ebp),%esp\n\t"
|
||||
+ "popl %eax\n\t"
|
||||
+ "popl %edx\n\t"
|
||||
+ "popl %ecx\n\t"
|
||||
+ "popl %ebx\n\t"
|
||||
+ "popl %ebp\n\t"
|
||||
+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
||||
+ __ASM_CFI(".cfi_same_value %ebp\n\t")
|
||||
+ "ret $16" )
|
||||
+
|
||||
#endif /* __i386__ */
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 0107932..8744704 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1337,7 +1337,7 @@
|
||||
@ cdecl -private __iscsymf(long) NTDLL___iscsymf
|
||||
@ cdecl -private __toascii(long) NTDLL___toascii
|
||||
@ stdcall -arch=i386 -ret64 _alldiv(int64 int64)
|
||||
-# @ stub _alldvrm
|
||||
+@ stdcall -arch=i386 -norelay _alldvrm(int64 int64)
|
||||
@ stdcall -arch=i386 -ret64 _allmul(int64 int64)
|
||||
@ stdcall -arch=i386 -norelay _alloca_probe()
|
||||
@ stdcall -arch=i386 -ret64 _allrem(int64 int64)
|
||||
@@ -1345,7 +1345,7 @@
|
||||
@ stdcall -arch=i386 -ret64 _allshr(int64 long)
|
||||
@ cdecl -private -ret64 _atoi64(str)
|
||||
@ stdcall -arch=i386 -ret64 _aulldiv(int64 int64)
|
||||
-# @ stub _aulldvrm
|
||||
+@ stdcall -arch=i386 -norelay _aulldvrm(int64 int64)
|
||||
@ stdcall -arch=i386 -ret64 _aullrem(int64 int64)
|
||||
@ stdcall -arch=i386 -ret64 _aullshr(int64 long)
|
||||
@ stdcall -private -arch=i386 -norelay _chkstk()
|
||||
diff --git a/dlls/ntdll/tests/large_int.c b/dlls/ntdll/tests/large_int.c
|
||||
index da7afa4..4562e67 100644
|
||||
--- a/dlls/ntdll/tests/large_int.c
|
||||
+++ b/dlls/ntdll/tests/large_int.c
|
||||
@@ -33,6 +33,8 @@ static VOID (WINAPI *pRtlFreeAnsiString)(PSTRING);
|
||||
static NTSTATUS (WINAPI *pRtlInt64ToUnicodeString)(ULONGLONG, ULONG, UNICODE_STRING *);
|
||||
static NTSTATUS (WINAPI *pRtlLargeIntegerToChar)(ULONGLONG *, ULONG, ULONG, PCHAR);
|
||||
static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_STRING *, BOOLEAN);
|
||||
+static void (WINAPI *p_alldvrm)(LONGLONG, LONGLONG);
|
||||
+static void (WINAPI *p_aulldvrm)(ULONGLONG, ULONGLONG);
|
||||
|
||||
|
||||
static void InitFunctionPtrs(void)
|
||||
@@ -45,6 +47,8 @@ static void InitFunctionPtrs(void)
|
||||
pRtlInt64ToUnicodeString = (void *)GetProcAddress(hntdll, "RtlInt64ToUnicodeString");
|
||||
pRtlLargeIntegerToChar = (void *)GetProcAddress(hntdll, "RtlLargeIntegerToChar");
|
||||
pRtlUnicodeStringToAnsiString = (void *)GetProcAddress(hntdll, "RtlUnicodeStringToAnsiString");
|
||||
+ p_alldvrm = (void *)GetProcAddress(hntdll, "_alldvrm");
|
||||
+ p_aulldvrm = (void *)GetProcAddress(hntdll, "_aulldvrm");
|
||||
} /* if */
|
||||
}
|
||||
|
||||
@@ -435,6 +439,66 @@ static void test_RtlLargeIntegerToChar(void)
|
||||
}
|
||||
|
||||
|
||||
+#ifdef __i386__
|
||||
+
|
||||
+#include "pshpack1.h"
|
||||
+struct lldvrm_thunk
|
||||
+{
|
||||
+ BYTE push_ebx; /* pushl %ebx */
|
||||
+ DWORD push_esp1; /* pushl 24(%esp) */
|
||||
+ DWORD push_esp2; /* pushl 24(%esp) */
|
||||
+ DWORD push_esp3; /* pushl 24(%esp) */
|
||||
+ DWORD push_esp4; /* pushl 24(%esp) */
|
||||
+ DWORD call; /* call 24(%esp) */
|
||||
+ WORD mov_ecx_eax; /* movl %ecx,%eax */
|
||||
+ WORD mov_ebx_edx; /* movl %ebx,%edx */
|
||||
+ BYTE pop_ebx; /* popl %ebx */
|
||||
+ BYTE ret; /* ret */
|
||||
+};
|
||||
+#include "poppack.h"
|
||||
+
|
||||
+static void test__alldvrm(void)
|
||||
+{
|
||||
+ struct lldvrm_thunk *thunk = VirtualAlloc(NULL, sizeof(*thunk), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
+ ULONGLONG (CDECL *call_lldvrm_func)(void *func, ULONGLONG, ULONGLONG) = (void *)thunk;
|
||||
+ ULONGLONG ret;
|
||||
+
|
||||
+ memset(thunk, 0x90, sizeof(*thunk));
|
||||
+ thunk->push_ebx = 0x53; /* pushl %ebx */
|
||||
+ thunk->push_esp1 = 0x182474ff; /* pushl 24(%esp) */
|
||||
+ thunk->push_esp2 = 0x182474ff; /* pushl 24(%esp) */
|
||||
+ thunk->push_esp3 = 0x182474ff; /* pushl 24(%esp) */
|
||||
+ thunk->push_esp4 = 0x182474ff; /* pushl 24(%esp) */
|
||||
+ thunk->call = 0x182454ff; /* call 24(%esp) */
|
||||
+ thunk->pop_ebx = 0x5b; /* popl %ebx */
|
||||
+ thunk->ret = 0xc3; /* ret */
|
||||
+
|
||||
+ ret = call_lldvrm_func(p_alldvrm, 0x0123456701234567ULL, 3);
|
||||
+ ok(ret == 0x61172255b66c77ULL, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+ ret = call_lldvrm_func(p_alldvrm, 0x0123456701234567ULL, -3);
|
||||
+ ok(ret == 0xff9ee8ddaa499389ULL, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+
|
||||
+ ret = call_lldvrm_func(p_aulldvrm, 0x0123456701234567ULL, 3);
|
||||
+ ok(ret == 0x61172255b66c77ULL, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+ ret = call_lldvrm_func(p_aulldvrm, 0x0123456701234567ULL, -3);
|
||||
+ ok(ret == 0, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+
|
||||
+ thunk->mov_ecx_eax = 0xc889;
|
||||
+ thunk->mov_ebx_edx = 0xda89;
|
||||
+
|
||||
+ ret = call_lldvrm_func(p_alldvrm, 0x0123456701234567ULL, 3);
|
||||
+ ok(ret == 2, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+ ret = call_lldvrm_func(p_alldvrm, 0x0123456701234567ULL, -3);
|
||||
+ ok(ret == 2, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+
|
||||
+ ret = call_lldvrm_func(p_aulldvrm, 0x0123456701234567ULL, 3);
|
||||
+ ok(ret == 2, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+ ret = call_lldvrm_func(p_aulldvrm, 0x0123456701234567ULL, -3);
|
||||
+ ok(ret == 0x123456701234567ULL, "got %x%08x\n", (DWORD)(ret >> 32), (DWORD)ret);
|
||||
+}
|
||||
+#endif /* __i386__ */
|
||||
+
|
||||
+
|
||||
START_TEST(large_int)
|
||||
{
|
||||
InitFunctionPtrs();
|
||||
@@ -445,4 +509,8 @@ START_TEST(large_int)
|
||||
test_RtlInt64ToUnicodeString();
|
||||
if (pRtlLargeIntegerToChar)
|
||||
test_RtlLargeIntegerToChar();
|
||||
+
|
||||
+#ifdef __i386__
|
||||
+ test__alldvrm();
|
||||
+#endif /* __i386__ */
|
||||
}
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 26afa6f..49f529a 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -1407,14 +1407,14 @@
|
||||
@ cdecl -private -arch=i386 _CIsqrt() msvcrt._CIsqrt
|
||||
@ cdecl -private _abnormal_termination() msvcrt._abnormal_termination
|
||||
@ stdcall -private -arch=i386 -ret64 _alldiv(int64 int64)
|
||||
-@ stub _alldvrm
|
||||
+@ stdcall -private -arch=i386 -norelay _alldvrm(int64 int64)
|
||||
@ stdcall -private -arch=i386 -ret64 _allmul(int64 int64)
|
||||
@ stdcall -private -arch=i386 -norelay _alloca_probe()
|
||||
@ stdcall -private -arch=i386 -ret64 _allrem(int64 int64)
|
||||
@ stdcall -private -arch=i386 -ret64 _allshl(int64 long)
|
||||
@ stdcall -private -arch=i386 -ret64 _allshr(int64 long)
|
||||
@ stdcall -private -arch=i386 -ret64 _aulldiv(int64 int64)
|
||||
-@ stub _aulldvrm
|
||||
+@ stdcall -private -arch=i386 -norelay _aulldvrm(int64 int64)
|
||||
@ stdcall -private -arch=i386 -ret64 _aullrem(int64 int64)
|
||||
@ stdcall -private -arch=i386 -ret64 _aullshr(int64 long)
|
||||
@ stdcall -private -arch=i386 -norelay _chkstk()
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [42267] Implement ntdll._aulldvrm
|
@ -1,72 +0,0 @@
|
||||
From f52a9242c2cbe9e0efe49d1d3e17d37ceedf9557 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Morozov <amorozov@etersoft.ru>
|
||||
Date: Thu, 29 Jan 2015 23:39:18 +0100
|
||||
Subject: ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and
|
||||
ExReleaseFastMutexUnsafe.
|
||||
|
||||
---
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 28 ++++++++++++++++++++++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++--
|
||||
2 files changed, 30 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index edd83de..d33fe6f 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -293,6 +293,34 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
+ * ExAcquireFastMutexUnsafe (NTOSKRNL.EXE.@)
|
||||
+ */
|
||||
+#ifdef DEFINE_FASTCALL1_ENTRYPOINT
|
||||
+DEFINE_FASTCALL1_ENTRYPOINT(ExAcquireFastMutexUnsafe)
|
||||
+void WINAPI __regs_ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
|
||||
+#else
|
||||
+void WINAPI ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex)
|
||||
+#endif
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", FastMutex);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * ExReleaseFastMutexUnsafe (NTOSKRNL.EXE.@)
|
||||
+ */
|
||||
+#ifdef DEFINE_FASTCALL1_ENTRYPOINT
|
||||
+DEFINE_FASTCALL1_ENTRYPOINT(ExReleaseFastMutexUnsafe)
|
||||
+void WINAPI __regs_ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex)
|
||||
+#else
|
||||
+void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex)
|
||||
+#endif
|
||||
+{
|
||||
+ FIXME("(%p): stub\n", FastMutex);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
* IoAcquireCancelSpinLock (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
void WINAPI IoAcquireCancelSpinLock(PKIRQL irql)
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 52c7fbf..2f08945 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -1,4 +1,4 @@
|
||||
-@ stub ExAcquireFastMutexUnsafe
|
||||
+@ stdcall -norelay ExAcquireFastMutexUnsafe(ptr)
|
||||
@ stub ExAcquireRundownProtection
|
||||
@ stub ExAcquireRundownProtectionEx
|
||||
@ stub ExInitializeRundownProtection
|
||||
@@ -8,7 +8,7 @@
|
||||
@ stub ExInterlockedPopEntrySList
|
||||
@ stub ExInterlockedPushEntrySList
|
||||
@ stub ExReInitializeRundownProtection
|
||||
-@ stub ExReleaseFastMutexUnsafe
|
||||
+@ stdcall -norelay ExReleaseFastMutexUnsafe(ptr)
|
||||
@ stub ExReleaseResourceLite
|
||||
@ stub ExReleaseRundownProtection
|
||||
@ stub ExReleaseRundownProtectionEx
|
||||
--
|
||||
2.2.2
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 57f2a16836c81b58f09e68c5bcbb2f491bb428fe Mon Sep 17 00:00:00 2001
|
||||
From 3ef178d58627649ca4f323f72c91b93942ab84e9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 6 Jun 2017 23:42:56 +0200
|
||||
Subject: ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.
|
||||
@ -10,10 +10,10 @@ Subject: ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.
|
||||
3 files changed, 93 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index 0a5c22fc8c0..30324fdebd0 100644
|
||||
index 28330b3..58383e5 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -1801,7 +1801,24 @@ void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside,
|
||||
@@ -1800,7 +1800,24 @@ void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside,
|
||||
ULONG Tag,
|
||||
USHORT Depth)
|
||||
{
|
||||
@ -40,10 +40,10 @@ index 0a5c22fc8c0..30324fdebd0 100644
|
||||
|
||||
/***********************************************************************
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index b75ef9d56df..8f5b9094472 100644
|
||||
index 5b7c9e6..97ff41e 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -143,20 +143,18 @@ typedef enum _KWAIT_REASON
|
||||
@@ -144,20 +144,18 @@ typedef enum _KWAIT_REASON
|
||||
MaximumWaitReason,
|
||||
} KWAIT_REASON;
|
||||
|
||||
@ -65,7 +65,7 @@ index b75ef9d56df..8f5b9094472 100644
|
||||
|
||||
typedef struct _FAST_MUTEX
|
||||
{
|
||||
@@ -181,6 +179,11 @@ typedef struct _VPB {
|
||||
@@ -182,6 +180,11 @@ typedef struct _VPB {
|
||||
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
|
||||
} VPB, *PVPB;
|
||||
|
||||
@ -77,7 +77,7 @@ index b75ef9d56df..8f5b9094472 100644
|
||||
typedef enum _POOL_TYPE {
|
||||
NonPagedPool,
|
||||
PagedPool,
|
||||
@@ -1220,6 +1223,71 @@ typedef struct _KLOCK_QUEUE_HANDLE {
|
||||
@@ -1221,6 +1224,71 @@ typedef struct _KLOCK_QUEUE_HANDLE {
|
||||
KIRQL OldIrql;
|
||||
} KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
|
||||
|
||||
@ -149,7 +149,7 @@ index b75ef9d56df..8f5b9094472 100644
|
||||
typedef NTSTATUS (NTAPI EX_CALLBACK_FUNCTION)(void *CallbackContext, void *Argument1, void *Argument2);
|
||||
typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION;
|
||||
|
||||
@@ -1277,8 +1345,10 @@ PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T);
|
||||
@@ -1372,8 +1440,10 @@ PVOID WINAPI ExAllocatePool(POOL_TYPE,SIZE_T);
|
||||
PVOID WINAPI ExAllocatePoolWithQuota(POOL_TYPE,SIZE_T);
|
||||
PVOID WINAPI ExAllocatePoolWithTag(POOL_TYPE,SIZE_T,ULONG);
|
||||
PVOID WINAPI ExAllocatePoolWithQuotaTag(POOL_TYPE,SIZE_T,ULONG);
|
||||
@ -157,11 +157,11 @@ index b75ef9d56df..8f5b9094472 100644
|
||||
void WINAPI ExFreePool(PVOID);
|
||||
void WINAPI ExFreePoolWithTag(PVOID,ULONG);
|
||||
+void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);
|
||||
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
|
||||
|
||||
NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*);
|
||||
PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR);
|
||||
diff --git a/include/winnt.h b/include/winnt.h
|
||||
index 3c5f0b8cb33..2cec63c895b 100644
|
||||
index b309929..d7694ab 100644
|
||||
--- a/include/winnt.h
|
||||
+++ b/include/winnt.h
|
||||
@@ -755,6 +755,8 @@ typedef struct _MEMORY_BASIC_INFORMATION
|
||||
@ -174,5 +174,5 @@ index 3c5f0b8cb33..2cec63c895b 100644
|
||||
#ifdef __GNUC__
|
||||
# define CONTAINING_RECORD(address, type, field) ({ \
|
||||
--
|
||||
2.13.1
|
||||
2.7.4
|
||||
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "ca9d03a7ac6bb599e50aa05ea5ec99d5cf096e2a"
|
||||
echo "2986e895015b9785d61e7265763efacc053d7ad6"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -111,7 +111,6 @@ patch_enable_all ()
|
||||
enable_crypt32_MS_Root_Certs="$1"
|
||||
enable_d3d11_Deferred_Context="$1"
|
||||
enable_d3d11_Depth_Bias="$1"
|
||||
enable_d3d11_ID3D11Texture1D_Rebased="$1"
|
||||
enable_d3d11_Silence_FIXMEs="$1"
|
||||
enable_d3d8_ValidateShader="$1"
|
||||
enable_d3d9_DesktopWindow="$1"
|
||||
@ -261,7 +260,6 @@ patch_enable_all ()
|
||||
enable_ntdll_WRITECOPY="$1"
|
||||
enable_ntdll_Wait_User_APC="$1"
|
||||
enable_ntdll_Zero_mod_name="$1"
|
||||
enable_ntdll__aulldvrm="$1"
|
||||
enable_ntdll_set_full_cpu_context="$1"
|
||||
enable_ntoskrnl_Stubs="$1"
|
||||
enable_nvapi_Stub_DLL="$1"
|
||||
@ -354,7 +352,6 @@ patch_enable_all ()
|
||||
enable_user32_ListBox_Size="$1"
|
||||
enable_user32_MessageBox_WS_EX_TOPMOST="$1"
|
||||
enable_user32_Mouse_Message_Hwnd="$1"
|
||||
enable_user32_PNG_Support="$1"
|
||||
enable_user32_Refresh_MDI_Menus="$1"
|
||||
enable_user32_ScrollWindowEx="$1"
|
||||
enable_user32_ShowWindow="$1"
|
||||
@ -530,9 +527,6 @@ patch_enable ()
|
||||
d3d11-Depth_Bias)
|
||||
enable_d3d11_Depth_Bias="$2"
|
||||
;;
|
||||
d3d11-ID3D11Texture1D_Rebased)
|
||||
enable_d3d11_ID3D11Texture1D_Rebased="$2"
|
||||
;;
|
||||
d3d11-Silence_FIXMEs)
|
||||
enable_d3d11_Silence_FIXMEs="$2"
|
||||
;;
|
||||
@ -980,9 +974,6 @@ patch_enable ()
|
||||
ntdll-Zero_mod_name)
|
||||
enable_ntdll_Zero_mod_name="$2"
|
||||
;;
|
||||
ntdll-_aulldvrm)
|
||||
enable_ntdll__aulldvrm="$2"
|
||||
;;
|
||||
ntdll-set_full_cpu_context)
|
||||
enable_ntdll_set_full_cpu_context="$2"
|
||||
;;
|
||||
@ -1259,9 +1250,6 @@ patch_enable ()
|
||||
user32-Mouse_Message_Hwnd)
|
||||
enable_user32_Mouse_Message_Hwnd="$2"
|
||||
;;
|
||||
user32-PNG_Support)
|
||||
enable_user32_PNG_Support="$2"
|
||||
;;
|
||||
user32-Refresh_MDI_Menus)
|
||||
enable_user32_Refresh_MDI_Menus="$2"
|
||||
;;
|
||||
@ -1925,9 +1913,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
if test "$enable_d3d11_Deferred_Context" -gt 1; then
|
||||
abort "Patchset d3d11-Deferred_Context disabled, but wined3d-CSMT_Main depends on that."
|
||||
fi
|
||||
if test "$enable_d3d11_ID3D11Texture1D_Rebased" -gt 1; then
|
||||
abort "Patchset d3d11-ID3D11Texture1D_Rebased disabled, but wined3d-CSMT_Main depends on that."
|
||||
fi
|
||||
if test "$enable_d3d9_Tests" -gt 1; then
|
||||
abort "Patchset d3d9-Tests disabled, but wined3d-CSMT_Main depends on that."
|
||||
fi
|
||||
@ -1950,7 +1935,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
abort "Patchset wined3d-UAV_Counters disabled, but wined3d-CSMT_Main depends on that."
|
||||
fi
|
||||
enable_d3d11_Deferred_Context=1
|
||||
enable_d3d11_ID3D11Texture1D_Rebased=1
|
||||
enable_d3d9_Tests=1
|
||||
enable_wined3d_Accounting=1
|
||||
enable_wined3d_DXTn=1
|
||||
@ -1961,13 +1945,9 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
fi
|
||||
|
||||
if test "$enable_wined3d_Dual_Source_Blending" -eq 1; then
|
||||
if test "$enable_d3d11_ID3D11Texture1D_Rebased" -gt 1; then
|
||||
abort "Patchset d3d11-ID3D11Texture1D_Rebased disabled, but wined3d-Dual_Source_Blending depends on that."
|
||||
fi
|
||||
if test "$enable_wined3d_Viewports" -gt 1; then
|
||||
abort "Patchset wined3d-Viewports disabled, but wined3d-Dual_Source_Blending depends on that."
|
||||
fi
|
||||
enable_d3d11_ID3D11Texture1D_Rebased=1
|
||||
enable_wined3d_Viewports=1
|
||||
fi
|
||||
|
||||
@ -2388,13 +2368,6 @@ if test "$enable_d3dx9_36_DXTn" -eq 1; then
|
||||
enable_wined3d_DXTn=1
|
||||
fi
|
||||
|
||||
if test "$enable_d3d11_Deferred_Context" -eq 1; then
|
||||
if test "$enable_d3d11_ID3D11Texture1D_Rebased" -gt 1; then
|
||||
abort "Patchset d3d11-ID3D11Texture1D_Rebased disabled, but d3d11-Deferred_Context depends on that."
|
||||
fi
|
||||
enable_d3d11_ID3D11Texture1D_Rebased=1
|
||||
fi
|
||||
|
||||
if test "$enable_bcrypt_BCryptDeriveKeyPBKDF2" -eq 1; then
|
||||
if test "$enable_crypt32_ECDSA_Cert_Chains" -gt 1; then
|
||||
abort "Patchset crypt32-ECDSA_Cert_Chains disabled, but bcrypt-BCryptDeriveKeyPBKDF2 depends on that."
|
||||
@ -3056,29 +3029,8 @@ if test "$enable_crypt32_MS_Root_Certs" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset d3d11-ID3D11Texture1D_Rebased
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#40976] Implement support for ID3D11Texture1D
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d11/d3d11_private.h, dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/d3d11/texture.c, dlls/d3d11/utils.c,
|
||||
# | dlls/wined3d/context.c, dlls/wined3d/device.c, dlls/wined3d/directx.c, dlls/wined3d/glsl_shader.c,
|
||||
# | dlls/wined3d/nvidia_texture_shader.c, dlls/wined3d/resource.c, dlls/wined3d/shader.c, dlls/wined3d/texture.c,
|
||||
# | dlls/wined3d/utils.c, dlls/wined3d/view.c, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h
|
||||
# |
|
||||
if test "$enable_d3d11_ID3D11Texture1D_Rebased" -eq 1; then
|
||||
patch_apply d3d11-ID3D11Texture1D_Rebased/0001-d3d11-Implement-ID3D11Texture1D.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Henri Verbeet", "d3d11: Implement ID3D11Texture1D.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset d3d11-Deferred_Context
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * d3d11-ID3D11Texture1D_Rebased
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#42191] Add semi-stub for D3D11 deferred context implementation
|
||||
# |
|
||||
@ -5711,21 +5663,6 @@ if test "$enable_ntdll_Zero_mod_name" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-_aulldvrm
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#42267] Implement ntdll._aulldvrm
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/large_int.c, dlls/ntdll/ntdll.spec, dlls/ntdll/tests/large_int.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
# |
|
||||
if test "$enable_ntdll__aulldvrm" -eq 1; then
|
||||
patch_apply ntdll-_aulldvrm/0001-ntdll-Implement-_alldvrm-_aulldvrm-and-add-tests.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Implement _alldvrm/_aulldvrm and add tests.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-set_full_cpu_context
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -5750,7 +5687,6 @@ fi
|
||||
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, include/ddk/wdm.h, include/winnt.h
|
||||
# |
|
||||
if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
patch_apply ntoskrnl-Stubs/0003-ntoskrnl.exe-Add-stubs-for-ExAcquireFastMutexUnsafe-.patch
|
||||
patch_apply ntoskrnl-Stubs/0005-ntoskrnl.exe-Improve-KeReleaseMutex-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0006-ntoskrnl.exe-Improve-KeInitializeSemaphore-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0007-ntoskrnl.exe-Improve-KeInitializeTimerEx-stub.patch
|
||||
@ -5765,7 +5701,6 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then
|
||||
patch_apply ntoskrnl-Stubs/0017-ntoskrnl-Add-PsGetProcessId-stub.patch
|
||||
patch_apply ntoskrnl-Stubs/0018-ntoskrnl-Add-ObGetObjectType-stub.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and ExReleaseFastMutexUnsafe.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeReleaseMutex stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeSemaphore stub.", 1 },';
|
||||
printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Improve KeInitializeTimerEx stub.", 1 },';
|
||||
@ -7420,21 +7355,6 @@ if test "$enable_user32_Mouse_Message_Hwnd" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-PNG_Support
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#38959] Add support for loading PNG icon files
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/user32/Makefile.in, dlls/user32/cursoricon.c
|
||||
# |
|
||||
if test "$enable_user32_PNG_Support" -eq 1; then
|
||||
patch_apply user32-PNG_Support/0001-user32-Add-support-for-PNG-icons.-v4.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "user32: Add support for PNG icons.", 5 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-Refresh_MDI_Menus
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -8100,7 +8020,7 @@ fi
|
||||
# Patchset wined3d-Dual_Source_Blending
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * d3d11-ID3D11Texture1D_Rebased, d3d11-Depth_Bias, wined3d-Viewports
|
||||
# | * d3d11-Depth_Bias, wined3d-Viewports
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/context.c, dlls/wined3d/directx.c, dlls/wined3d/glsl_shader.c,
|
||||
@ -8163,8 +8083,8 @@ fi
|
||||
# Patchset wined3d-CSMT_Main
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * d3d11-ID3D11Texture1D_Rebased, d3d11-Deferred_Context, d3d9-Tests, wined3d-Accounting, wined3d-DXTn, d3d11-Depth_Bias,
|
||||
# | wined3d-Viewports, wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters
|
||||
# | * d3d11-Deferred_Context, d3d9-Tests, wined3d-Accounting, wined3d-DXTn, d3d11-Depth_Bias, wined3d-Viewports, wined3d-
|
||||
# | Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/view.c, dlls/wined3d/wined3d_private.h
|
||||
|
@ -1,429 +0,0 @@
|
||||
From 77c6c5ca40e3de151a8c7a6a416c26ee9a08d14b Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 7 Apr 2016 21:18:44 +0800
|
||||
Subject: [PATCH] user32: Add support for PNG icons. (v5)
|
||||
|
||||
---
|
||||
dlls/user32/Makefile.in | 1 +
|
||||
dlls/user32/cursoricon.c | 339 ++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 335 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/Makefile.in b/dlls/user32/Makefile.in
|
||||
index 246c424155..931a715763 100644
|
||||
--- a/dlls/user32/Makefile.in
|
||||
+++ b/dlls/user32/Makefile.in
|
||||
@@ -2,6 +2,7 @@ EXTRADEFS = -D_USER32_ -D_WINABLE_
|
||||
MODULE = user32.dll
|
||||
IMPORTLIB = user32
|
||||
IMPORTS = gdi32 version advapi32
|
||||
+EXTRAINCL = $(PNG_CFLAGS)
|
||||
DELAYIMPORTS = imm32 usp10
|
||||
|
||||
C_SRCS = \
|
||||
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
|
||||
index 85aedfdc12..6bb25ca880 100644
|
||||
--- a/dlls/user32/cursoricon.c
|
||||
+++ b/dlls/user32/cursoricon.c
|
||||
@@ -6,6 +6,8 @@
|
||||
* 1997 Alex Korobka
|
||||
* 1998 Turchanov Sergey
|
||||
* 2007 Henri Verbeet
|
||||
+ * Copyright 2009 Vincent Povirk for CodeWeavers
|
||||
+ * 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
|
||||
@@ -29,6 +31,9 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
+#ifdef HAVE_PNG_H
|
||||
+#include <png.h>
|
||||
+#endif
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
@@ -43,11 +48,17 @@
|
||||
#include "wine/list.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/library.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cursor);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(icon);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(resource);
|
||||
|
||||
+#define RIFF_FOURCC( c0, c1, c2, c3 ) \
|
||||
+ ( (DWORD)(BYTE)(c0) | ( (DWORD)(BYTE)(c1) << 8 ) | \
|
||||
+ ( (DWORD)(BYTE)(c2) << 16 ) | ( (DWORD)(BYTE)(c3) << 24 ) )
|
||||
+#define PNG_SIGN RIFF_FOURCC(0x89,'P','N','G')
|
||||
+
|
||||
static struct list icon_cache = LIST_INIT( icon_cache );
|
||||
|
||||
/**********************************************************************
|
||||
@@ -108,6 +119,307 @@ static int get_display_bpp(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+#ifdef SONAME_LIBPNG
|
||||
+
|
||||
+static void *libpng_handle;
|
||||
+#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
+MAKE_FUNCPTR(png_create_read_struct);
|
||||
+MAKE_FUNCPTR(png_create_info_struct);
|
||||
+MAKE_FUNCPTR(png_destroy_read_struct);
|
||||
+MAKE_FUNCPTR(png_error);
|
||||
+MAKE_FUNCPTR(png_get_bit_depth);
|
||||
+MAKE_FUNCPTR(png_get_color_type);
|
||||
+MAKE_FUNCPTR(png_get_error_ptr);
|
||||
+MAKE_FUNCPTR(png_get_image_height);
|
||||
+MAKE_FUNCPTR(png_get_image_width);
|
||||
+MAKE_FUNCPTR(png_get_io_ptr);
|
||||
+MAKE_FUNCPTR(png_read_image);
|
||||
+MAKE_FUNCPTR(png_read_info);
|
||||
+MAKE_FUNCPTR(png_read_update_info);
|
||||
+MAKE_FUNCPTR(png_set_bgr);
|
||||
+MAKE_FUNCPTR(png_set_crc_action);
|
||||
+MAKE_FUNCPTR(png_set_error_fn);
|
||||
+MAKE_FUNCPTR(png_set_expand);
|
||||
+MAKE_FUNCPTR(png_set_gray_to_rgb);
|
||||
+MAKE_FUNCPTR(png_set_read_fn);
|
||||
+#undef MAKE_FUNCPTR
|
||||
+
|
||||
+static BOOL load_libpng(void)
|
||||
+{
|
||||
+ USER_Lock();
|
||||
+
|
||||
+ if (!libpng_handle && (libpng_handle = wine_dlopen(SONAME_LIBPNG, RTLD_NOW, NULL, 0)) != NULL)
|
||||
+ {
|
||||
+#define LOAD_FUNCPTR(f) \
|
||||
+ if ((p##f = wine_dlsym(libpng_handle, #f, NULL, 0)) == NULL) \
|
||||
+ { \
|
||||
+ libpng_handle = NULL; \
|
||||
+ USER_Unlock(); \
|
||||
+ return FALSE; \
|
||||
+ }
|
||||
+ LOAD_FUNCPTR(png_create_read_struct);
|
||||
+ LOAD_FUNCPTR(png_create_info_struct);
|
||||
+ LOAD_FUNCPTR(png_destroy_read_struct);
|
||||
+ LOAD_FUNCPTR(png_error);
|
||||
+ LOAD_FUNCPTR(png_get_bit_depth);
|
||||
+ LOAD_FUNCPTR(png_get_color_type);
|
||||
+ LOAD_FUNCPTR(png_get_error_ptr);
|
||||
+ LOAD_FUNCPTR(png_get_image_height);
|
||||
+ LOAD_FUNCPTR(png_get_image_width);
|
||||
+ LOAD_FUNCPTR(png_get_io_ptr);
|
||||
+ LOAD_FUNCPTR(png_read_image);
|
||||
+ LOAD_FUNCPTR(png_read_info);
|
||||
+ LOAD_FUNCPTR(png_read_update_info);
|
||||
+ LOAD_FUNCPTR(png_set_bgr);
|
||||
+ LOAD_FUNCPTR(png_set_crc_action);
|
||||
+ LOAD_FUNCPTR(png_set_error_fn);
|
||||
+ LOAD_FUNCPTR(png_set_expand);
|
||||
+ LOAD_FUNCPTR(png_set_gray_to_rgb);
|
||||
+ LOAD_FUNCPTR(png_set_read_fn);
|
||||
+#undef LOAD_FUNCPTR
|
||||
+ }
|
||||
+
|
||||
+ USER_Unlock();
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static void user_error_fn(png_structp png_ptr, png_const_charp error_message)
|
||||
+{
|
||||
+ jmp_buf *pjmpbuf;
|
||||
+
|
||||
+ /* This uses setjmp/longjmp just like the default. We can't use the
|
||||
+ * default because there's no way to access the jmp buffer in the png_struct
|
||||
+ * that works in 1.2 and 1.4 and allows us to dynamically load libpng. */
|
||||
+ WARN("PNG error: %s\n", debugstr_a(error_message));
|
||||
+ pjmpbuf = ppng_get_error_ptr(png_ptr);
|
||||
+ longjmp(*pjmpbuf, 1);
|
||||
+}
|
||||
+
|
||||
+static void user_warning_fn(png_structp png_ptr, png_const_charp warning_message)
|
||||
+{
|
||||
+ WARN("PNG warning: %s\n", debugstr_a(warning_message));
|
||||
+}
|
||||
+
|
||||
+struct png_wrapper
|
||||
+{
|
||||
+ png_structp png_ptr;
|
||||
+ png_infop info_ptr;
|
||||
+ int width, height, bpp;
|
||||
+ const char *buffer;
|
||||
+ int size, pos;
|
||||
+};
|
||||
+
|
||||
+static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
+{
|
||||
+ struct png_wrapper *png = ppng_get_io_ptr(png_ptr);
|
||||
+
|
||||
+ if (png->size - png->pos >= length)
|
||||
+ {
|
||||
+ memcpy(data, png->buffer + png->pos, length);
|
||||
+ png->pos += length;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ ppng_error(png->png_ptr, "failed to read PNG data");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static BOOL create_png_decoder(struct png_wrapper *png)
|
||||
+{
|
||||
+ jmp_buf jmpbuf;
|
||||
+ int color_type, bit_depth;
|
||||
+
|
||||
+ if (!load_libpng()) return FALSE;
|
||||
+
|
||||
+ /* initialize libpng */
|
||||
+ png->png_ptr = ppng_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
+ if (!png->png_ptr) return FALSE;
|
||||
+
|
||||
+ png->info_ptr = ppng_create_info_struct(png->png_ptr);
|
||||
+ if (!png->info_ptr)
|
||||
+ {
|
||||
+ ppng_destroy_read_struct(&png->png_ptr, NULL, NULL);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ /* set up setjmp/longjmp error handling */
|
||||
+ if (setjmp(jmpbuf))
|
||||
+ {
|
||||
+ ppng_destroy_read_struct(&png->png_ptr, &png->info_ptr, NULL);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ ppng_set_error_fn(png->png_ptr, jmpbuf, user_error_fn, user_warning_fn);
|
||||
+ ppng_set_crc_action(png->png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
|
||||
+
|
||||
+ /* set up custom i/o handling */
|
||||
+ ppng_set_read_fn(png->png_ptr, png, user_read_data);
|
||||
+
|
||||
+ /* read the header */
|
||||
+ ppng_read_info(png->png_ptr, png->info_ptr);
|
||||
+
|
||||
+ color_type = ppng_get_color_type(png->png_ptr, png->info_ptr);
|
||||
+ bit_depth = ppng_get_bit_depth(png->png_ptr, png->info_ptr);
|
||||
+
|
||||
+ /* expand grayscale image data to rgb */
|
||||
+ if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
+ ppng_set_gray_to_rgb(png->png_ptr);
|
||||
+
|
||||
+ /* expand palette image data to rgb */
|
||||
+ if (color_type == PNG_COLOR_TYPE_PALETTE || bit_depth < 8)
|
||||
+ ppng_set_expand(png->png_ptr);
|
||||
+
|
||||
+ /* update color type information */
|
||||
+ ppng_read_update_info(png->png_ptr, png->info_ptr);
|
||||
+
|
||||
+ color_type = ppng_get_color_type(png->png_ptr, png->info_ptr);
|
||||
+ bit_depth = ppng_get_bit_depth(png->png_ptr, png->info_ptr);
|
||||
+
|
||||
+ png->bpp = 0;
|
||||
+
|
||||
+ switch (color_type)
|
||||
+ {
|
||||
+ case PNG_COLOR_TYPE_RGB:
|
||||
+ if (bit_depth == 8)
|
||||
+ png->bpp = 24;
|
||||
+ break;
|
||||
+
|
||||
+ case PNG_COLOR_TYPE_RGB_ALPHA:
|
||||
+ if (bit_depth == 8)
|
||||
+ {
|
||||
+ ppng_set_bgr(png->png_ptr);
|
||||
+ png->bpp = 32;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (!png->bpp)
|
||||
+ {
|
||||
+ FIXME("unsupported PNG color format %d, %d bpp\n", color_type, bit_depth);
|
||||
+ ppng_destroy_read_struct(&png->png_ptr, &png->info_ptr, NULL);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ png->width = ppng_get_image_width(png->png_ptr, png->info_ptr);
|
||||
+ png->height = ppng_get_image_height(png->png_ptr, png->info_ptr);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static void destroy_png_decoder(struct png_wrapper *png)
|
||||
+{
|
||||
+ ppng_destroy_read_struct(&png->png_ptr, &png->info_ptr, NULL);
|
||||
+}
|
||||
+
|
||||
+static BOOL get_png_info(const void *png_data, DWORD size, int *width, int *height, int *bpp)
|
||||
+{
|
||||
+ static const char png_sig[8] = { 0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a };
|
||||
+ struct png_wrapper png;
|
||||
+
|
||||
+ if (size < sizeof(png_sig) || memcmp(png_data, png_sig, sizeof(png_sig)) != 0)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ png.buffer = png_data;
|
||||
+ png.size = size;
|
||||
+ png.pos = 0;
|
||||
+
|
||||
+ if (!create_png_decoder(&png)) return FALSE;
|
||||
+
|
||||
+ *width = png.width;
|
||||
+ *height = png.height;
|
||||
+ *bpp = png.bpp;
|
||||
+
|
||||
+ destroy_png_decoder(&png);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static BITMAPINFO *load_png(const char *png_data, DWORD *size)
|
||||
+{
|
||||
+ static const char png_sig[8] = { 0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a };
|
||||
+ struct png_wrapper png;
|
||||
+ png_bytep *row_pointers;
|
||||
+ int rowbytes, image_size, mask_size = 0, i;
|
||||
+ BITMAPINFO *info;
|
||||
+ unsigned char *image_data;
|
||||
+
|
||||
+ if (*size < sizeof(png_sig) || memcmp(png_data, png_sig, sizeof(png_sig)) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ png.buffer = png_data;
|
||||
+ png.size = *size;
|
||||
+ png.pos = 0;
|
||||
+
|
||||
+ if (!create_png_decoder(&png)) return NULL;
|
||||
+
|
||||
+ rowbytes = (png.width * png.bpp + 7) / 8;
|
||||
+ image_size = png.height * rowbytes;
|
||||
+ if (png.bpp != 32) /* add a mask if there is no alpha */
|
||||
+ mask_size = (png.width + 7) / 8 * png.height;
|
||||
+
|
||||
+ info = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER) + image_size + mask_size);
|
||||
+ if (!info)
|
||||
+ {
|
||||
+ destroy_png_decoder(&png);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ image_data = (unsigned char *)info + sizeof(BITMAPINFOHEADER);
|
||||
+ memset(image_data + image_size, 0, mask_size);
|
||||
+
|
||||
+ row_pointers = HeapAlloc(GetProcessHeap(), 0, png.height * sizeof(png_bytep));
|
||||
+ if (!row_pointers)
|
||||
+ {
|
||||
+ HeapFree(GetProcessHeap(), 0, info);
|
||||
+ destroy_png_decoder(&png);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ /* upside down */
|
||||
+ for (i = 0; i < png.height; i++)
|
||||
+ row_pointers[i] = image_data + (png.height - i - 1) * rowbytes;
|
||||
+
|
||||
+ ppng_read_image(png.png_ptr, row_pointers);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, row_pointers);
|
||||
+
|
||||
+ info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
+ info->bmiHeader.biWidth = png.width;
|
||||
+ info->bmiHeader.biHeight = png.height * 2;
|
||||
+ info->bmiHeader.biPlanes = 1;
|
||||
+ info->bmiHeader.biBitCount = png.bpp;
|
||||
+ info->bmiHeader.biCompression = BI_RGB;
|
||||
+ info->bmiHeader.biSizeImage = image_size;
|
||||
+ info->bmiHeader.biXPelsPerMeter = 0;
|
||||
+ info->bmiHeader.biYPelsPerMeter = 0;
|
||||
+ info->bmiHeader.biClrUsed = 0;
|
||||
+ info->bmiHeader.biClrImportant = 0;
|
||||
+
|
||||
+ *size = sizeof(BITMAPINFOHEADER) + image_size + mask_size;
|
||||
+
|
||||
+ destroy_png_decoder(&png);
|
||||
+
|
||||
+ return info;
|
||||
+}
|
||||
+
|
||||
+#else /* SONAME_LIBPNG */
|
||||
+
|
||||
+static BOOL get_png_info(const void *png_data, DWORD size, int *width, int *height, int *bpp)
|
||||
+{
|
||||
+ ERR("Trying to load PNG icon, but PNG support is not compiled in.\n");
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static BITMAPINFO *load_png( const char *png, DWORD *max_size )
|
||||
+{
|
||||
+ ERR("Trying to load PNG icon, but PNG support is not compiled in.\n");
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
static HICON alloc_icon_handle( BOOL is_ani, UINT num_steps )
|
||||
{
|
||||
struct cursoricon_object *obj;
|
||||
@@ -523,6 +835,8 @@ static int CURSORICON_FindBestIcon( LPCVOID dir, DWORD size, fnGetCIEntry get_en
|
||||
/* Find Best Colors for Best Fit */
|
||||
for ( i = 0; get_entry( dir, size, i, &cx, &cy, &bits ); i++ )
|
||||
{
|
||||
+ TRACE("entry %d: %d x %d, %d bpp\n", i, cx, cy, bits);
|
||||
+
|
||||
if(abs(width - cx) == iXDiff && abs(height - cy) == iYDiff)
|
||||
{
|
||||
iTempColorDiff = abs(depth - bits);
|
||||
@@ -680,7 +994,11 @@ static BOOL CURSORICON_GetFileEntry( LPCVOID dir, DWORD size, int n,
|
||||
entry = &filedir->idEntries[n];
|
||||
if (entry->dwDIBOffset > size - sizeof(info->biSize)) return FALSE;
|
||||
info = (const BITMAPINFOHEADER *)((const char *)dir + entry->dwDIBOffset);
|
||||
- if (info->biSize != sizeof(BITMAPCOREHEADER))
|
||||
+ if (info->biSize == PNG_SIGN)
|
||||
+ {
|
||||
+ return get_png_info(info, size, width, height, bits);
|
||||
+ }
|
||||
+ else if (info->biSize != sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
if ((const char *)(info + 1) - (const char *)dir > size) return FALSE;
|
||||
*bits = info->biBitCount;
|
||||
@@ -824,6 +1142,21 @@ static HICON create_icon_from_bmi( const BITMAPINFO *bmi, DWORD maxsize, HMODULE
|
||||
|
||||
/* Check bitmap header */
|
||||
|
||||
+ if (bmi->bmiHeader.biSize == PNG_SIGN)
|
||||
+ {
|
||||
+ BITMAPINFO *bmi_png;
|
||||
+
|
||||
+ bmi_png = load_png( (const char *)bmi, &maxsize );
|
||||
+ if (bmi_png)
|
||||
+ {
|
||||
+ hObj = create_icon_from_bmi( bmi_png, maxsize, module, resname,
|
||||
+ rsrc, hotspot, bIcon, width, height, cFlag );
|
||||
+ HeapFree( GetProcessHeap(), 0, bmi_png );
|
||||
+ return hObj;
|
||||
+ }
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (maxsize < sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
WARN( "invalid size %u\n", maxsize );
|
||||
@@ -1001,10 +1334,6 @@ done:
|
||||
/**********************************************************************
|
||||
* .ANI cursor support
|
||||
*/
|
||||
-#define RIFF_FOURCC( c0, c1, c2, c3 ) \
|
||||
- ( (DWORD)(BYTE)(c0) | ( (DWORD)(BYTE)(c1) << 8 ) | \
|
||||
- ( (DWORD)(BYTE)(c2) << 16 ) | ( (DWORD)(BYTE)(c3) << 24 ) )
|
||||
-
|
||||
#define ANI_RIFF_ID RIFF_FOURCC('R', 'I', 'F', 'F')
|
||||
#define ANI_LIST_ID RIFF_FOURCC('L', 'I', 'S', 'T')
|
||||
#define ANI_ACON_ID RIFF_FOURCC('A', 'C', 'O', 'N')
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [38959] Add support for loading PNG icon files
|
@ -1,121 +0,0 @@
|
||||
From 8e9691e9f5a3f138fd846b7fad02f850aa23d83e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 23 Aug 2016 22:54:14 +0200
|
||||
Subject: [PATCH] wined3d: Create dummy 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/context.c | 13 ++++++++++++-
|
||||
dlls/wined3d/device.c | 17 +++++++++++++++++
|
||||
dlls/wined3d/wined3d_private.h | 2 ++
|
||||
3 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 34102c7..f562849 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -1754,6 +1754,7 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
||||
{
|
||||
GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i));
|
||||
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
||||
|
||||
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
|
||||
@@ -1769,8 +1770,10 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array);
|
||||
|
||||
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
|
||||
-
|
||||
+ }
|
||||
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer);
|
||||
|
||||
@@ -2512,6 +2515,14 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
|
||||
case GL_NONE:
|
||||
/* nothing to do */
|
||||
break;
|
||||
+ case GL_TEXTURE_1D:
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
||||
+ checkGLcall("glBindTexture");
|
||||
+ break;
|
||||
+ case GL_TEXTURE_1D_ARRAY:
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
||||
+ checkGLcall("glBindTexture");
|
||||
+ break;
|
||||
case GL_TEXTURE_2D:
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
||||
break;
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index c5517f5..bdc551e 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -631,6 +631,12 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
||||
* to each texture stage when the currently set D3D texture is NULL. */
|
||||
context_active_texture(context, gl_info, 0);
|
||||
|
||||
+ gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_1d);
|
||||
+ TRACE("Dummy 1D texture given name %u.\n", textures->tex_1d);
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
|
||||
+ gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 1, 0,
|
||||
+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
|
||||
+
|
||||
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d);
|
||||
TRACE("Dummy 2D texture given name %u.\n", textures->tex_2d);
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
|
||||
@@ -682,6 +688,13 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
||||
|
||||
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
||||
{
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_1d_array);
|
||||
+ TRACE("Dummy 1D array texture given name %u.\n", textures->tex_1d_array);
|
||||
+ gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
|
||||
+ gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_1D_ARRAY, 0, GL_RGBA8, 1, 1, 0,
|
||||
+ GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
|
||||
+
|
||||
gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d_array);
|
||||
TRACE("Dummy 2D array texture given name %u.\n", textures->tex_2d_array);
|
||||
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
|
||||
@@ -749,7 +762,10 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_buffer);
|
||||
|
||||
if (gl_info->supported[EXT_TEXTURE_ARRAY])
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_1d_array);
|
||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d_array);
|
||||
+ }
|
||||
|
||||
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY])
|
||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_cube_array);
|
||||
@@ -764,6 +780,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_rect);
|
||||
|
||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d);
|
||||
+ gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_1d);
|
||||
|
||||
checkGLcall("delete dummy textures");
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index fdbcd7c..40ef580 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2868,11 +2868,13 @@ struct wined3d_state
|
||||
struct wined3d_dummy_textures
|
||||
{
|
||||
GLuint tex_2d;
|
||||
+ GLuint tex_1d;
|
||||
GLuint tex_rect;
|
||||
GLuint tex_3d;
|
||||
GLuint tex_cube;
|
||||
GLuint tex_cube_array;
|
||||
GLuint tex_2d_array;
|
||||
+ GLuint tex_1d_array;
|
||||
GLuint tex_buffer;
|
||||
GLuint tex_2d_ms;
|
||||
GLuint tex_2d_ms_array;
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,41 +0,0 @@
|
||||
From d28db7c620d03e6c903fca247a60374233b6c3b2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 23 Aug 2016 22:47:56 +0200
|
||||
Subject: [PATCH] wined3d: Add 1d texture resource type.
|
||||
|
||||
---
|
||||
dlls/wined3d/utils.c | 1 +
|
||||
include/wine/wined3d.h | 5 +++--
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
|
||||
index a54e18e..91b05fb 100644
|
||||
--- a/dlls/wined3d/utils.c
|
||||
+++ b/dlls/wined3d/utils.c
|
||||
@@ -4316,6 +4316,7 @@ const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type)
|
||||
#define WINED3D_TO_STR(x) case x: return #x
|
||||
WINED3D_TO_STR(WINED3D_RTYPE_NONE);
|
||||
WINED3D_TO_STR(WINED3D_RTYPE_BUFFER);
|
||||
+ WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_1D);
|
||||
WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_2D);
|
||||
WINED3D_TO_STR(WINED3D_RTYPE_TEXTURE_3D);
|
||||
#undef WINED3D_TO_STR
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index a4b939c..6ec132d 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -690,8 +690,9 @@ enum wined3d_resource_type
|
||||
{
|
||||
WINED3D_RTYPE_NONE = 0,
|
||||
WINED3D_RTYPE_BUFFER = 1,
|
||||
- WINED3D_RTYPE_TEXTURE_2D = 2,
|
||||
- WINED3D_RTYPE_TEXTURE_3D = 3,
|
||||
+ WINED3D_RTYPE_TEXTURE_1D = 2,
|
||||
+ WINED3D_RTYPE_TEXTURE_2D = 3,
|
||||
+ WINED3D_RTYPE_TEXTURE_3D = 4,
|
||||
};
|
||||
|
||||
enum wined3d_query_type
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From 4a95eee65438a5a8e229683381606aa3a05d82a3 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:19:25 +0200
|
||||
Subject: [PATCH] wined3d: Add is_power_of_two helper function.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 187e2a2..f3a5a5c 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -133,6 +133,11 @@ static DWORD wined3d_resource_access_from_location(DWORD location)
|
||||
}
|
||||
}
|
||||
|
||||
+static BOOL is_power_of_two(UINT x)
|
||||
+{
|
||||
+ return (x != 0) && !(x & (x - 1));
|
||||
+}
|
||||
+
|
||||
static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
|
||||
{
|
||||
struct wined3d_texture_sub_resource *sub_resource;
|
||||
@@ -1478,7 +1483,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
else
|
||||
texture->target = GL_TEXTURE_2D;
|
||||
|
||||
- if (((width & (width - 1)) || (height & (height - 1))) && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]
|
||||
+ if ((!is_power_of_two(width) || !is_power_of_two(height)) && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]
|
||||
&& !gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
|
||||
{
|
||||
texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED;
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,198 +0,0 @@
|
||||
From c0703627d824158ef1e38f0ee5b783844380117c 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 | 148 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 149 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 8968c16..bcd0610 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 *
|
||||
resource_types[] =
|
||||
{
|
||||
{WINED3D_RTYPE_BUFFER, 0, WINED3D_GL_RES_TYPE_BUFFER},
|
||||
+ {WINED3D_RTYPE_TEXTURE_1D, 0, WINED3D_GL_RES_TYPE_TEX_1D},
|
||||
{WINED3D_RTYPE_TEXTURE_2D, 0, WINED3D_GL_RES_TYPE_TEX_2D},
|
||||
{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 f3a5a5c..003868c 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1749,6 +1749,21 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ FIXME("texture %p, sub_resource_idx %u, context %p, location %s: stub.\n",
|
||||
+ texture, sub_resource_idx, context, wined3d_debug_location(location));
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static const struct wined3d_texture_ops texture1d_ops =
|
||||
+{
|
||||
+ texture1d_load_location
|
||||
+};
|
||||
+
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -2574,6 +2589,135 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+static HRESULT texture1d_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
|
||||
+ UINT layer_count, UINT level_count, struct wined3d_device *device, void *parent,
|
||||
+ const struct wined3d_parent_ops *parent_ops)
|
||||
+{
|
||||
+ struct wined3d_device_parent *device_parent = device->device_parent;
|
||||
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
+ unsigned int sub_count, i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (layer_count > 1 && !gl_info->supported[EXT_TEXTURE_ARRAY])
|
||||
+ {
|
||||
+ WARN("OpenGL implementation does not support array textures.\n");
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
+ /* TODO: It should only be possible to create textures for formats
|
||||
+ * that are reported as supported. */
|
||||
+ if (WINED3DFMT_UNKNOWN >= desc->format)
|
||||
+ {
|
||||
+ WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
+ if (desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP)
|
||||
+ {
|
||||
+ WARN("1d textures can not be used for cube mapping, returning D3DERR_INVALIDCALL.\n");
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
+ if ((desc->usage & WINED3DUSAGE_DYNAMIC && wined3d_resource_access_is_managed(desc->access))
|
||||
+ || (desc->usage & WINED3DUSAGE_SCRATCH))
|
||||
+ {
|
||||
+ WARN("Attempted to create a DYNAMIC texture in pool %s.\n", wined3d_debug_resource_access(desc->access));
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
+ if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && !is_power_of_two(desc->width))
|
||||
+ {
|
||||
+ if (desc->usage & WINED3DUSAGE_SCRATCH)
|
||||
+ {
|
||||
+ WARN("Creating a scratch NPOT 1d texture despite lack of HW support.\n");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WARN("Attempted to create a NPOT 1d texture (%u, %u, %u) without GL support.\n",
|
||||
+ desc->width, desc->height, desc->depth);
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (desc->usage & WINED3DUSAGE_QUERY_GENMIPMAP)
|
||||
+ {
|
||||
+ if (level_count != 1)
|
||||
+ {
|
||||
+ WARN("WINED3DUSAGE_QUERY_GENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n");
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr = wined3d_texture_init(texture, desc, layer_count, level_count,
|
||||
+ 0, device, parent, parent_ops, &texture1d_ops)))
|
||||
+ {
|
||||
+ WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ texture->pow2_matrix[0] = 1.0f;
|
||||
+ texture->pow2_matrix[5] = 1.0f;
|
||||
+ texture->pow2_matrix[10] = 1.0f;
|
||||
+ texture->pow2_matrix[15] = 1.0f;
|
||||
+ texture->target = (layer_count > 1) ? GL_TEXTURE_1D_ARRAY : GL_TEXTURE_1D;
|
||||
+
|
||||
+ if (wined3d_texture_use_pbo(texture, gl_info))
|
||||
+ {
|
||||
+ wined3d_resource_free_sysmem(&texture->resource);
|
||||
+ texture->resource.map_binding = WINED3D_LOCATION_BUFFER;
|
||||
+ }
|
||||
+
|
||||
+ sub_count = level_count * layer_count;
|
||||
+ if (sub_count / layer_count != level_count)
|
||||
+ {
|
||||
+ wined3d_texture_cleanup_sync(texture);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+
|
||||
+ /* Generate all sub-resources. */
|
||||
+ for (i = 0; i < sub_count; ++i)
|
||||
+ {
|
||||
+ struct wined3d_texture_sub_resource *sub_resource;
|
||||
+
|
||||
+ sub_resource = &texture->sub_resources[i];
|
||||
+ sub_resource->locations = WINED3D_LOCATION_DISCARDED;
|
||||
+ if (!(texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL))
|
||||
+ {
|
||||
+ wined3d_texture_validate_location(texture, i, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_SYSMEM);
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr = device_parent->ops->texture_sub_resource_created(device_parent,
|
||||
+ desc->resource_type, texture, i, &sub_resource->parent, &sub_resource->parent_ops)))
|
||||
+ {
|
||||
+ WARN("Failed to create sub-resource parent, hr %#x.\n", hr);
|
||||
+ sub_resource->parent = NULL;
|
||||
+ wined3d_texture_cleanup_sync(texture);
|
||||
+ return hr;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("parent %p, parent_ops %p.\n", sub_resource->parent, sub_resource->parent_ops);
|
||||
+
|
||||
+ TRACE("Created sub-resource %u (level %u, layer %u).\n",
|
||||
+ i, i % texture->level_count, i / texture->level_count);
|
||||
+
|
||||
+ if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
|
||||
+ {
|
||||
+ struct wined3d_texture_idx texture_idx = {texture, i};
|
||||
+
|
||||
+ wined3d_cs_init_object(device->cs, wined3d_texture_create_dc, &texture_idx);
|
||||
+ device->cs->ops->finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
|
||||
+ if (!texture->dc_info || !texture->dc_info[i].dc)
|
||||
+ {
|
||||
+ wined3d_texture_cleanup_sync(texture);
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return WINED3D_OK;
|
||||
+}
|
||||
+
|
||||
/* Context activation is done by the caller. */
|
||||
static void texture3d_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
const struct wined3d_context *context, const struct wined3d_bo_address *data)
|
||||
@@ -3042,6 +3186,10 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
|
||||
switch (desc->resource_type)
|
||||
{
|
||||
+ case WINED3D_RTYPE_TEXTURE_1D:
|
||||
+ hr = texture1d_init(object, desc, layer_count, level_count, device, parent, parent_ops);
|
||||
+ break;
|
||||
+
|
||||
case WINED3D_RTYPE_TEXTURE_2D:
|
||||
hr = wined3d_texture_init(object, desc, layer_count, level_count,
|
||||
flags, device, parent, parent_ops, &texture2d_ops);
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 65fd59157958551ad543149c9b075f0294f512d9 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 | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 003868c..cb02276 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -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, gl_internal_format,
|
||||
+ width, height, 0, format->glFormat, format->glType, NULL);
|
||||
+ checkGLcall("glTexImage2D");
|
||||
+ }
|
||||
+ else if (texture->target == GL_TEXTURE_1D)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexImage1D(target, level,
|
||||
+ gl_internal_format, width, 0, format->glFormat, format->glType, NULL);
|
||||
+ checkGLcall("glTexImage1D");
|
||||
+ }
|
||||
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
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 4353549a289101aed8b4fca9a32f3458b0068093 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/texture.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 66e72b4..242e600 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1953,6 +1953,18 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||
GL_EXTCALL(glTexSubImage3D(target, level, dst_x, dst_y, dst_z,
|
||||
update_w, update_h, update_d, format->glFormat, format->glType, bo.addr));
|
||||
}
|
||||
+ else if (target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, dst_x, dst_y, update_w, 1, format->glFormat, format->glType, bo.addr);
|
||||
+ checkGLcall("glTexSubImage2D");
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
+ }
|
||||
+ else if (target == GL_TEXTURE_1D)
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glTexSubImage1D(target, level, dst_x, update_w, format->glFormat, format->glType, bo.addr);
|
||||
+ checkGLcall("glTexSubImage1D");
|
||||
+}
|
||||
else
|
||||
{
|
||||
gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, dst_x, dst_y,
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,90 +0,0 @@
|
||||
From 22426ce3fa27934afee1235ee690909e370c8e21 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.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 62 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 45b5afb..a2ed5f4 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1771,10 +1771,70 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
- FIXME("texture %p, sub_resource_idx %u, context %p, location %s: stub.\n",
|
||||
+ struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
+ DWORD required_access = wined3d_resource_access_from_location(location);
|
||||
+ unsigned int row_pitch, slice_pitch;
|
||||
+
|
||||
+ TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n",
|
||||
texture, sub_resource_idx, context, wined3d_debug_location(location));
|
||||
|
||||
- return FALSE;
|
||||
+ TRACE("Current resource location %s.\n", wined3d_debug_location(sub_resource->locations));
|
||||
+
|
||||
+ if ((sub_resource->locations & location) == location)
|
||||
+ {
|
||||
+ TRACE("Location(s) already up to date.\n");
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ if ((texture->resource.access & required_access) != required_access)
|
||||
+ {
|
||||
+ ERR("Operation requires %#x access, but 1d texture only has %#x.\n",
|
||||
+ required_access, texture->resource.access);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (sub_resource->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ {
|
||||
+ TRACE("1d texture previously discarded, nothing to do.\n");
|
||||
+ wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
+ wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ switch (location)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
+ case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
+ if (sub_resource->locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ {
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ }
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
+ {
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ FIXME("Implement 1d texture loading from %s.\n", wined3d_debug_location(sub_resource->locations));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location),
|
||||
+ wined3d_debug_location(sub_resource->locations));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
+
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
static const struct wined3d_texture_ops texture1d_ops =
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,145 +0,0 @@
|
||||
From 1cf407698d0ef427d093fb09e76c0a63d84eca33 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:41:05 +0200
|
||||
Subject: [PATCH] wined3d: Implement downloading from (s)rgb 1d textures to
|
||||
system memory.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 114 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index a2ed5f4..25219e9 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1768,6 +1768,78 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
+static void texture1d_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ const struct wined3d_context *context, const struct wined3d_bo_address *data)
|
||||
+{
|
||||
+ const struct wined3d_format *format = texture->resource.format;
|
||||
+ unsigned int layer = sub_resource_idx / texture->level_count;
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+ struct wined3d_texture_sub_resource *sub_resource;
|
||||
+ BYTE *temporary_mem = NULL;
|
||||
+ void *mem;
|
||||
+ GLenum target;
|
||||
+
|
||||
+ sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
+
|
||||
+ if (format->conv_byte_count)
|
||||
+ {
|
||||
+ FIXME("Attempting to download a converted 1d texture, format %s.\n",
|
||||
+ debug_d3dformat(format->id));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
|
||||
+ if (target == GL_TEXTURE_1D_ARRAY)
|
||||
+ {
|
||||
+ WARN_(d3d_perf)("Downloading all miplevel layers to get the surface data for a single sub-resource.\n");
|
||||
+
|
||||
+ if (!(temporary_mem = heap_calloc(texture->layer_count, sub_resource->size)))
|
||||
+ {
|
||||
+ ERR("Out of memory.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ mem = temporary_mem;
|
||||
+ }
|
||||
+ else if (data->buffer_object)
|
||||
+ {
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, data->buffer_object));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+ mem = data->addr;
|
||||
+ }
|
||||
+ else
|
||||
+ mem = data->addr;
|
||||
+
|
||||
+ gl_info->gl_ops.gl.p_glGetTexImage(target, sub_resource_idx,
|
||||
+ format->glFormat, format->glType, mem);
|
||||
+ checkGLcall("glGetTexImage");
|
||||
+
|
||||
+ if (temporary_mem)
|
||||
+ {
|
||||
+ void *src_data = temporary_mem + layer * sub_resource->size;
|
||||
+ if (data->buffer_object)
|
||||
+ {
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, data->buffer_object));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+ GL_EXTCALL(glBufferSubData(GL_PIXEL_PACK_BUFFER, 0, sub_resource->size, src_data));
|
||||
+ checkGLcall("glBufferSubData");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ memcpy(data->addr, src_data, sub_resource->size);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (data->buffer_object)
|
||||
+ {
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+ }
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, temporary_mem);
|
||||
+}
|
||||
+
|
||||
+/* Context activation is done by the caller. */
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@@ -1825,6 +1897,48 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
break;
|
||||
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ {
|
||||
+ struct wined3d_bo_address data = {0, texture->resource.heap_memory};
|
||||
+
|
||||
+ data.addr += sub_resource->offset;
|
||||
+ if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
+ else
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, TRUE);
|
||||
+
|
||||
+ texture1d_download_data(texture, sub_resource_idx, context, &data);
|
||||
+ ++texture->download_count;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n",
|
||||
+ wined3d_debug_location(sub_resource->locations));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ {
|
||||
+ struct wined3d_bo_address data = {sub_resource->buffer_object, NULL};
|
||||
+
|
||||
+ if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
+ else
|
||||
+ wined3d_texture_bind_and_dirtify(texture, context, TRUE);
|
||||
+
|
||||
+ texture1d_download_data(texture, sub_resource_idx, context, &data);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n",
|
||||
+ wined3d_debug_location(sub_resource->locations));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location),
|
||||
wined3d_debug_location(sub_resource->locations));
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 37d03dd2f32784e4729aabcd1cc5084c0292dc83 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:44:14 +0200
|
||||
Subject: [PATCH] wined3d: Implement converting between (s)rgb 1d textures.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 25219e9..6e537de 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1840,6 +1840,27 @@ static void texture1d_download_data(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
+static void texture1d_srgb_transfer(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_context *context, BOOL dest_is_srgb)
|
||||
+{
|
||||
+ struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
+ unsigned int row_pitch, slice_pitch;
|
||||
+ struct wined3d_bo_address data;
|
||||
+
|
||||
+ WARN_(d3d_perf)("Performing slow rgb/srgb 1d texture transfer.\n");
|
||||
+ data.buffer_object = 0;
|
||||
+ if (!(data.addr = HeapAlloc(GetProcessHeap(), 0, sub_resource->size)))
|
||||
+ return;
|
||||
+
|
||||
+ wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
+ 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);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, data.addr);
|
||||
+}
|
||||
+
|
||||
+/* Context activation is done by the caller. */
|
||||
static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
@@ -1890,6 +1911,14 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
}
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ {
|
||||
+ texture1d_srgb_transfer(texture, sub_resource_idx, context, TRUE);
|
||||
+ }
|
||||
+ else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_SRGB)
|
||||
+ {
|
||||
+ texture1d_srgb_transfer(texture, sub_resource_idx, context, FALSE);
|
||||
+ }
|
||||
else
|
||||
{
|
||||
FIXME("Implement 1d texture loading from %s.\n", wined3d_debug_location(sub_resource->locations));
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 2d1efe098f329aab45acf65dfd65d76c2290a356 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:11:03 +0200
|
||||
Subject: [PATCH] wined3d: Check for 1d textures in
|
||||
wined3d_texture_update_desc.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 6e537de..d490ac8 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1445,6 +1445,12 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
+ if (texture->resource.type == WINED3D_RTYPE_TEXTURE_1D)
|
||||
+ {
|
||||
+ FIXME("Not yet supported for 1D textures.\n");
|
||||
+ return WINED3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
if (texture->resource.map_count)
|
||||
{
|
||||
WARN("Texture is mapped.\n");
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,24 +0,0 @@
|
||||
From 9224aa288a653ca42b1bfe54ecd9174ce8182a7f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 17:00:12 +0200
|
||||
Subject: [PATCH] wined3d: Check if 1d teture is still in use before releasing.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index bb61f78..3478f3e 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -5088,6 +5088,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
|
||||
|
||||
switch (type)
|
||||
{
|
||||
+ case WINED3D_RTYPE_TEXTURE_1D:
|
||||
case WINED3D_RTYPE_TEXTURE_2D:
|
||||
case WINED3D_RTYPE_TEXTURE_3D:
|
||||
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 3b9f0470ff37163e93747ad05eb68ddfb90f5be9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 Aug 2016 17:06:41 +0200
|
||||
Subject: [PATCH] wined3d: Generate glsl samplers for 1d texture arrays.
|
||||
|
||||
---
|
||||
dlls/wined3d/glsl_shader.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index 6cc030a..9760d6a 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -2576,6 +2576,13 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
|
||||
sampler_type = "samplerCube";
|
||||
break;
|
||||
|
||||
+ case WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY:
|
||||
+ if (shadow_sampler)
|
||||
+ sampler_type = "sampler1DArrayShadow";
|
||||
+ else
|
||||
+ sampler_type = "sampler1DArray";
|
||||
+ break;
|
||||
+
|
||||
case WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY:
|
||||
if (shadow_sampler)
|
||||
sampler_type = "sampler2DArrayShadow";
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 707e03d8c031f4914e118a00c9e5cc120d663d1e 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:09:41 +0200
|
||||
Subject: [PATCH] wined3d: Add support for 1d textures in
|
||||
context_attach_gl_texture_fbo.
|
||||
|
||||
---
|
||||
dlls/wined3d/context.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index f562849..2346249 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -144,7 +144,8 @@ static void context_attach_gl_texture_fbo(struct wined3d_context *context,
|
||||
gl_info->fbo_ops.glFramebufferTexture(fbo_target, attachment,
|
||||
resource->object, resource->level);
|
||||
}
|
||||
- else if (resource->target == GL_TEXTURE_2D_ARRAY || resource->target == GL_TEXTURE_3D)
|
||||
+ else if (resource->target == GL_TEXTURE_1D_ARRAY || resource->target == GL_TEXTURE_2D_ARRAY ||
|
||||
+ resource->target == GL_TEXTURE_3D)
|
||||
{
|
||||
if (!gl_info->fbo_ops.glFramebufferTextureLayer)
|
||||
{
|
||||
@@ -155,6 +156,12 @@ static void context_attach_gl_texture_fbo(struct wined3d_context *context,
|
||||
gl_info->fbo_ops.glFramebufferTextureLayer(fbo_target, attachment,
|
||||
resource->object, resource->level, resource->layer);
|
||||
}
|
||||
+ else if (resource->target == GL_TEXTURE_1D)
|
||||
+ {
|
||||
+ gl_info->fbo_ops.glFramebufferTexture1D(fbo_target, attachment,
|
||||
+ resource->target, resource->object, resource->level);
|
||||
+ checkGLcall("glFramebufferTexture1D()");
|
||||
+ }
|
||||
else
|
||||
{
|
||||
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, attachment,
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,79 +0,0 @@
|
||||
From 743513495ac98b1edc6ce398689a5979fc6a083a 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:21:20 +0200
|
||||
Subject: [PATCH] wined3d: Handle 1d textures in texture_activate_dimensions.
|
||||
|
||||
---
|
||||
dlls/wined3d/utils.c | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
|
||||
index 91b05fb..dde4eb6 100644
|
||||
--- a/dlls/wined3d/utils.c
|
||||
+++ b/dlls/wined3d/utils.c
|
||||
@@ -5790,7 +5790,27 @@ void texture_activate_dimensions(const struct wined3d_texture *texture, const st
|
||||
{
|
||||
switch (texture->target)
|
||||
{
|
||||
+ case GL_TEXTURE_1D:
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_2D)");
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_3D)");
|
||||
+ if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
|
||||
+ }
|
||||
+ if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
|
||||
+ {
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
|
||||
+ }
|
||||
+ gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glEnable(GL_TEXTURE_1D)");
|
||||
+ break;
|
||||
case GL_TEXTURE_2D:
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_1D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
||||
checkGLcall("glDisable(GL_TEXTURE_3D)");
|
||||
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
|
||||
@@ -5807,6 +5827,8 @@ void texture_activate_dimensions(const struct wined3d_texture *texture, const st
|
||||
checkGLcall("glEnable(GL_TEXTURE_2D)");
|
||||
break;
|
||||
case GL_TEXTURE_RECTANGLE_ARB:
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_1D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
|
||||
checkGLcall("glDisable(GL_TEXTURE_2D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
||||
@@ -5830,12 +5852,16 @@ void texture_activate_dimensions(const struct wined3d_texture *texture, const st
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||
checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
|
||||
}
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_1D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
|
||||
checkGLcall("glDisable(GL_TEXTURE_2D)");
|
||||
gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_3D);
|
||||
checkGLcall("glEnable(GL_TEXTURE_3D)");
|
||||
break;
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_1D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
|
||||
checkGLcall("glDisable(GL_TEXTURE_2D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
||||
@@ -5852,6 +5878,8 @@ void texture_activate_dimensions(const struct wined3d_texture *texture, const st
|
||||
}
|
||||
else
|
||||
{
|
||||
+ gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
|
||||
+ checkGLcall("glDisable(GL_TEXTURE_1D)");
|
||||
gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_2D);
|
||||
checkGLcall("glEnable(GL_TEXTURE_2D)");
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 2fb363f151d5a8fd868eb43273c5956eb0c469d4 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:26:07 +0200
|
||||
Subject: [PATCH] wined3d: Allow creation of 1d shader views.
|
||||
|
||||
---
|
||||
dlls/wined3d/view.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
|
||||
index 05167f4..1eebce6 100644
|
||||
--- a/dlls/wined3d/view.c
|
||||
+++ b/dlls/wined3d/view.c
|
||||
@@ -48,6 +48,11 @@ static GLenum get_texture_view_target(const struct wined3d_gl_info *gl_info,
|
||||
{GL_TEXTURE_RECTANGLE, 0, GL_TEXTURE_RECTANGLE},
|
||||
{GL_TEXTURE_3D, 0, GL_TEXTURE_3D},
|
||||
|
||||
+ {GL_TEXTURE_1D, 0, GL_TEXTURE_1D},
|
||||
+ {GL_TEXTURE_1D, WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_1D_ARRAY},
|
||||
+ {GL_TEXTURE_1D_ARRAY, 0, GL_TEXTURE_1D},
|
||||
+ {GL_TEXTURE_1D_ARRAY, WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_1D_ARRAY},
|
||||
+
|
||||
{GL_TEXTURE_2D, 0, GL_TEXTURE_2D},
|
||||
{GL_TEXTURE_2D, WINED3D_VIEW_TEXTURE_ARRAY, GL_TEXTURE_2D_ARRAY},
|
||||
{GL_TEXTURE_2D_ARRAY, 0, GL_TEXTURE_2D},
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,155 +0,0 @@
|
||||
From 8f01b5d785f759c43ceb2e4d7419e52002bf50b6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 4 Jun 2017 22:04:39 +0200
|
||||
Subject: [PATCH] d3d11: Improve ID3D11Device_CheckFormatSupport.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 17 ++++++++++++-----
|
||||
dlls/d3d11/tests/d3d11.c | 33 ++++++++++++++++++++++++++++++++-
|
||||
dlls/wined3d/directx.c | 21 ++++++++++++++++++++-
|
||||
3 files changed, 64 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index d93f4eb..a4e1d4b 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -3224,17 +3224,24 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
|
||||
}
|
||||
flag_mapping[] =
|
||||
{
|
||||
- {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_TEXTURE, D3D11_FORMAT_SUPPORT_TEXTURE2D},
|
||||
- {WINED3D_RTYPE_TEXTURE_3D, WINED3DUSAGE_TEXTURE, D3D11_FORMAT_SUPPORT_TEXTURE3D},
|
||||
- {WINED3D_RTYPE_NONE, WINED3DUSAGE_RENDERTARGET, D3D11_FORMAT_SUPPORT_RENDER_TARGET},
|
||||
- {WINED3D_RTYPE_NONE, WINED3DUSAGE_DEPTHSTENCIL, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL},
|
||||
+ {WINED3D_RTYPE_TEXTURE_1D, WINED3DUSAGE_TEXTURE, D3D11_FORMAT_SUPPORT_TEXTURE1D | D3D11_FORMAT_SUPPORT_MIP},
|
||||
+ {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_TEXTURE, D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_MIP},
|
||||
+ {WINED3D_RTYPE_TEXTURE_3D, WINED3DUSAGE_TEXTURE, D3D11_FORMAT_SUPPORT_TEXTURE3D | D3D11_FORMAT_SUPPORT_MIP},
|
||||
+ {WINED3D_RTYPE_NONE, WINED3DUSAGE_RENDERTARGET, D3D11_FORMAT_SUPPORT_RENDER_TARGET | D3D11_FORMAT_SUPPORT_DISPLAY},
|
||||
+ {WINED3D_RTYPE_NONE, WINED3DUSAGE_DEPTHSTENCIL, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL},
|
||||
+ {WINED3D_RTYPE_BUFFER, WINED3DUSAGE_QUERY_VERTEXTEXTURE, D3D11_FORMAT_SUPPORT_BUFFER |
|
||||
+ D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER | D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER | D3D11_FORMAT_SUPPORT_SO_BUFFER
|
||||
+ },
|
||||
+ {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_TEXTURE | WINED3DUSAGE_LEGACY_CUBEMAP, D3D11_FORMAT_SUPPORT_TEXTURECUBE},
|
||||
+ {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_TEXTURE | WINED3DUSAGE_QUERY_GENMIPMAP, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN},
|
||||
+ {WINED3D_RTYPE_TEXTURE_2D, WINED3DUSAGE_TEXTURE | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3D11_FORMAT_SUPPORT_BLENDABLE},
|
||||
};
|
||||
HRESULT hr;
|
||||
|
||||
FIXME("iface %p, format %u, format_support %p partial-stub!\n", iface, format, format_support);
|
||||
|
||||
wined3d_format = wined3dformat_from_dxgi_format(format);
|
||||
- if (format && !wined3d_format)
|
||||
+ if ((format && !wined3d_format) || wined3d_format == WINED3DFMT_UNKNOWN)
|
||||
{
|
||||
WARN("Invalid format %#x.\n", format);
|
||||
*format_support = 0;
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 6d7fccd..82b746f 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -16037,7 +16037,8 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
|
||||
|
||||
if (formats[i].fl_required <= feature_level)
|
||||
{
|
||||
- todo_wine ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n",
|
||||
+ todo_wine_if(formats[i].format == DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM)
|
||||
+ ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n",
|
||||
format, feature_name, feature_level, format_support[format]);
|
||||
continue;
|
||||
}
|
||||
@@ -16050,6 +16051,9 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
|
||||
continue;
|
||||
}
|
||||
|
||||
+ todo_wine_if(formats[i].format == DXGI_FORMAT_R16G16B16A16_FLOAT ||
|
||||
+ formats[i].format == DXGI_FORMAT_R10G10B10A2_UNORM ||
|
||||
+ formats[i].format == DXGI_FORMAT_R32_UINT)
|
||||
ok(!supported, "Format %#x - %s supported, feature level %#x, format support %#x.\n",
|
||||
format, feature_name, feature_level, format_support[format]);
|
||||
}
|
||||
@@ -16057,6 +16061,15 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
|
||||
|
||||
static void test_required_format_support(const D3D_FEATURE_LEVEL feature_level)
|
||||
{
|
||||
+ static const UINT expected = D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER |
|
||||
+ D3D11_FORMAT_SUPPORT_TEXTURE1D | D3D11_FORMAT_SUPPORT_TEXTURE2D |
|
||||
+ D3D11_FORMAT_SUPPORT_TEXTURE3D | D3D11_FORMAT_SUPPORT_TEXTURECUBE |
|
||||
+ D3D11_FORMAT_SUPPORT_MIP | D3D11_FORMAT_SUPPORT_MIP_AUTOGEN |
|
||||
+ D3D11_FORMAT_SUPPORT_RENDER_TARGET | D3D11_FORMAT_SUPPORT_BLENDABLE |
|
||||
+ D3D11_FORMAT_SUPPORT_DISPLAY /* | D3D11_FORMAT_SUPPORT_SHADER_LOAD
|
||||
+ D3D11_FORMAT_SUPPORT_SHADER_SAMPLE | D3D11_FORMAT_SUPPORT_CPU_LOCKABLE |
|
||||
+ D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE | D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST
|
||||
+ D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET */;
|
||||
unsigned int format_support[DXGI_FORMAT_B4G4R4A4_UNORM + 1];
|
||||
struct device_desc device_desc;
|
||||
ID3D11Device *device;
|
||||
@@ -16084,6 +16097,24 @@ static void test_required_format_support(const D3D_FEATURE_LEVEL feature_level)
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!support, "Got unexpected format support %#x.\n", support);
|
||||
|
||||
+ /* crashes on Windows, even though MSDN states the function returns E_INVALIDARG */
|
||||
+ if (0)
|
||||
+ {
|
||||
+ hr = ID3D11Device_CheckFormatSupport(device, DXGI_FORMAT_R8G8B8A8_UNORM, NULL);
|
||||
+ ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %#x.\n", hr);
|
||||
+ }
|
||||
+
|
||||
+ hr = ID3D11Device_CheckFormatSupport(device, DXGI_FORMAT_UNKNOWN, &support);
|
||||
+ ok(hr == E_FAIL, "Expected E_FAIL, got %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11Device_CheckFormatSupport(device, 0xdeadbeef, &support);
|
||||
+ ok(hr == E_FAIL, "Expected E_FAIL, got %#x.\n", hr);
|
||||
+
|
||||
+ hr = ID3D11Device_CheckFormatSupport(device, DXGI_FORMAT_R8G8B8A8_UNORM, &support);
|
||||
+ ok(hr == S_OK, "Expected S_OK, got %#x.\n", hr);
|
||||
+ ok((support & expected) == expected, "Expected the following features to be supported: %#x.\n",
|
||||
+ (support ^ expected) & expected);
|
||||
+
|
||||
memset(format_support, 0, sizeof(format_support));
|
||||
for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format)
|
||||
{
|
||||
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
|
||||
index f18c4ac..fe4d087 100644
|
||||
--- a/dlls/wined3d/directx.c
|
||||
+++ b/dlls/wined3d/directx.c
|
||||
@@ -5335,10 +5335,23 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
|
||||
case WINED3D_RTYPE_NONE:
|
||||
allowed_usage = WINED3DUSAGE_DEPTHSTENCIL
|
||||
| WINED3DUSAGE_RENDERTARGET;
|
||||
- gl_type = WINED3D_GL_RES_TYPE_TEX_2D;
|
||||
+ gl_type = WINED3D_GL_RES_TYPE_TEX_1D;
|
||||
gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
|
||||
break;
|
||||
|
||||
+ case WINED3D_RTYPE_TEXTURE_1D:
|
||||
+ allowed_usage = WINED3DUSAGE_DYNAMIC
|
||||
+ | WINED3DUSAGE_SOFTWAREPROCESSING
|
||||
+ | WINED3DUSAGE_TEXTURE
|
||||
+ | WINED3DUSAGE_QUERY_FILTER
|
||||
+ | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
|
||||
+ | WINED3DUSAGE_QUERY_SRGBREAD
|
||||
+ | WINED3DUSAGE_QUERY_SRGBWRITE
|
||||
+ | WINED3DUSAGE_QUERY_VERTEXTEXTURE
|
||||
+ | WINED3DUSAGE_QUERY_WRAPANDMIP;
|
||||
+ gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_1D;
|
||||
+ break;
|
||||
+
|
||||
case WINED3D_RTYPE_TEXTURE_2D:
|
||||
allowed_usage = WINED3DUSAGE_DEPTHSTENCIL
|
||||
| WINED3DUSAGE_RENDERTARGET
|
||||
@@ -5395,6 +5408,12 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
|
||||
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
|
||||
break;
|
||||
|
||||
+ case WINED3D_RTYPE_BUFFER:
|
||||
+ allowed_usage = WINED3DUSAGE_DYNAMIC
|
||||
+ | WINED3DUSAGE_QUERY_VERTEXTEXTURE;
|
||||
+ gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER;
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
FIXME("Unhandled resource type %s.\n", debug_d3dresourcetype(resource_type));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,54 +0,0 @@
|
||||
From 832b94de184ffe01067e877969b465fa0ea23fd4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 7 Jul 2017 04:03:19 +0200
|
||||
Subject: [PATCH] d3d11: Allow DXGI_FORMAT_UNKNOWN in CheckFormatSupport and
|
||||
improve tests.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 2 +-
|
||||
dlls/d3d11/tests/d3d11.c | 6 ++----
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index a4e1d4b..89d3922 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -3241,7 +3241,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
|
||||
FIXME("iface %p, format %u, format_support %p partial-stub!\n", iface, format, format_support);
|
||||
|
||||
wined3d_format = wined3dformat_from_dxgi_format(format);
|
||||
- if ((format && !wined3d_format) || wined3d_format == WINED3DFMT_UNKNOWN)
|
||||
+ if (format && !wined3d_format)
|
||||
{
|
||||
WARN("Invalid format %#x.\n", format);
|
||||
*format_support = 0;
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 82b746f..5f31ced 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -16061,7 +16061,7 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
|
||||
|
||||
static void test_required_format_support(const D3D_FEATURE_LEVEL feature_level)
|
||||
{
|
||||
- static const UINT expected = D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER |
|
||||
+ UINT expected = D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER |
|
||||
D3D11_FORMAT_SUPPORT_TEXTURE1D | D3D11_FORMAT_SUPPORT_TEXTURE2D |
|
||||
D3D11_FORMAT_SUPPORT_TEXTURE3D | D3D11_FORMAT_SUPPORT_TEXTURECUBE |
|
||||
D3D11_FORMAT_SUPPORT_MIP | D3D11_FORMAT_SUPPORT_MIP_AUTOGEN |
|
||||
@@ -16104,12 +16104,10 @@ static void test_required_format_support(const D3D_FEATURE_LEVEL feature_level)
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %#x.\n", hr);
|
||||
}
|
||||
|
||||
- hr = ID3D11Device_CheckFormatSupport(device, DXGI_FORMAT_UNKNOWN, &support);
|
||||
- ok(hr == E_FAIL, "Expected E_FAIL, got %#x.\n", hr);
|
||||
-
|
||||
hr = ID3D11Device_CheckFormatSupport(device, 0xdeadbeef, &support);
|
||||
ok(hr == E_FAIL, "Expected E_FAIL, got %#x.\n", hr);
|
||||
|
||||
+ if (feature_level < D3D_FEATURE_LEVEL_10_0) expected &= ~D3D11_FORMAT_SUPPORT_TEXTURE1D;
|
||||
hr = ID3D11Device_CheckFormatSupport(device, DXGI_FORMAT_R8G8B8A8_UNORM, &support);
|
||||
ok(hr == S_OK, "Expected S_OK, got %#x.\n", hr);
|
||||
ok((support & expected) == expected, "Expected the following features to be supported: %#x.\n",
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1 +0,0 @@
|
||||
Disabled: true
|
@ -1,7 +1,6 @@
|
||||
Depends: wined3d-Accounting
|
||||
Depends: wined3d-DXTn
|
||||
Depends: wined3d-QUERY_Stubs
|
||||
Depends: d3d11-ID3D11Texture1D_Rebased
|
||||
Depends: wined3d-Silence_FIXMEs
|
||||
Depends: wined3d-UAV_Counters
|
||||
Depends: wined3d-Dual_Source_Blending
|
||||
|
@ -1,3 +1,2 @@
|
||||
Fixes: Implement dual source blending in wined3d
|
||||
Depends: wined3d-Viewports
|
||||
Depends: d3d11-ID3D11Texture1D_Rebased
|
Loading…
x
Reference in New Issue
Block a user