On Mon, 20 Oct 2003 02:39:00 +0300
Ville Syrjälä <[EMAIL PROTECTED]> wrote:

> On Sun, Oct 19, 2003 at 11:30:08PM +0200, Felix Kühling wrote:
> > On Sun, 19 Oct 2003 20:12:59 +0300
> > Ville Syrjälä <[EMAIL PROTECTED]> wrote:
> > > But I don't really like the fact that the driver forces the texture bpp
> > > even when the app specified a sized internalFormat. This breaks the 
> > > texture quality option in quake3 at least. I think this option should only
> > > affect the non-sized internalFormats and maybe we should add a FORCE_BPT
> > > option in case someone want's to go against the app's wishes?
> > 
> > Ok. But this problem was there before my patch. All I did was change the
> > way mmesa->default32BitTextures is initialized. The ChooseTextureFormat
> > functions of mga, r200 and radeon look very similar. Maybe we can fix
> > them all at the same time. How does the attached patch for mga look?
> 
> Looks fine to me.
> 
> > There is one more thing I don't understand about these functions: Why is
> > format == GL_BGRA treated specially in the GL_RGBA case?
> 
> Because the hardware supports those format/type combinations. Avoids
> software conversion.

Ok. One thing I don't like about it is that it ignores the user
preference in the GL_UNSIGNED_INT_8_8_8_8_REV case. Furthermore it would
be better if the driver always tried to choose a color format that
matches the depths of the color components of the supplied type even if
the order doesn't match. Then it wouldn't loose color information at
least. What about this:

   switch ( internalFormat ) {
   case 4:
   case GL_RGBA:
   case GL_COMPRESSED_RGBA:
      if ( type == GL_UNSIGNED_INT_8_8_8_8 ||
           type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
         return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444;
      }
      else if ( type == GL_UNSIGNED_SHORT_4_4_4_4 ||
                type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
         return &_mesa_texformat_argb4444;
      }
      else if ( type == GL_UNSIGNED_SHORT_5_5_5_1 ||
                type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
         return &_mesa_texformat_argb1555;
      }
      else if ( type == GL_UNSIGNED_INT_10_10_10_2 ||
                type == GL_UNSIGNED_INT_2_10_10_10_REV ) {
         return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb1555;
      }
      return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444;
   ...

If the bit order of the application supplied format matches the hardware
format it still does the right thing (modulo user preference).

> 
> -- 
> Ville Syrjälä
> [EMAIL PROTECTED]
> http://www.sci.fi/~syrjala/
> 

Felix

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to