https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed59f01229e089fb27964f03af8864c19462de10

commit ed59f01229e089fb27964f03af8864c19462de10
Author:     winesync <[email protected]>
AuthorDate: Mon Sep 21 23:01:48 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Thu Feb 4 16:37:04 2021 +0100

    [WINESYNC] d3dx9: Use check_texture_requirements() in 
D3DXCheckVolumeTextureRequirements() with correct resource type.
    
    Signed-off-by: Paul Gofman <[email protected]>
    Signed-off-by: Matteo Bruni <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 0b03d21c8f89b3f9dbd68ac849f9923197095eb5 by Paul Gofman 
<[email protected]>
---
 dll/directx/wine/d3dx9_36/texture.c           |  3 +--
 modules/rostests/winetests/d3dx9_36/texture.c | 17 +++++++++++++++++
 sdk/tools/winesync/d3dx9.cfg                  |  2 +-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/dll/directx/wine/d3dx9_36/texture.c 
b/dll/directx/wine/d3dx9_36/texture.c
index a47d2380403..90c158de0d7 100644
--- a/dll/directx/wine/d3dx9_36/texture.c
+++ b/dll/directx/wine/d3dx9_36/texture.c
@@ -486,7 +486,7 @@ HRESULT WINAPI D3DXCheckVolumeTextureRequirements(struct 
IDirect3DDevice9 *devic
     if (!(caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP))
         return D3DERR_NOTAVAILABLE;
 
-    hr = D3DXCheckTextureRequirements(device, &w, &h, NULL, usage, format, 
pool);
+    hr = check_texture_requirements(device, &w, &h, NULL, usage, format, pool, 
D3DRTYPE_VOLUMETEXTURE);
     if (d == D3DX_DEFAULT)
         d = 1;
 
@@ -1250,7 +1250,6 @@ HRESULT WINAPI 
D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *devic
         hr = D3DXCreateVolumeTexture(device, width, height, depth, mip_levels, 
usage, format, pool, &tex);
         buftex = NULL;
     }
-
     if (FAILED(hr)) return hr;
 
     hr = load_volume_texture_from_dds(tex, data, palette, filter, color_key, 
&image_info);
diff --git a/modules/rostests/winetests/d3dx9_36/texture.c 
b/modules/rostests/winetests/d3dx9_36/texture.c
index 3e4d5e5df9c..2688559c2c7 100644
--- a/modules/rostests/winetests/d3dx9_36/texture.c
+++ b/modules/rostests/winetests/d3dx9_36/texture.c
@@ -2125,6 +2125,22 @@ static void 
test_D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *devic
     ok(ref == 0, "Invalid reference count. Got %u, expected 0.\n", ref);
 }
 
+static void test_D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 
*device)
+{
+    IDirect3DVolumeTexture9 *volume_texture;
+    HRESULT hr;
+
+    hr = D3DXCreateVolumeTextureFromFileInMemoryEx(device, dds_volume_map, 
sizeof(dds_volume_map), D3DX_DEFAULT,
+            D3DX_DEFAULT, D3DX_DEFAULT, 1, D3DUSAGE_RENDERTARGET, 
D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT,
+            D3DX_DEFAULT, 0, NULL, NULL, &volume_texture);
+    ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+
+    hr = D3DXCreateVolumeTextureFromFileInMemoryEx(device, dds_volume_map, 
sizeof(dds_volume_map), D3DX_DEFAULT,
+            D3DX_DEFAULT, D3DX_DEFAULT, 1, D3DUSAGE_DEPTHSTENCIL, 
D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT,
+            D3DX_DEFAULT, 0, NULL, NULL, &volume_texture);
+    ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+}
+
 /* fills positive x face with red color */
 static void WINAPI fill_cube_positive_x(D3DXVECTOR4 *out, const D3DXVECTOR3 
*tex_coord, const D3DXVECTOR3 *texel_size, void *data)
 {
@@ -2599,6 +2615,7 @@ START_TEST(texture)
     test_D3DXCreateCubeTextureFromFileInMemory(device);
     test_D3DXCreateCubeTextureFromFileInMemoryEx(device);
     test_D3DXCreateVolumeTextureFromFileInMemory(device);
+    test_D3DXCreateVolumeTextureFromFileInMemoryEx(device);
     test_D3DXSaveTextureToFileInMemory(device);
 
     ref = IDirect3DDevice9_Release(device);
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 76197d5aabf..470c427dfbb 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: e50873f504b4693c9efcf7113afcb633155babbc}
+tags: {wine: 0b03d21c8f89b3f9dbd68ac849f9923197095eb5}

Reply via email to