Roderick Colenbrander : wined3d: General constant caps fix.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 7 07:13:17 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: bd6f0b23d6f6ad73962ee465a35d00260141ddb6
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=bd6f0b23d6f6ad73962ee465a35d00260141ddb6
Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date: Sun Aug 6 13:53:19 2006 +0200
wined3d: General constant caps fix.
---
dlls/wined3d/directx.c | 23 ++++++++++++++---------
include/wine/wined3d_gl.h | 1 +
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 04cd41d..f8c7ab5 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -85,7 +85,6 @@ static WineD3D_Context* WineD3D_CreateFa
BOOL failed = FALSE;
int num;
XWindowAttributes win_attr;
-
TRACE_(d3d_caps)("Creating Fake GL Context\n");
ctx.drawable = (Drawable) GetPropA(GetDesktopWindow(), "__wine_x11_whole_window");
@@ -290,7 +289,7 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *i
const char *gl_string = NULL;
const char *gl_string_cursor = NULL;
GLint gl_max;
- GLfloat gl_float;
+ GLfloat gl_floatv[2];
Bool test = 0;
int major, minor;
WineD3D_Context *fake_ctx = NULL;
@@ -545,9 +544,9 @@ #undef USE_GL_FUNC
gl_info->max_texture_size = gl_max;
TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max);
- glGetFloatv(GL_POINT_SIZE_RANGE, &gl_float);
- gl_info->max_pointsize = gl_float;
- TRACE_(d3d_caps)("Maximum point size support - max texture size=%f\n", gl_float);
+ glGetFloatv(GL_POINT_SIZE_RANGE, gl_floatv);
+ gl_info->max_pointsize = gl_floatv[1];
+ TRACE_(d3d_caps)("Maximum point size support - max point size=%f\n", gl_floatv[1]);
/* Parse the gl supported features, in theory enabling parts of our code appropriately */
GL_Extensions = (const char *) glGetString(GL_EXTENSIONS);
@@ -683,6 +682,9 @@ #undef USE_GL_FUNC
} else if (strcmp(ThisExtn, "GL_EXT_texture3D") == 0) {
TRACE_(d3d_caps)(" FOUND: EXT_texture3D support\n");
gl_info->supported[EXT_TEXTURE3D] = TRUE;
+ glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max);
+ TRACE_(d3d_caps)("Max texture3D size: %d\n", gl_max);
+ gl_info->max_texture3d_size = gl_max;
} 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;
@@ -1866,10 +1868,13 @@ #endif
*pCaps->MaxTextureWidth = GL_LIMITS(texture_size);
*pCaps->MaxTextureHeight = GL_LIMITS(texture_size);
- *pCaps->MaxVolumeExtent = 0;
+ if(GL_SUPPORT(EXT_TEXTURE3D))
+ *pCaps->MaxVolumeExtent = GL_LIMITS(texture3d_size);
+ else
+ *pCaps->MaxVolumeExtent = 0;
*pCaps->MaxTextureRepeat = 32768;
- *pCaps->MaxTextureAspectRatio = 32768;
+ *pCaps->MaxTextureAspectRatio = GL_LIMITS(texture_size);
*pCaps->MaxVertexW = 1.0;
*pCaps->GuardBandLeft = 0;
@@ -1961,8 +1966,8 @@ #endif
/* FIXME: Add
D3DVTXPCAPS_TWEENING */
- *pCaps->MaxPrimitiveCount = 0xFFFFFFFF;
- *pCaps->MaxVertexIndex = 0xFFFFFFFF;
+ *pCaps->MaxPrimitiveCount = 0xFFFFF; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */
+ *pCaps->MaxVertexIndex = 0xFFFFF;
*pCaps->MaxStreams = MAX_STREAMS;
*pCaps->MaxStreamStride = 1024;
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index 923ca4a..5af463e 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -1703,6 +1703,7 @@ typedef struct _WineD3D_GL_Info {
UINT max_sampler_stages;
UINT max_clipplanes;
UINT max_texture_size;
+ UINT max_texture3d_size;
float max_pointsize;
UINT max_blends;
UINT max_anisotropy;
More information about the wine-cvs
mailing list