wined3d: Volume textures fix.

This commit is contained in:
Roderick Colenbrander 2006-08-05 00:11:17 +02:00 committed by Alexandre Julliard
parent 6ded5542b2
commit 3d9e96f3bc
3 changed files with 46 additions and 17 deletions

View File

@ -680,6 +680,9 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
} else if (strcmp(ThisExtn, "GL_EXT_stencil_wrap") == 0) {
TRACE_(d3d_caps)(" FOUND: EXT Stencil wrap support\n");
gl_info->supported[EXT_STENCIL_WRAP] = TRUE;
} else if (strcmp(ThisExtn, "GL_EXT_texture3D") == 0) {
TRACE_(d3d_caps)(" FOUND: EXT_texture3D support\n");
gl_info->supported[EXT_TEXTURE3D] = TRUE;
} else if (strcmp(ThisExtn, "GL_EXT_texture_compression_s3tc") == 0) {
TRACE_(d3d_caps)(" FOUND: EXT Texture S3TC compression support\n");
gl_info->supported[EXT_TEXTURE_COMPRESSION_S3TC] = TRUE;
@ -1803,13 +1806,17 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
*pCaps->TextureCaps = WINED3DPTEXTURECAPS_ALPHA |
WINED3DPTEXTURECAPS_ALPHAPALETTE |
WINED3DPTEXTURECAPS_BORDER |
WINED3DPTEXTURECAPS_VOLUMEMAP |
WINED3DPTEXTURECAPS_MIPMAP |
WINED3DPTEXTURECAPS_PROJECTED |
WINED3DPTEXTURECAPS_PERSPECTIVE |
WINED3DPTEXTURECAPS_VOLUMEMAP_POW2 |
WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL;
if( GL_SUPPORT(EXT_TEXTURE3D)) {
*pCaps->TextureCaps |= WINED3DPTEXTURECAPS_VOLUMEMAP |
WINED3DPTEXTURECAPS_MIPVOLUMEMAP |
WINED3DPTEXTURECAPS_VOLUMEMAP_POW2;
}
if (GL_SUPPORT(ARB_TEXTURE_CUBE_MAP)) {
*pCaps->TextureCaps |= WINED3DPTEXTURECAPS_CUBEMAP |
WINED3DPTEXTURECAPS_MIPCUBEMAP |

View File

@ -24,7 +24,7 @@
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->wineD3DDevice)->wineD3D))->gl_info
#define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info
/* *******************************************
IWineD3DVolume IUnknown parts follow
@ -285,18 +285,19 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, GLen
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
const PixelFormatDesc *formatEntry = getFormatDescEntry(This->resource.format);
TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n",
GL_TEXTURE_3D,
gl_level,
formatEntry->glInternal,
This->currentDesc.Width,
This->currentDesc.Height,
This->currentDesc.Depth,
0,
formatEntry->glFormat,
formatEntry->glType,
This->resource.allocatedMemory);
glTexImage3D(GL_TEXTURE_3D,
if(GL_SUPPORT(EXT_TEXTURE3D)) {
TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n",
GL_TEXTURE_3D,
gl_level,
formatEntry->glInternal,
This->currentDesc.Width,
This->currentDesc.Height,
This->currentDesc.Depth,
0,
formatEntry->glFormat,
formatEntry->glType,
This->resource.allocatedMemory);
GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D,
gl_level,
formatEntry->glInternal,
This->currentDesc.Width,
@ -305,8 +306,11 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, GLen
0,
formatEntry->glFormat,
formatEntry->glType,
This->resource.allocatedMemory);
checkGLcall("glTexImage3D");
This->resource.allocatedMemory));
checkGLcall("glTexImage3D");
} else
WARN("This OpenGL implementation doesn't support 3D textures\n");
return WINED3D_OK;
}

View File

@ -350,6 +350,20 @@ typedef void (APIENTRY * PGLFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum intern
#endif
typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
/* GL_EXT_texture3D */
#ifndef GL_EXT_texture3D
#define GL_PACK_SKIP_IMAGES_EXT 0x806B
#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
#define GL_TEXTURE_3D_EXT 0x806F
#define GL_PROXY_TEXTURE_3D_EXT 0x8070
#define GL_TEXTURE_DEPTH_EXT 0x8071
#define GL_TEXTURE_WRAP_R_EXT 0x8072
#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
#endif
typedef void (APIENTRY * PGLFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRY * PGLFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
/* GL_EXT_texture_env_combine */
#ifndef GL_EXT_texture_env_combine
#define GL_EXT_texture_env_combine 1
@ -1373,6 +1387,7 @@ typedef enum _GL_SupportedExt {
EXT_SECONDARY_COLOR,
EXT_STENCIL_TWO_SIDE,
EXT_STENCIL_WRAP,
EXT_TEXTURE3D,
EXT_TEXTURE_COMPRESSION_S3TC,
EXT_TEXTURE_FILTER_ANISOTROPIC,
EXT_TEXTURE_LOD,
@ -1482,6 +1497,9 @@ typedef enum _GL_SupportedExt {
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FEXTPROC, glSecondaryColor3fEXT); \
USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FVEXTPROC, glSecondaryColor3fvEXT); \
USE_GL_FUNC(PGLFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); \
/* GL_EXT_texture3D */ \
USE_GL_FUNC(PGLFNGLTEXIMAGE3DEXTPROC, glTexImage3DEXT); \
USE_GL_FUNC(PGLFNGLTEXSUBIMAGE3DEXTPROC, glTexSubImage3DEXT); \
/* GL_ARB_vertex_program */ \
USE_GL_FUNC(PGLFNGENPROGRAMSARBPROC, glGenProgramsARB); \
USE_GL_FUNC(PGLFNBINDPROGRAMARBPROC, glBindProgramARB); \