https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4053a5ada3fe613aba40e…
commit 4053a5ada3fe613aba40e2f48d568b44f1cf8fc7
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: Don't pass usage flags for staging texture in
D3DXCreateCubeTextureFromFileInMemoryEx().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47974
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 a0840773f7ee00dc9373b4db825fec68d08ee53b by Paul Gofman
<gofmanp(a)gmail.com>
---
dll/directx/wine/d3dx9_36/texture.c | 2 +-
modules/rostests/winetests/d3dx9_36/texture.c | 17 ++++++++++++-----
sdk/tools/winesync/d3dx9.cfg | 2 +-
3 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 07d5dbabca8..bdba12d5a62 100644
--- a/dll/directx/wine/d3dx9_36/texture.c
+++ b/dll/directx/wine/d3dx9_36/texture.c
@@ -1485,7 +1485,7 @@ HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device,
dynamic_texture = (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) && (usage &
D3DUSAGE_DYNAMIC);
if (pool == D3DPOOL_DEFAULT && !dynamic_texture)
{
- hr = D3DXCreateCubeTexture(device, size, mip_levels, usage, format,
D3DPOOL_SYSTEMMEM, &buftex);
+ hr = D3DXCreateCubeTexture(device, size, mip_levels, 0, format,
D3DPOOL_SYSTEMMEM, &buftex);
tex = buftex;
}
else
diff --git a/modules/rostests/winetests/d3dx9_36/texture.c
b/modules/rostests/winetests/d3dx9_36/texture.c
index 3416a3318b2..3e4d5e5df9c 100644
--- a/modules/rostests/winetests/d3dx9_36/texture.c
+++ b/modules/rostests/winetests/d3dx9_36/texture.c
@@ -2061,8 +2061,14 @@ static void
test_D3DXCreateCubeTextureFromFileInMemory(IDirect3DDevice9 *device)
static void test_D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
{
- HRESULT hr;
IDirect3DCubeTexture9 *cube_texture;
+ HRESULT hr;
+
+ hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map,
sizeof(dds_cube_map), D3DX_DEFAULT,
+ D3DX_DEFAULT, D3DUSAGE_RENDERTARGET, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT,
D3DX_DEFAULT,
+ D3DX_DEFAULT, 0, NULL, NULL, &cube_texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DCubeTexture9_Release(cube_texture);
if (!is_autogenmipmap_supported(device, D3DRTYPE_CUBETEXTURE))
{
@@ -2070,10 +2076,11 @@ static void
test_D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *devic
return;
}
- hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map,
sizeof(dds_cube_map), D3DX_DEFAULT, D3DX_DEFAULT,
- D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT,
D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &cube_texture);
- ok(hr == D3D_OK, "D3DXCreateCubeTextureFromFileInMemoryEx returned %#x, expected
%#x.\n", hr, D3D_OK);
- if (SUCCEEDED(hr)) IDirect3DCubeTexture9_Release(cube_texture);
+ hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map,
sizeof(dds_cube_map), D3DX_DEFAULT,
+ D3DX_DEFAULT, D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_UNKNOWN,
D3DPOOL_DEFAULT,
+ D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &cube_texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DCubeTexture9_Release(cube_texture);
}
static void test_D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *device)
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 35f8e8fc7e2..8b675b5e764 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: f6f90daa3117cf493e0815c42bb0fa1740d31308}
+tags: {wine: a0840773f7ee00dc9373b4db825fec68d08ee53b}