Commit 18af8d86 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- Disable some 'classic' debug traces (avoid useless flood of traces

while debugging games). - Fix the texture size caps using GL_MAX_TEXTURE_SIZE.
parent 3270641c
......@@ -100,7 +100,7 @@ void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8
}
D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
TRACE("(%p) : returning %d\n", This, This->ResourceType);
/*TRACE("(%p) : returning %d\n", This, This->ResourceType);*/
return This->ResourceType;
}
......
......@@ -142,6 +142,15 @@ void CreateStateBlock(LPDIRECT3DDEVICE8 iface);
TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
} \
}
#define vcheckGLcall(A) \
{ \
GLint err = glGetError(); \
if (err != GL_NO_ERROR) { \
FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
} else { \
VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
} \
}
#define checkGLSupport(ExtName) FALSE/*(TRUE == This->direct3d8->glInfo.supported[ExtName])*/
#define GLExtCall(FuncName) /*(This->direct3d8->glInfo.FuncName)*/
......
......@@ -3278,17 +3278,16 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
}
/* Make appropriate texture active */
TRACE("Activating appropriate texture state %ld\n", Stage);
VTRACE(("Activating appropriate texture state %ld\n", Stage));
if (This->isMultiTexture) {
#if defined(GL_VERSION_1_3)
glActiveTexture(GL_TEXTURE0 + Stage);
checkGLcall("glActiveTexture");
vcheckGLcall("glActiveTexture");
#else
glActiveTextureARB(GL_TEXTURE0_ARB + Stage);
checkGLcall("glActiveTextureARB");
vcheckGLcall("glActiveTextureARB");
#endif
} else if (Stage>0) {
} else if (Stage > 0) {
FIXME("Program using multiple concurrent textures which this opengl implementation doesnt support\n");
}
......@@ -3424,15 +3423,15 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
if (isAlphaArg) {
TRACE("Source %x = %x, Operand %x = %x\n", SOURCEx_ALPHA_EXT(Type), source, OPERANDx_ALPHA_EXT(Type), operand);
glTexEnvi(GL_TEXTURE_ENV, SOURCEx_ALPHA_EXT(Type), source);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, SOURCEx_ALPHA_EXT, source);");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, SOURCEx_ALPHA_EXT, source);");
glTexEnvi(GL_TEXTURE_ENV, OPERANDx_ALPHA_EXT(Type), operand);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, OPERANDx_ALPHA_EXT, operand);");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, OPERANDx_ALPHA_EXT, operand);");
} else {
TRACE("Source %x = %x, Operand %x = %x\n", SOURCEx_RGB_EXT(Type), source, OPERANDx_RGB_EXT(Type), operand);
glTexEnvi(GL_TEXTURE_ENV, SOURCEx_RGB_EXT(Type), source);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, SOURCEx_RGB_EXT, source);");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, SOURCEx_RGB_EXT, source);");
glTexEnvi(GL_TEXTURE_ENV, OPERANDx_RGB_EXT(Type), operand);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, OPERANDx_RGB_EXT, operand);");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, OPERANDx_RGB_EXT, operand);");
}
}
break;
......@@ -3442,9 +3441,9 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
{
int Scale = 1;
int Parm = (Type == D3DTSS_ALPHAOP)? GL_COMBINE_ALPHA_EXT : GL_COMBINE_RGB_EXT;
int Parm = (Type == D3DTSS_ALPHAOP) ? GL_COMBINE_ALPHA_EXT : GL_COMBINE_RGB_EXT;
if (Type==D3DTSS_COLOROP && Value == D3DTOP_DISABLE) {
if (Type == D3DTSS_COLOROP && Value == D3DTOP_DISABLE) {
/* TODO: Disable by making this and all later levels disabled */
glDisable(GL_TEXTURE_1D);
checkGLcall("Disable GL_TEXTURE_1D");
......@@ -3455,7 +3454,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
} else {
/* Enable only the appropriate texture dimension */
if (Type==D3DTSS_COLOROP) {
if (Type == D3DTSS_COLOROP) {
if (This->StateBlock->textureDimensions[Stage] == GL_TEXTURE_1D) {
glEnable(GL_TEXTURE_1D);
checkGLcall("Enable GL_TEXTURE_1D");
......@@ -3504,10 +3503,10 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
/* Correct scale */
if (Type == D3DTSS_ALPHAOP) {
glTexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, Scale);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, Scale)");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, Scale)");
} else {
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, Scale);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, Scale)");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, Scale)");
}
glTexEnvi(GL_TEXTURE_ENV, Parm, GL_MODULATE);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, Parm, GL_MODULATE);");
......@@ -3515,13 +3514,13 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
case D3DTOP_ADD :
glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD)");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD)");
break;
case D3DTOP_ADDSIGNED2X : Scale = Scale * 2; /* Drop through */
case D3DTOP_ADDSIGNED :
glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD_SIGNED_EXT);
checkGLcall("glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD_SIGNED_EXT)");
vcheckGLcall("glTexEnvi(GL_TEXTURE_ENV, Parm, GL_ADD_SIGNED_EXT)");
break;
case D3DTOP_DOTPRODUCT3 :
......
......@@ -335,8 +335,15 @@ HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps (LPDIRECT3D8 iface,
pCaps->LineCaps = D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST;
pCaps->MaxTextureWidth = 16384;
pCaps->MaxTextureHeight = 16384;
/*pCaps->MaxTextureWidth = 16384;
pCaps->MaxTextureHeight = 16384;*/
{
GLint gl_tex_size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_tex_size);
pCaps->MaxTextureWidth = gl_tex_size;
pCaps->MaxTextureHeight = gl_tex_size;
}
pCaps->MaxVolumeExtent = 0;
pCaps->MaxTextureRepeat = 32768;
......@@ -372,7 +379,11 @@ HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps (LPDIRECT3D8 iface,
{
GLint gl_max;
#if defined(GL_VERSION_1_3)
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max);
#else
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max);
#endif
pCaps->MaxTextureBlendStages = min(8, gl_max);
pCaps->MaxSimultaneousTextures = min(8, gl_max);
TRACE("GLCaps: GL_MAX_TEXTURE_UNITS_ARB=%ld\n", pCaps->MaxTextureBlendStages);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment