http://bugs.winehq.org/show_bug.cgi?id=21515
--- Comment #48 from Stefan Dösinger stefandoesinger@gmx.at 2010-02-10 08:20:09 --- I suspect the problematic part of the ati_dx9 quirk is this one:
if(gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]) { TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing.\n"); gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE; gl_info->supported[WINE_NORMALIZED_TEXRECT] = TRUE; }
The background is that R500 and earlier cards do not support unconditional NP2 textures(GL_ARB_texture_non_power_of_two). However, both fglrx and OSX advertise OpenGL 2.0, which mandates support for this extension. As a result, the driver doesn't complain if they are used and falls back to software rendering. As a result, we disable the ARB_TEXTURE_NON_POWER_OF_TWO support.
There is an equivalent extension for direct3d's *conditional* NP2 support - GL_ARB_texture_rectangle. R500 cards support this just fine, but this extension has a major problem: It uses non-normalized texture coordinates(range 0.0-width and 0.0-height), which makes using them pretty awkward, since D3D's conditional NP2 textures use normalized(range 0.0-1.0) coords.
However, both fglrx and the OSX drivers are nice enough to render the emulated "unconditional" NP2 textures in hardware as long as all conditions that GL_ARB_texture_rectangle exposes are met. Those textures use normalized texcoords, so we can pass the coords to GL 1:1, and the driver can pass them to the card 1:1 as well.
To signal the rest of the code that it can use the APIs from ARB_texture_non_power_of_two, but has to observe the restrictions imposed by ARB_texture_rectangle, we set a faked extension WINE_normalized_texrect.
This whole thing assumes however, that the driver emulates unconditional NP2 textures in HW if possible, rather than falling back to software or not rendering at all. In the R300 glxinfo linked above advertises GL 1.5, and does not advertise ARB_texture_non_power_of_two, so the WINE_normalized_texrect fake extension should never be set.
R600+ cards(the dx10 ones) support unconditional NP2 textures(GL_ARB_texture_non_power_of_two) just fine, so no quirk is needed for them. We can just use whatever the driver advertises.