Stefan Dösinger : wined3d: Move the float format check to the big switch statement.

Alexandre Julliard julliard at winehq.org
Tue Feb 5 06:35:09 CST 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Feb  4 00:31:52 2008 +0100

wined3d: Move the float format check to the big switch statement.

---

 dlls/wined3d/directx.c |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e4d8da2..622c17e 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1929,23 +1929,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
         }
     }
 
-    if (GL_SUPPORT(ARB_TEXTURE_FLOAT)) {
-
-        BOOL half_pixel_support = GL_SUPPORT(ARB_HALF_FLOAT_PIXEL);
-
-        switch (CheckFormat) {
-            case WINED3DFMT_R16F:
-            case WINED3DFMT_A16B16G16R16F:
-                if (!half_pixel_support) break;
-            case WINED3DFMT_R32F:
-            case WINED3DFMT_A32B32G32R32F:
-                TRACE_(d3d_caps)("[OK]\n");
-                return WINED3D_OK;
-            default:
-                break; /* Avoid compiler warnings */
-        }
-    }
-
     /* This format is nothing special and it is supported perfectly.
      * However, ati and nvidia driver on windows do not mark this format as
      * supported (tested with the dxCapsViewer) and pretending to
@@ -2046,10 +2029,8 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
             return WINED3DERR_NOTAVAILABLE;
 
         /*****
-         *  Float formats: Not supported right now
+         *  WINED3DFMT_CxV8U8: Not supported right now
          */
-        case WINED3DFMT_G16R16F:
-        case WINED3DFMT_G32R32F:
         case WINED3DFMT_CxV8U8:
             TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
             return WINED3DERR_NOTAVAILABLE;
@@ -2060,6 +2041,31 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
             TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
             return WINED3DERR_NOTAVAILABLE;
 
+            /* Floating point formats */
+        case WINED3DFMT_R16F:
+        case WINED3DFMT_A16B16G16R16F:
+            if(GL_SUPPORT(ARB_HALF_FLOAT_PIXEL)) {
+                TRACE_(d3d_caps)("[OK]\n");
+                return WINED3D_OK;
+            } else {
+                TRACE_(d3d_caps)("[FAILED]\n");
+                return WINED3DERR_NOTAVAILABLE;
+            }
+        case WINED3DFMT_R32F:
+        case WINED3DFMT_A32B32G32R32F:
+            if (GL_SUPPORT(ARB_TEXTURE_FLOAT)) {
+                TRACE_(d3d_caps)("[OK]\n");
+                return WINED3D_OK;
+            } else {
+                TRACE_(d3d_caps)("[FAILED]\n");
+                return WINED3DERR_NOTAVAILABLE;
+            }
+
+        case WINED3DFMT_G16R16F:
+        case WINED3DFMT_G32R32F:
+            TRACE_(d3d_caps)("[FAILED]\n");
+            return WINED3DERR_NOTAVAILABLE;
+
         /* ATI instancing hack: Although ATI cards do not support Shader Model 3.0, they support
          * instancing. To query if the card supports instancing CheckDeviceFormat with the special format
          * MAKEFOURCC('I','N','S','T') is used. Should a (broken) app check for this provide a proper return value.




More information about the wine-cvs mailing list