Module: wine Branch: master Commit: f7b565e2cae77cc9e269f9ba84f082e84325fd6e URL: http://source.winehq.org/git/wine.git/?a=commit;h=f7b565e2cae77cc9e269f9ba84...
Author: Vitaly Budovski vbudovski@gmail.com Date: Wed Mar 21 15:35:42 2007 +1100
wined3d: Check for float texture formats correctly.
Move the checks for float texture formats into the correct location. This allows some Direct3D sample applications which check for any of the float formats together with D3DUSAGE_RENDERTARGET to start.
---
dlls/wined3d/directx.c | 32 +++++++++++++++----------------- 1 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 90d3932..6a1b9e8 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1662,6 +1662,21 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt case WINED3DFMT_P8: TRACE_(d3d_caps)("[OK]\n"); return WINED3D_OK; + case WINED3DFMT_R16F: + case WINED3DFMT_A16B16G16R16F: + if (!GL_SUPPORT(ARB_HALF_FLOAT_PIXEL)) { + TRACE_(d3d_caps)("[FAILED]\n"); + return WINED3DERR_NOTAVAILABLE; + } + /* Fall through, support not fully determined yet. */ + case WINED3DFMT_R32F: + case WINED3DFMT_A32B32G32R32F: + if (!GL_SUPPORT(ARB_TEXTURE_FLOAT)) { + TRACE_(d3d_caps)("[FAILED]\n"); + return WINED3DERR_NOTAVAILABLE; + } + TRACE_(d3d_caps)("[OK]\n"); + return WINED3D_OK; default: TRACE_(d3d_caps)("[FAILED]\n"); return WINED3DERR_NOTAVAILABLE; @@ -1682,23 +1697,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