GL_ATI_fragment_shader and GL_INVALID 0x501, 0x502

Stefan Dösinger stefan at
Tue Apr 8 01:08:13 CDT 2008

Am Dienstag, 8. April 2008 01:37:36 schrieb Milan Kostić:
>  I wish to ask what is that GL_INVALID_VALUE (0x501) and
> GL_INVALID_OPERATION (0x502)??? This 0x501 i can see in many games.
GL_INVALID_OPERATION and _VALUE opengl errors. That they show up doesn't give 
more information beyond "meh, this doesn't work", it depends on the other 
First of all, which mesa version do you have? Please consider updating to 
7.0.x if you have something older.

>  Ok i'm tested wine and his new GL_ATI_fragment_shader support with
> 9250 card nad Mesa/DRI driver. Now env bumpmaping and dot3 tests in
> 3DMark2001 seems to work good, but in car test high ground texture is
> black. 
I tested 3dmark2001, and I am pretty sure that the texture in the high car 
test worked. I have a radeon 9000 card though, and I talked to a Mesa dev who 
said that there are differences between various card revisions.

> In DungeonSiege2 i disabled ps in winecfg, because it has same 
> problem (and more) flickering and black textureon the ground (river
> water not show, but on sea it has...). With Painkiller, nothing helps
> to start game (disabled ps in winecfg not help), only solution is to
> change textured units in driconf from 6 to 5 (this disable
> GL_ATI_fragment_shader in driver).
Can you file bug reports for those issues if they persist with newer mesa 
versions? Please CC me on those reports.

> I check also NFS: Hot Pursuit2, in 

>  fixme:d3d_texture:IWineD3DBaseTextureImpl_ApplyStateChanges
> >>>>>>>>>>>>>>>>> GL_INVALID_VALUE (0x501) from glTexParameteri
> GL_TEXTURE_MAX_ANISOTROPY_EXT ... @ basetexture.c / 488
>  fixme:d3d_shader:shader_arb_generate_vshader HW VertexShader Error at
> position 499: "1046: '.' expected but ';' found"
That's a vertex shader issue. I guess the "problem" here is that with the 
availability of more texture rendering features the game switched into a 
different rendering mode which Wine or Mesa do not like too much.

>  fixme:d3d_shader:gen_ati_shader >>>>>>>>>>>>>>>>>
> GL_INVALID_OPERATION (0x502) from GL_EXTCALL(glEndFragmentShaderATI())
> @ ati_fragment_shader.c / 774
I didn't put checkGLcall statements to each fragment operation during shader 
creation to prevent the code from being even more convoluted, but you can add 
them for testing and see which part exactly fails.

More information about the wine-devel mailing list