[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    [Mesa3d-dev] [Bug 3111] texstore_argb888 calls swizzel_ubyte with wrong source format
From:       bugzilla-daemon () freedesktop ! org
Date:       2005-04-27 21:33:22
Message-ID: 20050427213322.3BEA09EA8D () gabe ! freedesktop ! org
[Download RAW message or body]

Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=3111          
     




------- Additional Comments From fxkuehl@gmx.de  2005-04-27 14:33 -------
The problem is that _mesa_swizzle_ubyte_image and compute_component_mapping
sometimes have to deal with 3 different texture formats (in parantheses
restrictions that apply to the swizzle-paths):

A) source format (always bytes, varying numbers of components)
B) base internal format
C) destination hardware format (rgba8888 or argb8888)

But compute_component_mapping only considers two formats: source and destination.

Three cases as to the combinations of formats can be distinguished:

A == B: promotion from a user image in the same format as internalFormat to a
RGBA hardware format. _mesa_swizzle_ubyte_image seems to handle this case correctly.

B == C: promotion from non-RGBA user image to internalFormat RGBA.
_mesa_swizzle_ubyte_image seems to handle this case correctly.

A != B && B != C: Two promotions at once: from user image to a different
non-RGBA internalFormat and then further to a RGBA hardware format.
_mesa_swizzle_ubyte_image and compute_component_mapping can't handle this case
properly because they don't know about B. They could be made to, but that would
increase complexity for a questionable benifit. Instead I propose to fall back
to the general path in this case:

--- ./texstore.c.~1.91.~        2005-02-09 02:44:44.000000000 +0100
+++ ./texstore.c        2005-04-27 22:15:51.000000000 +0200
@@ -1069,6 +1069,8 @@
            srcType == GL_UNSIGNED_BYTE &&
            dstFormat == &_mesa_texformat_rgba8888 &&
            littleEndian &&
+           (srcFormat == baseInternalFormat ||
+            baseInternalFormat == GL_RGBA) &&
            can_swizzle(srcFormat)) {
       GLubyte dstmap[4];

@@ -1242,6 +1244,8 @@
            dstFormat == &_mesa_texformat_argb8888 &&
            srcType == GL_UNSIGNED_BYTE &&
            littleEndian &&
+           (srcFormat == baseInternalFormat ||
+            baseInternalFormat == GL_RGBA) &&
            can_swizzle(srcFormat)) {

       GLubyte dstmap[4];
          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic