Henri Verbeet : wined3d: Store the VTF format capability in the format table.

Alexandre Julliard julliard at winehq.org
Thu Apr 29 14:45:05 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Apr 29 00:09:03 2010 +0200

wined3d: Store the VTF format capability in the format table.

---

 dlls/wined3d/directx.c         |   26 ++------------------------
 dlls/wined3d/utils.c           |    2 +-
 dlls/wined3d/wined3d_private.h |    1 +
 3 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e4544be..baabda8 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3636,30 +3636,8 @@ static BOOL CheckSurfaceCapability(struct wined3d_adapter *adapter,
 static BOOL CheckVertexTextureCapability(struct wined3d_adapter *adapter,
         const struct wined3d_format_desc *format_desc)
 {
-    const struct wined3d_gl_info *gl_info = &adapter->gl_info;
-
-    if (!gl_info->limits.vertex_samplers)
-    {
-        TRACE_(d3d_caps)("[FAILED]\n");
-        return FALSE;
-    }
-
-    switch (format_desc->format)
-    {
-        case WINED3DFMT_R32G32B32A32_FLOAT:
-            if (!gl_info->supported[ARB_TEXTURE_FLOAT])
-            {
-                TRACE_(d3d_caps)("[FAILED]\n");
-                return FALSE;
-            }
-            TRACE_(d3d_caps)("[OK]\n");
-            return TRUE;
-
-        default:
-            TRACE_(d3d_caps)("[FAILED]\n");
-            return FALSE;
-    }
-    return FALSE;
+    return adapter->gl_info.limits.vertex_samplers
+            && (format_desc->Flags & WINED3DFMT_FLAG_VTF);
 }
 
 static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType,
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 60a7bee..ac7e2da 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -619,7 +619,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
             ARB_TEXTURE_RG,             NULL},
     {WINED3DFMT_R32G32B32A32_FLOAT,     GL_RGBA32F_ARB,                   GL_RGBA32F_ARB,                         0,
             GL_RGBA,                    GL_FLOAT,                         0,
-            WINED3DFMT_FLAG_RENDERTARGET,
+            WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF,
             ARB_TEXTURE_FLOAT,          NULL},
     /* Float */
     {WINED3DFMT_R16_FLOAT,              GL_RGB16F_ARB,                    GL_RGB16F_ARB,                          0,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d0ed13c..c316a4b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2991,6 +2991,7 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN;
 #define WINED3DFMT_FLAG_BUMPMAP                     0x00000400
 #define WINED3DFMT_FLAG_SRGB_READ                   0x00000800
 #define WINED3DFMT_FLAG_SRGB_WRITE                  0x00001000
+#define WINED3DFMT_FLAG_VTF                         0x00002000
 
 struct wined3d_format_desc
 {




More information about the wine-cvs mailing list