https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be011791e1e3297fd7f22…
commit be011791e1e3297fd7f223f1876a6251cc38787e
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 23:01:48 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:04 2021 +0100
[WINESYNC] d3dx9: Factor our check_texture_requirements() function.
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 92c8c0fc7fb95209fa9dec25234d16b1dbddcf2a by Paul Gofman
<gofmanp(a)gmail.com>
---
dll/directx/wine/d3dx9_36/texture.c | 19 +++++++++++++------
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/texture.c b/dll/directx/wine/d3dx9_36/texture.c
index cdbf3712079..ab59f7db9c9 100644
--- a/dll/directx/wine/d3dx9_36/texture.c
+++ b/dll/directx/wine/d3dx9_36/texture.c
@@ -214,8 +214,8 @@ static D3DFORMAT get_replacement_format(D3DFORMAT format)
return format;
}
-HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width,
UINT *height,
- UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
+static HRESULT check_texture_requirements(struct IDirect3DDevice9 *device, UINT *width,
UINT *height,
+ UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool, D3DRESOURCETYPE
resource_type)
{
UINT w = (width && *width) ? *width : 1;
UINT h = (height && *height) ? *height : 1;
@@ -227,8 +227,6 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9
*device, UIN
D3DFORMAT usedformat = D3DFMT_UNKNOWN;
const struct pixel_format_desc *fmt;
- TRACE("(%p, %p, %p, %p, %u, %p, %u)\n", device, width, height, miplevels,
usage, format, pool);
-
if (!device)
return D3DERR_INVALIDCALL;
@@ -270,7 +268,7 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9
*device, UIN
fmt = get_format_info(usedformat);
hr = IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType,
mode.Format,
- usage, D3DRTYPE_TEXTURE, usedformat);
+ usage, resource_type, usedformat);
if (FAILED(hr))
{
BOOL allow_24bits;
@@ -305,7 +303,7 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9
*device, UIN
continue;
hr = IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal,
params.DeviceType,
- mode.Format, usage, D3DRTYPE_TEXTURE, curfmt->format);
+ mode.Format, usage, resource_type, curfmt->format);
if (FAILED(hr))
continue;
@@ -426,6 +424,15 @@ cleanup:
return D3D_OK;
}
+HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width,
UINT *height,
+ UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
+{
+ TRACE("device %p, width %p, height %p, miplevels %p, usage %u, format %p, pool
%u.\n",
+ device, width, height, miplevels, usage, format, pool);
+
+ return check_texture_requirements(device, width, height, miplevels, usage, format,
pool, D3DRTYPE_TEXTURE);
+}
+
HRESULT WINAPI D3DXCheckCubeTextureRequirements(struct IDirect3DDevice9 *device, UINT
*size,
UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
{
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 095ac63f2c1..7dc33a8c42d 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h:
sdk/inc
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h:
sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h:
sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h:
sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: fcdcd5d3cbb58a40894f661fd8a9285b81a55789}
+tags: {wine: 92c8c0fc7fb95209fa9dec25234d16b1dbddcf2a}