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=4992          
     
           Summary: glClear vs rendering with 16 bits per channel
           Product: Mesa
           Version: CVS
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: minor
          Priority: P4
         Component: Mesa core
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


When comparing the pixel colours from glClear and normal rendering it was found 
that the same colour differed by one pixel value. This was found to be caused 
by glClear (in s_buffers.c, function clear_rgba_buffer) using the macro 
FLOAT_TO_USHORT which truncates while the normal rendering pipeline (in 
t_vertex_generic.c) uses the macro UNCLAMPED_FLOAT_TO_USHORT which rounds. So 
for a pixel value expected to be 2.52 the glClear calculated 2 and the 
rendering pipeline calculated 3.

This was resolved simply resolved by substituting the latted macro in the 
glClear case. Therefore the lines 135 to 138 were changed to 

         UNCLAMPED_FLOAT_TO_USHORT(clear16[0], ctx->Color.ClearColor[0]);
         UNCLAMPED_FLOAT_TO_USHORT(clear16[1], ctx->Color.ClearColor[1]);
         UNCLAMPED_FLOAT_TO_USHORT(clear16[2], ctx->Color.ClearColor[2]);
         UNCLAMPED_FLOAT_TO_USHORT(clear16[3], ctx->Color.ClearColor[3]);

This resolved the problem for this specific instance.          
     
     
--           
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:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to