http://bugs.winehq.org/show_bug.cgi?id=12736
Summary: d3d:sampler GL_INVALID_ENUM from glActiveTextureARB @ state.c Product: Wine Version: 0.9.59. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net
fixme:d3d:sampler >>>>>>>>>>>>>>>>> GL_INVALID_ENUM (0x500) from glActiveTextureARB @ state.c / 2485
dlls/wined3d/state.c:sampler contains if (GL_SUPPORT(ARB_MULTITEXTURE)) { if (mapped_stage >= GL_LIMITS(combined_samplers)) { return; } GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage)); checkGLcall("glActiveTextureARB");
The message is caused by an apparently incorrect use of GL_LIMITS(). GL_LIMITS(combined_samplers) seems not to be the correct test.
The spec for glActiveTexture says that the upper bound would be "the larger of (GL_MAX_TEXTURE_COORDS - 1) and (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1)". http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml
I couldn't find the limits for glActiveTextureARB(), except for - a Darwin MacOS X manual page http://developer.apple.com/documentation/Darwin/Reference/Manpages/man3/glAc... - a Python page http://pyopengl.sourceforge.net/documentation/manual/glActiveTextureARB.3G.h... - and XFree86 http://www.xfree86.org/4.2.0/glActiveTextureARB.3.html which all say the upper bound is GL_MAX_TEXTURE_UNITS_ARB.
So it looks like the above wine code performs a check appropriate for glActiveTexture() but not for glActiveTextureARB(). It should have been GL_LIMITS(textures) for GL_MAX_TEXTURE_UNITS_ARB, cf. include/wine/wined3d_gl.h:WineD3D_GL_Info and dlls/wined3d/directx.c:FillGLCaps
As a result of the incorrect check, the sampler() continues processing, instead of returning early.
I'm using a laptop with the i810 Xorg driver.