https://bugs.freedesktop.org/show_bug.cgi?id=70327

          Priority: medium
            Bug ID: 70327
          Assignee: [email protected]
           Summary: Casting floating point variable to integer not working
                    properly while constant gets converted properly
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: [email protected]
          Hardware: All
            Status: NEW
           Version: git
         Component: Drivers/Gallium/r600
           Product: Mesa

Created attachment 87353
  --> https://bugs.freedesktop.org/attachment.cgi?id=87353&action=edit
Full rendered scene with bug visible

I've recently been working on converting the shaders used by the Dolphin
emulator to use integers instead of floating point numbers (for better
emulation accuracy). This seems to have exposed a bug in the r600g driver
possibly related to float->int casting.

The core of the issue is this GLSL code line:
"iprev.rgb = (iprev.rgb * (int(256.0-fog))) / 256;" (*)

where fog has been initialized before as 
"float fog = clamp(ze - fog_uniform.z, 0.0, 1.0);"

The point is, while "fog" seems to be zero (a "fog==0.0" condition in the code
will return true), the pixel shader result of (*) is different than the one
that I get by substituting "fog" with 0.0. This gets very apparent in the
rendered scene, cf

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to