[Bug 70327] New: Casting floating point variable to integer not working properly while constant gets converted properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Priority medium
Bug ID 70327
Assignee dri-devel@lists.freedesktop.org
Summary Casting floating point variable to integer not working properly while constant gets converted properly
Severity normal
Classification Unclassified
OS Linux (All)
Reporter tony.wasserka@dolphin-emu.org
Hardware All
Status NEW
Version git
Component Drivers/Gallium/r600
Product Mesa

Created attachment 87353 [details]
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:
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux