On Tue, 2009-07-14 at 14:37 -0700, Brian Paul wrote: > The glean exactRGBA test has always failed with Mesa (with sw > rendering at least). The failures come from a sequence of > int->float->int conversions which don't meet the GL spec.
Hmm, I thought it was closer to the truth to say that our int->float and float->int conversions *do* meet the spec, but that the spec is internally inconsistent in that int->float->int is not an identity even when restricted to N bits. > In particular, when glColor4us() or glColor4ui() are used to set the > drawing color, the N-bit integer frame buffer values should match the > upper N bits of the GLushort or GLuint value originally passed in. > > Because of int->float->int conversions it's a little tricky to > maintain the N-bit identity requirement. > The attached patch fixes the exactRGBA failures. I haven't seen any > regressions but some additional eyes should take a look. > > There are two parts: > > 1. Convert float->ubyte with floor(x*255.999) instead of iround(x*255.0) > > 2. Convert uint->float with floor((u >> 16) / 65535.0) instead of > floor(u / 4294967295.0) This effectively converts the GLuint to a > GLushort. This isn't ideal but I think it's "good enough" until we > find otherwise. Unfortunately I don't think hardware will implement int/float conversions in this way, so this change will a) help the software rasterizer, but b) introduce a (further?) divergence between the results of HW and SW transformation and rasterization. Basically I think the problem is with the spec, and glean unfortunately has decided to test a part of the spec that is pretty problematic to implement. Keith ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev