[PATCH] WineD3D: Silence some format spam=0A=

Stefan Doesinger stefan at codeweavers.com
Mon Aug 25 09:25:24 CDT 2008


=0A=
This mainly adds these formats to the debug list, so the debug=0A=
function doesn't write out spam when=0A=
the application tests if they're supported. There is no urge to=0A=
implement them though.=0A=
=0A=
Also add them to the GetFourCCCodes list in ddraw, Windows lists=0A=
those formats in there(including=0A=
other junk like MAKEFOURCC('A','T','O','C') which has nothing to=0A=
do with ddraw)=0A=
---=0A=
 dlls/ddraw/ddraw.c           |    3 ++-=0A=
 dlls/wined3d/directx.c       |   14 ++++++++++++++=0A=
 dlls/wined3d/utils.c         |    7 ++++++-=0A=
 include/wine/wined3d_types.h |    2 ++=0A=
 4 files changed, 24 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c=0A=
index 73982ed..436846c 100644=0A=
--- a/dlls/ddraw/ddraw.c=0A=
+++ b/dlls/ddraw/ddraw.c=0A=
@@ -880,8 +880,9 @@ IDirectDrawImpl_GetFourCCCodes(IDirectDraw7 *iface,=0A=
 {=0A=
     ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw7, iface);=0A=
     WINED3DFORMAT formats[] =3D {=0A=
-        WINED3DFMT_YUY2, WINED3DFMT_UYVY,=0A=
+        WINED3DFMT_YUY2, WINED3DFMT_UYVY, WINED3DFMT_YV12,=0A=
         WINED3DFMT_DXT1, WINED3DFMT_DXT2, WINED3DFMT_DXT3, =
WINED3DFMT_DXT4, WINED3DFMT_DXT5,=0A=
+        WINED3DFMT_ATI2N, WINED3DFMT_NVHU, WINED3DFMT_NVHS=0A=
     };=0A=
     DWORD count =3D 0, i, outsize;=0A=
     HRESULT hr;=0A=
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c=0A=
index 53ea543..d269406 100644=0A=
--- a/dlls/wined3d/directx.c=0A=
+++ b/dlls/wined3d/directx.c=0A=
@@ -2323,6 +2323,9 @@ static BOOL CheckTextureCapability(UINT Adapter, =
WINED3DDEVTYPE DeviceType, WINE=0A=
             }=0A=
             TRACE_(d3d_caps)("[FAILED]\n");=0A=
             return FALSE;=0A=
+        case WINED3DFMT_YV12:=0A=
+            TRACE_(d3d_caps)("[FAILED]\n");=0A=
+            return FALSE;=0A=
 =0A=
             /* Not supported */=0A=
         case WINED3DFMT_A16B16G16R16:=0A=
@@ -2397,6 +2400,17 @@ static BOOL CheckTextureCapability(UINT Adapter, =
WINED3DDEVTYPE DeviceType, WINE=0A=
             TRACE_(d3d_caps)("[FAILED]\n");=0A=
             return FALSE;=0A=
 =0A=
+        case WINED3DFMT_NVHU:=0A=
+        case WINED3DFMT_NVHS:=0A=
+            /* These formats seem to be similar to the HILO formats in =
GL_NV_texture_shader. NVHU=0A=
+             * is said to be GL_UNSIGNED_HILO16, NVHS GL_SIGNED_HILO16. =
Rumours say that d3d computes=0A=
+             * a 3rd channel similarly to D3DFMT_CxV8U8(So NVHS could =
be called D3DFMT_CxV16U16).=0A=
+             * ATI refused to support formats which can easilly be =
emulated with pixel shaders, so=0A=
+             * Applications have to deal with not having NVHS and NVHU.=0A=
+             */=0A=
+            TRACE_(d3d_caps)("[FAILED]\n");=0A=
+            return FALSE;=0A=
+=0A=
         case WINED3DFMT_UNKNOWN:=0A=
             return FALSE;=0A=
 =0A=
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c=0A=
index 119f526..c0e1ccf 100644=0A=
--- a/dlls/wined3d/utils.c=0A=
+++ b/dlls/wined3d/utils.c=0A=
@@ -44,7 +44,7 @@ static const StaticPixelFormatDesc formats[] =3D {=0A=
     /* FourCC formats, kept here to have WINED3DFMT_R8G8B8(=3D20) at =
position 20 */=0A=
     {WINED3DFMT_UYVY        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,2      ,0      ,0          ,TRUE  },=0A=
     {WINED3DFMT_YUY2        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,2      ,0      ,0          ,TRUE  },=0A=
-    {WINED3DFMT_YV12        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,1/*?*/ ,0      ,0          ,TRUE  },=0A=
+    {WINED3DFMT_YV12        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,2      ,0      ,0          ,TRUE  },=0A=
     {WINED3DFMT_DXT1        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,1      ,0      ,0          ,TRUE  },=0A=
     {WINED3DFMT_DXT2        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,1      ,0      ,0          ,TRUE  },=0A=
     {WINED3DFMT_DXT3        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,1      ,0      ,0          ,TRUE  },=0A=
@@ -114,6 +114,8 @@ static const StaticPixelFormatDesc formats[] =3D {=0A=
     {WINED3DFMT_Q16W16V16U16,0x0        ,0x0        ,0x0        ,0x0    =
    ,8      ,0      ,0          ,FALSE },=0A=
     /* Vendor-specific formats */=0A=
     {WINED3DFMT_ATI2N       ,0x0        ,0x0        ,0x0        ,0x0    =
    ,1      ,0      ,0          ,TRUE  },=0A=
+    {WINED3DFMT_NVHU        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,2      ,0      ,0          ,TRUE  },=0A=
+    {WINED3DFMT_NVHS        ,0x0        ,0x0        ,0x0        ,0x0    =
    ,2      ,0      ,0          ,TRUE  },=0A=
 };=0A=
 =0A=
 typedef struct {=0A=
@@ -528,6 +530,7 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {=0A=
     FMT_TO_STR(WINED3DFMT_A2W10V10U10);=0A=
     FMT_TO_STR(WINED3DFMT_UYVY);=0A=
     FMT_TO_STR(WINED3DFMT_YUY2);=0A=
+    FMT_TO_STR(WINED3DFMT_YV12);=0A=
     FMT_TO_STR(WINED3DFMT_DXT1);=0A=
     FMT_TO_STR(WINED3DFMT_DXT2);=0A=
     FMT_TO_STR(WINED3DFMT_DXT3);=0A=
@@ -558,6 +561,8 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {=0A=
     FMT_TO_STR(WINED3DFMT_A32B32G32R32F);=0A=
     FMT_TO_STR(WINED3DFMT_CxV8U8);=0A=
     FMT_TO_STR(WINED3DFMT_ATI2N);=0A=
+    FMT_TO_STR(WINED3DFMT_NVHU);=0A=
+    FMT_TO_STR(WINED3DFMT_NVHS);=0A=
 #undef FMT_TO_STR=0A=
   default:=0A=
     {=0A=
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h=0A=
index bf35b9f..5b722e7 100644=0A=
--- a/include/wine/wined3d_types.h=0A=
+++ b/include/wine/wined3d_types.h=0A=
@@ -305,6 +305,8 @@ typedef enum _WINED3DFORMAT {=0A=
 =0A=
     /* Vendor specific formats */=0A=
     WINED3DFMT_ATI2N                =3D  WINEMAKEFOURCC('A', 'T', 'I', =
'2'),=0A=
+    WINED3DFMT_NVHU                 =3D  WINEMAKEFOURCC('N', 'V', 'H', =
'U'),=0A=
+    WINED3DFMT_NVHS                 =3D  WINEMAKEFOURCC('N', 'V', 'H', =
'S'),=0A=
 =0A=
     WINED3DFMT_FORCE_DWORD          =3D 0xFFFFFFFF=0A=
 } WINED3DFORMAT;=0A=
-- =0A=
1.5.6.4=0A=
=0A=

------=_NextPart_000_001B_01C90844.7D97F9C0--




More information about the wine-patches mailing list