dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 70327] New: Casting floating point variable to integer not working properly while constant gets converted properly
Date: Wed, 09 Oct 2013 21:17:52 +0000	[thread overview]
Message-ID: <bug-70327-502@http.bugs.freedesktop.org/> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1495 bytes --]

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

          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
  --> 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.

[-- Attachment #1.2: Type: text/html, Size: 3049 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2013-10-09 21:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 21:17 bugzilla-daemon [this message]
2013-10-09 21:22 ` [Bug 70327] Casting floating point variable to integer not working properly while constant gets converted properly bugzilla-daemon
2013-10-09 21:24 ` bugzilla-daemon
2013-10-09 21:24 ` bugzilla-daemon
2013-10-09 21:30 ` bugzilla-daemon
2013-10-09 21:36 ` bugzilla-daemon
2013-10-09 21:43 ` bugzilla-daemon
2013-10-09 21:51 ` bugzilla-daemon
2013-10-09 22:16 ` bugzilla-daemon
2013-10-09 22:18 ` bugzilla-daemon
2013-10-10  1:15 ` bugzilla-daemon
2013-10-10  8:55 ` bugzilla-daemon
2013-10-14  6:45 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-70327-502@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).