Re: [Mesa3d-dev] r300g color bug with VBO

2010-03-08 Thread Marek Olšák
Yes, this is a known issue. The problem is that GL_RGBA and GL_BGRA map to
PIPE_FORMAT_R8G8B8A8 (RGBA) and PIPE_FORMAT_A8R8G8B8 (ARGB), respectively,
which is wrong. The attached patch fixes it for r300g but breaks other
drivers which depend on Draw (softpipe, llvmpipe). The reason is that Draw
seems to interpret A8R8G8B8 as BGRA, clearly hiding the bug.

The possibilites are:
- implement the same hack in r300g
- fix Draw (I'd prefer this one)

I hope I'll find some time this week to resolve this issue if no one else do
it.

-Marek

On Tue, Mar 9, 2010 at 1:29 AM, Tom t...@riseup.net wrote:

 Hi people,

 With the r300g driver (git ~today) drawing tris with color pointer like so:

 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct vtx_data), blah);

 Seems to invert the RGBA - ABGR.

 This short program shows the bug. It should display a yellow tri, and
 instead on r300g it shows a blue tri.

 http://tom.noflag.org.uk/misc/r300g_color_bug.c

 Not sure if you want user bug reports of this kind yet, but anyway...

 --
 Tom


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 32b9a47..4b48c16 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -183,7 +183,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
   /* this is an odd-ball case */
   assert(type == GL_UNSIGNED_BYTE);
   assert(normalized);
-  return PIPE_FORMAT_A8R8G8B8_UNORM;
+  return PIPE_FORMAT_B8G8R8A8_UNORM;
}
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] r300g color bug with VBO

2010-03-08 Thread Marek Olšák
Also I've fixed GL_RGBA in master so now only GL_BGRA remains unresolved...

On Tue, Mar 9, 2010 at 1:29 AM, Tom t...@riseup.net wrote:

 Hi people,

 With the r300g driver (git ~today) drawing tris with color pointer like so:

 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct vtx_data), blah);

 Seems to invert the RGBA - ABGR.

 This short program shows the bug. It should display a yellow tri, and
 instead on r300g it shows a blue tri.

 http://tom.noflag.org.uk/misc/r300g_color_bug.c

 Not sure if you want user bug reports of this kind yet, but anyway...

 --
 Tom


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev