From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 90887] New: PhiMovesPass in register allocator broken Date: Sun, 07 Jun 2015 19:32:04 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1978632865==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1978632865== Content-Type: multipart/alternative; boundary="1433705524.B08F40.26739"; charset="UTF-8" --1433705524.B08F40.26739 Date: Sun, 7 Jun 2015 19:32:04 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=90887 Bug ID: 90887 Summary: PhiMovesPass in register allocator broken Product: Mesa Version: git Hardware: All OS: All Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/nouveau Assignee: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Reporter: j-r-BGeptl67XyCzQB+pC5nmwQ@public.gmane.org QA Contact: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Created attachment 116339 --> https://bugs.freedesktop.org/attachment.cgi?id=116339&action=edit Candidate Fix for nv50 PhiMovesPass The PhiMovesPass depends on strict correspondence between phi argument and incoming flow edge order. Unfortunately it destroys this correspondence itself in the needNewElseBlock case resulting in the wrong (potentially uninitialized) registers being copied. The attached patch fixes problems in the following games on NVA5 (Debian Jessie, wine git): Costume Quest (with FXAA option), Lifeless Planet, and Eidolon. These are not present when using the LLVMPIPE driver. I have analyzed the situation starting with Lifeless Planet (but simplifying the shader until I could handle the problem): the postprocessing shader modifies part of the rendered image with a shader like this 1. sample the vincinity of the current position 2. sample the current position 2. compute something based on all of these pixels 3. if some condition is reached 4. do some more computations (including TEXL) 5. replace current position value sampled above by computed value 6. return current position value or computed value (see if) The PhiMovesPass detects needNewElseBlock conditions and splits the 'else' edge incoming from the if thereby switching the order of incoming edges leading to adding copies from the sampled value to the if branch (discarding the computed values) and copies from the (unitialized) computed values to the new else block corrupting the result for all pixels except the ones where the condition is true (where it produces the originally sampled value). The fix slightly modifies the needNewElseBlock logic to not detach/attach the incoming edge. Costume Quest (with FXAA) and Eidolon look correct with this fix. Lifeless Planet is much better but still somewhat bad, but that may be intended (it looks similarly crappy with LLVMPIPE). The latter may also be a problem with wine). NB: This might be related to bug #90347. The shader code given there looks like it could trigger this case, but I haven't tried it. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. --1433705524.B08F40.26739 Date: Sun, 7 Jun 2015 19:32:04 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Bug ID 90887
Summary PhiMovesPass in register allocator broken
Product Mesa
Version git
Hardware All
OS All
Status NEW
Severity normal
Priority medium
Component Drivers/DRI/nouveau
Assignee nouveau@lists.freedesktop.org
Reporter j-r@online.de
QA Contact nouveau@lists.freedesktop.org

Created attachment 116339 [details]
Candidate Fix for nv50 PhiMovesPass

The PhiMovesPass depends on strict correspondence between phi argument and
incoming flow edge order. Unfortunately it destroys this correspondence itself
in the needNewElseBlock case resulting in the wrong (potentially uninitialized)
registers being copied.

The attached patch fixes problems in the following games on NVA5 (Debian
Jessie, wine git): Costume Quest (with FXAA option), Lifeless Planet, and
Eidolon. These are not present when using the LLVMPIPE driver.

I have analyzed the situation starting with Lifeless Planet (but simplifying
the shader until I could handle the problem): the postprocessing shader
modifies part of the rendered image with a shader like this

 1. sample the vincinity of the current position
 2. sample the current position
 2. compute something based on all of these pixels
 3. if some condition is reached
 4.     do some more computations (including TEXL)
 5.     replace current position value sampled above by computed value
 6. return current position value or computed value (see if)

The PhiMovesPass detects needNewElseBlock conditions and splits the 'else' edge
incoming from the if thereby switching the order of incoming edges leading to
adding copies from the sampled value to the if branch (discarding the computed
values) and copies from the (unitialized) computed values to the new else block
corrupting the result for all pixels except the ones where the condition is
true (where it produces the originally sampled value).

The fix slightly modifies the needNewElseBlock logic to not detach/attach the
incoming edge. Costume Quest (with FXAA) and Eidolon look correct with this
fix. Lifeless Planet is much better but still somewhat bad, but that may be
intended (it looks similarly crappy with LLVMPIPE). The latter may also be a
problem with wine).

NB: This might be related to bug #90347. The shader code given there looks like
it could trigger this case, but I haven't tried it.


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
--1433705524.B08F40.26739-- --===============1978632865== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cDovL2xpc3RzLmZy ZWVkZXNrdG9wLm9yZy9tYWlsbWFuL2xpc3RpbmZvL25vdXZlYXUK --===============1978632865==--