On Sun, 19 Oct 2003 20:12:59 +0300
Ville Syrjälä <[EMAIL PROTECTED]> wrote:

> On Sun, Oct 19, 2003 at 04:43:21PM +0200, Felix Kühling wrote:
> > Hi,
> > 
> > the attached patch adds a texture color depth option to the r128 and mga
> > drivers. I'm not 100% sure if these cards can handle 32bpt textures on
> > 16bit mode. Could someone test this on the respective hardware please.
> 
> mga can handle it.
> 
> 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?
There is one more thing I don't understand about these functions: Why is
format == GL_BGRA treated specially in the GL_RGBA case?

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

Regards,
  Felix

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.
--- ./mgatex.c.~1.51.~  2003-08-16 12:53:26.000000000 +0200
+++ ./mgatex.c  2003-10-19 23:25:03.000000000 +0200
@@ -193,7 +193,7 @@
    case GL_RGB10_A2:
    case GL_RGBA12:
    case GL_RGBA16:
-      return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
+      return &_mesa_texformat_argb8888;
 
    case GL_RGBA4:
    case GL_RGBA2:
@@ -206,7 +206,7 @@
    case GL_RGB10:
    case GL_RGB12:
    case GL_RGB16:
-      return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
+      return &_mesa_texformat_argb8888;
 
    case GL_RGB5:
    case GL_RGB4:
--- ./mga_xmesa.c.~1.61.~       2003-10-18 22:39:20.000000000 +0200
+++ ./mga_xmesa.c       2003-10-19 16:19:18.000000000 +0200
@@ -67,8 +67,11 @@
     DRI_CONF_SECTION_PERFORMANCE
         DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
     DRI_CONF_SECTION_END
+    DRI_CONF_SECTION_QUALITY
+        DRI_CONF_PREFERRED_BPT(0,"0,16,32")
+    DRI_CONF_SECTION_END
 DRI_CONF_END;
-const GLuint __driNConfigOptions = 1;
+const GLuint __driNConfigOptions = 2;
 
 #ifndef MGA_DEBUG
 int MGA_DEBUG = 0;
@@ -344,6 +347,7 @@
    mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private;
    MGASAREAPrivPtr saPriv=(MGASAREAPrivPtr)(((char*)sPriv->pSAREA)+
                                              mgaScreen->sarea_priv_offset);
+   int preferred_bpt;
 
    if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
       fprintf(stderr, "mgaCreateContext\n");
@@ -428,7 +432,10 @@
    ctx->Const.MaxLineWidthAA = 10.0;
    ctx->Const.LineWidthGranularity = 1.0;
 
-   mmesa->default32BitTextures = (mesaVis->rgbBits >= 24);
+   preferred_bpt = driQueryOptioni (&mmesa->optionCache, "preferred_bpt");
+   mmesa->default32BitTextures =
+       ( ( preferred_bpt == 0 && mesaVis->rgbBits >= 24 ) ||
+        preferred_bpt == 32 );
    mmesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
 
    switch (mesaVis->depthBits) {

Reply via email to