Bug 62756

Summary: Rendering errors on rv790 with llvm and unigine heaven 3.0
Product: Mesa Reporter: Andy Furniss <adf.lists>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: vljn
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: heaven + llvm on rv790 rendering errors.
heaven regressed more with current heads
Proposed patch
native inst support for mesa

Description Andy Furniss 2013-03-26 11:07:00 UTC
Created attachment 77043 [details]
heaven + llvm on rv790 rendering errors.

rv790 with git mesa and svn llvm, testing unigine heaven 3.0 like -

MESA_EXTENSION_OVERRIDE=-GL_ARB_shader_bit_encoding  force_glsl_extensions_warn=true  ./heaven

I haven't tested this for a while - it was OK sometime ago with FDO llvm but now I am getting some rendering errors (scree shot attached) with current mesa git and llvm svn.

I tried finding a working commit going back with mesa, but I get to a point where llvm renders nothing at all with anything using current llvm svn.

R600_LLVM=0 has no problems.
Comment 1 Michel Dänzer 2013-03-26 12:01:24 UTC
(In reply to comment #1)
> I tried finding a working commit going back with mesa, but I get to a point
> where llvm renders nothing at all with anything using current llvm svn.

There have been incompatible changes to the interface between r600g and the LLVM R600 backend, so you'd probably need a matching LLVM snapshot. The Git mirror at http://llvm.org/git/llvm.git might be helpful for this.
Comment 2 Andy Furniss 2013-03-27 11:04:45 UTC
(In reply to comment #1)
> (In reply to comment #1)
> > I tried finding a working commit going back with mesa, but I get to a point
> > where llvm renders nothing at all with anything using current llvm svn.
> 
> There have been incompatible changes to the interface between r600g and the
> LLVM R600 backend, so you'd probably need a matching LLVM snapshot. The Git
> mirror at http://llvm.org/git/llvm.git might be helpful for this.

OK, it is in llvm. Bisecting with mesa on head comes up with -

fd49dac48fee6da580157515dec55ed2f2d8f2b3 is the first bad commit
commit fd49dac48fee6da580157515dec55ed2f2d8f2b3
Author: Vincent Lejeune <vljn@ovi.com>
Date:   Mon Mar 11 18:15:06 2013 +0000

    R600: Fix JUMP handling so that MachineInstr verification can occur
    
    This allows R600 Target to use the newly created -verify-misched llc flag
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176819 91177308-0d34-0410-b5e6-96231b3b80d8
Comment 3 Andy Furniss 2013-04-02 10:09:10 UTC
Created attachment 77308 [details]
heaven regressed more with current heads

The recent changes to llvm and mesa have regressed heaven more.

Still OK with R600_LLVM=0, and other games are not affected.
Comment 4 Michel Dänzer 2013-04-02 17:12:40 UTC
Vincent, are you seeing r600g/LLVM bug reports like this one?
Comment 5 vincent 2013-04-02 20:32:15 UTC
No, I don't receive mail from bugzilla until someone add me manually to the cc list (dont know what to do to fix that though)

I'm aware of the regression with latest HEAD, I'm working on a fix.
r600g still adds CF_ALU on its own which break CF_CLAUSE address natively encoded by llvm.
Comment 6 Andy Furniss 2013-04-02 21:23:10 UTC
(In reply to comment #5)
> No, I don't receive mail from bugzilla until someone add me manually to the
> cc list (dont know what to do to fix that though)

drivers/gallium/r600 bugs get sent to the dri-devel list.
Comment 7 vincent 2013-04-03 16:54:50 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > No, I don't receive mail from bugzilla until someone add me manually to the
> > cc list (dont know what to do to fix that though)
> 
> drivers/gallium/r600 bugs get sent to the dri-devel list.

Ok, I always looked on mesa-dev for bugs, thank for pointing me this.

Does the "big" regression still occur with at least revision r178667 for llvm and commit http://cgit.freedesktop.org/mesa/mesa/commit/?id=159d9340662a70df3dcc9da1681f5b0a8e7650cf for mesa ?
Comment 8 Andy Furniss 2013-04-03 18:47:05 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > No, I don't receive mail from bugzilla until someone add me manually to the
> > > cc list (dont know what to do to fix that though)
> > 
> > drivers/gallium/r600 bugs get sent to the dri-devel list.
> 
> Ok, I always looked on mesa-dev for bugs, thank for pointing me this.
> 
> Does the "big" regression still occur with at least revision r178667 for
> llvm and commit
> http://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=159d9340662a70df3dcc9da1681f5b0a8e7650cf for mesa ?

Yes, it's the same with those.
Comment 9 vincent 2013-04-05 15:23:53 UTC
Created attachment 77490 [details] [review]
Proposed patch

Does this patch solve the big regression ?
Comment 10 Andy Furniss 2013-04-05 18:56:11 UTC
(In reply to comment #9)
> Created attachment 77490 [details] [review] [review]
> Proposed patch
> 
> Does this patch solve the big regression ?

No, it's the same with that.
Comment 11 vincent 2013-04-06 16:15:46 UTC
Created attachment 77534 [details] [review]
native inst support for mesa

Sorry, I didn't notice that mesa didn't translate native instruction for r700.
You'll need this patch, as well as the previous one ; it should fix the big regression. Can you confirm this ?
Comment 12 Andy Furniss 2013-04-06 18:44:56 UTC
(In reply to comment #11)
> Created attachment 77534 [details] [review] [review]
> native inst support for mesa
> 
> Sorry, I didn't notice that mesa didn't translate native instruction for
> r700.
> You'll need this patch, as well as the previous one ; it should fix the big
> regression. Can you confirm this ?

Yes, this fixes the big regression and I also no longer see the original regression.

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.