Roland Scheidegger wrote:
(since the original email never made it to the list, a new one - it's not a resend though)
texrect is broken here (and I've no idea why it works for other people ;-)).
There are 2 problems in the driver which cause this:
First, if glGenTextures is called, there is no texture target yet. This will cause the r200 driver (in r200AllocTexObj) to initialize the texture min filter to GL_NEAREST_MIPMAP_LINEAR. The problem is when the texture object is now bound to a RECTANGLE_NV target, the min filter will not change, causing havoc (the also illegal clamp mode doesn't seem to hurt much).
Second problem is the r200TexParameter, it will only do anything for 1D and 2D targets - thus, even if an application explicitly sets a different texture filter, the hardware will still try to use mipmapping for rectangle targets. Removing the target condition will fix this (why is it there? Mesa already should have checked illegal combinations, or are there some OGL compliant target/param combinations which are not supported in hardware?)
Both problems are also present in the radeon driver, but texrect seems to work there nonetheless...
attached a quick patch (only for r200, and I doubt it will attach cleanly, but I guess it's too ugly anyway).
@@ -888,9 +1070,9 @@ _mesa_lookup_enum_by_nr( pname ) ); }
- if ( ( target != GL_TEXTURE_2D ) && +/* if ( ( target != GL_TEXTURE_2D ) && ( target != GL_TEXTURE_1D ) ) - return; + return;*/
Wouldn't this change be enough on its own? This test is broken & has probably been causing subtle problems for ages.
Keith
Unfortunately it's not. Mesa will initialize the correct default wrap and filter mode when glBindTexture is called with the rectangle_nv target and the texture object already exists (that is, glGenTextures has been called previously). It's really a pity that textures with rectangle_nv targets have different default wrap/filter modes, but there is no guarantee that the correct filter mode will be set later - the default value needs to be correct. That said, it would be sufficient to only call r200SetTexWrap and r200SetTexFilter in r200BindTexture, not the other two functions, and it would only be needed if the target is rectangle_nv (and only if the target wasn't known when the object was created, but the driver doesn't know this at this point).
Roland
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel