[WINED3D 3/3] Add support for R32F and R16F texture formats
Ivan Gyurdiev
ivg231 at gmail.com
Tue Sep 5 02:40:24 CDT 2006
> gcc -m32 -c -I../../../wine/dlls/wined3d -I. -I../../../wine/include
-I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe
-fno-strict-aliasing -gstabs+
> -Wwrite-strings -Wpointer-arith -g -O2 -o utils.o
../../../wine/dlls/wined3d/utils.c
> ../../../wine/dlls/wined3d/utils.c:50: error: `GL_RGB32F_ARB'
undeclared here (not in a function)
> ../../../wine/dlls/wined3d/utils.c:50: error: initializer element is
not constant
Try this one instead:
-------------- next part --------------
---
dlls/wined3d/directx.c | 4 ++--
dlls/wined3d/utils.c | 4 ++--
include/wine/wined3d_gl.h | 2 ++
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index c413175..d4a0e97 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1650,8 +1650,10 @@ static HRESULT WINAPI IWineD3DImpl_Check
BOOL half_pixel_support = GL_SUPPORT(ARB_HALF_FLOAT_PIXEL);
switch (CheckFormat) {
+ case D3DFMT_R16F:
case D3DFMT_A16B16G16R16F:
if (!half_pixel_support) break;
+ case D3DFMT_R32F:
case D3DFMT_A32B32G32R32F:
TRACE_(d3d_caps)("[OK]\n");
return WINED3D_OK;
@@ -1748,9 +1750,7 @@ static HRESULT WINAPI IWineD3DImpl_Check
/*****
* Float formats: Not supported right now
*/
- case WINED3DFMT_R16F:
case WINED3DFMT_G16R16F:
- case WINED3DFMT_R32F:
case WINED3DFMT_G32R32F:
case WINED3DFMT_CxV8U8:
TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 372fdb1..e0778c0 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -47,13 +47,13 @@ static const PixelFormatDesc formats[] =
{WINED3DFMT_G8R8_G8B8 ,0x0 ,0x0 ,0x0 ,0x0 ,1/*?*/ ,TRUE ,0 ,0 ,0 },
{WINED3DFMT_R8G8_B8G8 ,0x0 ,0x0 ,0x0 ,0x0 ,1/*?*/ ,TRUE ,0 ,0 ,0 },
/* IEEE formats */
- {WINED3DFMT_R32F ,0x0 ,0x0 ,0x0 ,0x0 ,4 ,FALSE ,0 ,0 ,0 },
+ {WINED3DFMT_R32F ,0x0 ,0x0 ,0x0 ,0x0 ,4 ,FALSE ,GL_RGB32F_ARB ,GL_RED ,GL_FLOAT },
{WINED3DFMT_G32R32F ,0x0 ,0x0 ,0x0 ,0x0 ,8 ,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_R16F ,0x0 ,0x0 ,0x0 ,0x0 ,2 ,FALSE ,GL_RGB16F_ARB ,GL_RED ,GL_HALF_FLOAT_ARB },
{WINED3DFMT_G16R16F ,0x0 ,0x0 ,0x0 ,0x0 ,4 ,FALSE ,0 ,0 ,0 },
{WINED3DFMT_A16B16G16R16F,0x0 ,0x0 ,0x0 ,0x0 ,8 ,FALSE ,GL_RGBA16F_ARB ,GL_RGBA ,GL_HALF_FLOAT_ARB },
/* Palettized formats */
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index 36e9a20..1a589a5 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -477,7 +477,9 @@ #endif
#ifndef GL_ARB_texture_float
#define GL_ARB_texture_float 1
#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
#endif
/* GL_ARB_half_float_pixel */
#ifndef GL_ARB_half_float_pixel
--
1.4.1
More information about the wine-patches
mailing list