Module: wine Branch: master Commit: bda6d092a53b05ef778623f4786f940e3f17b965 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=bda6d092a53b05ef778623f4...
Author: Ivan Gyurdiev ivg231@gmail.com Date: Sat Aug 26 22:34:03 2006 -0400
wined3d: Add support for A16B16G16R16F and A32B32G32R32F texture formats.
---
dlls/wined3d/directx.c | 23 +++++++++++++++++++++-- dlls/wined3d/utils.c | 4 ++-- include/wine/wined3d_gl.h | 13 +++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index a7d3e1a..c413175 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -576,6 +576,12 @@ #undef USE_GL_FUNC } else if (strcmp(ThisExtn, "GL_ARB_texture_env_dot3") == 0) { TRACE_(d3d_caps)(" FOUND: ARB Dot3 support\n"); gl_info->supported[ARB_TEXTURE_ENV_DOT3] = TRUE; + } else if (strcmp(ThisExtn, "GL_ARB_texture_float") == 0) { + TRACE_(d3d_caps)(" FOUND: ARB Float texture support\n"); + gl_info->supported[ARB_TEXTURE_FLOAT] = TRUE; + } else if (strcmp(ThisExtn, "GL_ARB_half_float_pixel") == 0) { + TRACE_(d3d_caps)(" FOUND: ARB Half-float pixel support\n"); + gl_info->supported[ARB_HALF_FLOAT_PIXEL] = TRUE; } else if (strcmp(ThisExtn, "GL_ARB_texture_border_clamp") == 0) { TRACE_(d3d_caps)(" FOUND: ARB Texture border clamp support\n"); gl_info->supported[ARB_TEXTURE_BORDER_CLAMP] = TRUE; @@ -1639,6 +1645,21 @@ static HRESULT WINAPI IWineD3DImpl_Check } }
+ if (GL_SUPPORT(ARB_TEXTURE_FLOAT)) { + + BOOL half_pixel_support = GL_SUPPORT(ARB_HALF_FLOAT_PIXEL); + + switch (CheckFormat) { + case D3DFMT_A16B16G16R16F: + if (!half_pixel_support) break; + case D3DFMT_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 * supported(tested with the dxCapsViewer) and pretending to @@ -1729,10 +1750,8 @@ static HRESULT WINAPI IWineD3DImpl_Check */ case WINED3DFMT_R16F: case WINED3DFMT_G16R16F: - case WINED3DFMT_A16B16G16R16F: case WINED3DFMT_R32F: case WINED3DFMT_G32R32F: - case WINED3DFMT_A32B32G32R32F: case WINED3DFMT_CxV8U8: TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ return WINED3DERR_NOTAVAILABLE; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 48b18bd..372fdb1 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -49,13 +49,13 @@ static const PixelFormatDesc formats[] = /* IEEE formats */ {WINED3DFMT_R32F ,0x0 ,0x0 ,0x0 ,0x0 ,4 ,FALSE ,0 ,0 ,0 }, {WINED3DFMT_G32R32F ,0x0 ,0x0 ,0x0 ,0x0 ,8 ,FALSE ,0 ,0 ,0 }, - {WINED3DFMT_A32B32G32R32F,0x0 ,0x0 ,0x0 ,0x0 ,16 ,FALSE ,0 ,0 ,0 }, + {WINED3DFMT_A32B32G32R32F,0x0 ,0x0 ,0x0 ,0x0 ,16 ,FALSE ,GL_RGBA32F_ARB ,GL_RGBA ,GL_FLOAT }, /* Hmm? */ {WINED3DFMT_CxV8U8 ,0x0 ,0x0 ,0x0 ,0x0 ,2 ,FALSE ,0 ,0 ,0 }, /* Float */ {WINED3DFMT_R16F ,0x0 ,0x0 ,0x0 ,0x0 ,2 ,FALSE ,0 ,0 ,0 }, {WINED3DFMT_G16R16F ,0x0 ,0x0 ,0x0 ,0x0 ,4 ,FALSE ,0 ,0 ,0 }, - {WINED3DFMT_A16B16G16R16F,0x0 ,0x0 ,0x0 ,0x0 ,8 ,FALSE ,0 ,0 ,0 }, + {WINED3DFMT_A16B16G16R16F,0x0 ,0x0 ,0x0 ,0x0 ,8 ,FALSE ,GL_RGBA16F_ARB ,GL_RGBA ,GL_HALF_FLOAT_ARB }, /* Palettized formats */ {WINED3DFMT_A8P8 ,0x0000ff00 ,0x0 ,0x0 ,0x0 ,2 ,FALSE ,0 ,0 ,0 }, {WINED3DFMT_P8 ,0x0 ,0x0 ,0x0 ,0x0 ,1 ,FALSE ,GL_COLOR_INDEX8_EXT ,GL_COLOR_INDEX ,GL_UNSIGNED_BYTE }, diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h index 0aa41e3..36e9a20 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -473,6 +473,17 @@ #define GL_EXT_texture_env_dot3 1 #define GL_DOT3_RGB_EXT 0x8740 #define GL_DOT3_RGBA_EXT 0x8741 #endif +/* GL_ARB_texture_float */ +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGBA16F_ARB 0x881A +#endif +/* GL_ARB_half_float_pixel */ +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif /* GL_ARB_vertex_program */ #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 @@ -1407,6 +1418,8 @@ typedef enum _GL_SupportedExt { ARB_TEXTURE_ENV_ADD, ARB_TEXTURE_ENV_COMBINE, ARB_TEXTURE_ENV_DOT3, + ARB_TEXTURE_FLOAT, + ARB_HALF_FLOAT_PIXEL, ARB_TEXTURE_BORDER_CLAMP, ARB_TEXTURE_MIRRORED_REPEAT, ARB_VERTEX_PROGRAM,