=?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Add support for D3DFMT_A32B32G32R32F.

Alexandre Julliard julliard at winehq.org
Wed Jan 16 13:47:42 CST 2013


Module: wine
Branch: master
Commit: 25ce3a42204ab43850ee92fab133ea42f288f1b2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=25ce3a42204ab43850ee92fab133ea42f288f1b2

Author: Rico Schüller <kgbricola at web.de>
Date:   Tue Jan 15 19:25:26 2013 +0100

d3dx9: Add support for D3DFMT_A32B32G32R32F.

---

 dlls/d3dx9_36/d3dx9_36_private.h |    1 +
 dlls/d3dx9_36/tests/texture.c    |    4 ++--
 dlls/d3dx9_36/texture.c          |    8 +++++---
 dlls/d3dx9_36/util.c             |    1 +
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h
index 01bfbbe..85f0871 100644
--- a/dlls/d3dx9_36/d3dx9_36_private.h
+++ b/dlls/d3dx9_36/d3dx9_36_private.h
@@ -48,6 +48,7 @@ struct volume
 enum format_type {
     FORMAT_ARGB,   /* unsigned */
     FORMAT_ARGBF16,/* float 16 */
+    FORMAT_ARGBF,  /* float */
     FORMAT_DXT,
     FORMAT_UNKNOWN
 };
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index 968a8db..28fb47e 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -1101,7 +1101,7 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device)
     if (SUCCEEDED(hr))
     {
         hr = D3DXFillTexture(tex, fillfunc, NULL);
-        todo_wine ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK);
+        ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK);
 
         hr = IDirect3DTexture9_LockRect(tex, 0, &lock_rect, NULL, D3DLOCK_READONLY);
         if (SUCCEEDED(hr))
@@ -1124,7 +1124,7 @@ static void test_D3DXFillTexture(IDirect3DDevice9 *device)
                     expected.z = 1.0f / 4.0f;
                     expected.w = 1.0f;
 
-                    todo_wine expect_vec4(&expected, &got);
+                    expect_vec4(&expected, &got);
                 }
             }
 
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 7323852..9e45506 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1236,6 +1236,8 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
 
         if (format->type == FORMAT_ARGBF16)
             v = float_32_to_16(comp_value);
+        else if (format->type == FORMAT_ARGBF)
+            v = *(DWORD *)&comp_value;
         else if (format->type == FORMAT_ARGB)
             v = comp_value * ((1 << format->bits[c]) - 1) + 0.5f;
         else
@@ -1282,7 +1284,7 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
             return D3DERR_INVALIDCALL;
 
         format = get_format_info(desc.Format);
-        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
+        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
         {
             FIXME("Unsupported texture format %#x\n", desc.Format);
             return D3DERR_INVALIDCALL;
@@ -1649,7 +1651,7 @@ HRESULT WINAPI D3DXFillCubeTexture(struct IDirect3DCubeTexture9 *texture, LPD3DX
             return D3DERR_INVALIDCALL;
 
         format = get_format_info(desc.Format);
-        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
+        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
         {
             FIXME("Unsupported texture format %#x\n", desc.Format);
             return D3DERR_INVALIDCALL;
@@ -1708,7 +1710,7 @@ HRESULT WINAPI D3DXFillVolumeTexture(struct IDirect3DVolumeTexture9 *texture, LP
             return D3DERR_INVALIDCALL;
 
         format = get_format_info(desc.Format);
-        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16)
+        if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
         {
             FIXME("Unsupported texture format %#x\n", desc.Format);
             return D3DERR_INVALIDCALL;
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index 264581c..6d8d152 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -71,6 +71,7 @@ static const struct pixel_format_desc formats[] =
     {D3DFMT_DXT4,          { 0,  0,  0,  0}, { 0,  0,  0,  0},  1, 4, 4, 16, FORMAT_DXT,     NULL,         NULL      },
     {D3DFMT_DXT5,          { 0,  0,  0,  0}, { 0,  0,  0,  0},  1, 4, 4, 16, FORMAT_DXT,     NULL,         NULL      },
     {D3DFMT_A16B16G16R16F, {16, 16, 16, 16}, {48,  0, 16, 32},  8, 1, 1,  8, FORMAT_ARGBF16, NULL,         NULL      },
+    {D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96,  0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF,   NULL,         NULL      },
     /* marks last element */
     {D3DFMT_UNKNOWN,       { 0,  0,  0,  0}, { 0,  0,  0,  0},  0, 1, 1,  0, FORMAT_UNKNOWN, NULL,         NULL      },
 };




More information about the wine-cvs mailing list