Bug 94459

Summary: FLT_TO_INT rounding issues on pre R800 cards
Product: Mesa Reporter: Patrick Rudolph <siro>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: minor    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch r600_shader.c to insert a ALU_OP1_RNDNE instruction on pre r8xx cards for TGSI_OPCODE_ARR

Description Patrick Rudolph 2016-03-09 09:23:36 UTC
Running WINE tests with Gallium Nine enabled I found the following test to fail on pre R800 cards.
The failing test is from wine d3d9/tests/visual.c test_mova().
It can be found here: https://source.winehq.org/ident?_i=test_mova&_remember=1

To issue doesn't exists on radeonsi, softpipe and R800+.

The problem seems to be TGSI_OPCODE_ARR that should round on FLT_TO_INT, but pre R800 cards truncate instead.
This might result in wrong addressing, as TGSI_OPCODE_ARR is expected to round.
If the card doesn't support rounding on FLT_TO_INT, r600 driver should insert a rounding instruction.

Tested with latest mesa git on RV770.
Comment 1 Patrick Rudolph 2016-03-09 11:33:49 UTC
Created attachment 122172 [details] [review]
patch r600_shader.c to insert a ALU_OP1_RNDNE instruction on pre r8xx cards for TGSI_OPCODE_ARR
Comment 2 Roland Scheidegger 2016-03-09 13:49:46 UTC
The code in question isn't used by anything non-r600/r700, thus a switch isn't warranted.
(I think it would look nicer if the arl/arr cases were merged and use a conditional to select the rounding instruction too.)
Comment 3 GitLab Migration User 2019-09-18 19:21:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/579.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.