diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index a7d3e1ac94e..c4131750a76 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -576,6 +576,12 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) { } 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_CheckDeviceFormat(IWineD3D *iface, UINT Adapt } } + 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_CheckDeviceFormat(IWineD3D *iface, UINT Adapt */ 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 48b18bd374a..372fdb19fbe 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 0aa41e34eb0..36e9a203406 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -473,6 +473,17 @@ typedef void (APIENTRY * PGLFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint leve #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,