From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 108321] rv610: corrupt shader output with SB if_conversion optimization pass Date: Thu, 11 Oct 2018 01:57:19 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0500808594==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C62B89BFB for ; Thu, 11 Oct 2018 01:57:19 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0500808594== Content-Type: multipart/alternative; boundary="15392230380.8fe16.5459" Content-Transfer-Encoding: 7bit --15392230380.8fe16.5459 Date: Thu, 11 Oct 2018 01:57:18 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D108321 Bug ID: 108321 Summary: rv610: corrupt shader output with SB if_conversion optimization pass Product: Mesa Version: git Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 Assignee: dri-devel@lists.freedesktop.org Reporter: nicholasbishop@gmail.com QA Contact: dri-devel@lists.freedesktop.org Created attachment 141984 --> https://bugs.freedesktop.org/attachment.cgi?id=3D141984&action=3Dedit rv610 sbdump I'm debugging some graphics corruption in Chromium on an iMac7,1 with rv610 graphics. Basically an area of the application has randomish blocks of colo= r, like it's reading from an uninitialized texture. I've narrowed the problem down to a fragment shader: varying mediump vec2 _uv_texCoord; uniform lowp sampler2D _ulut_texture; uniform mediump float _ulut_size; mediump vec4 _uLUT(in lowp sampler2D _usampler, in mediump vec3 _upos, = in mediump float _usize){ (_upos *=3D (_usize - 1.0)); mediump float _ulayer =3D min(floor(_upos.z), (_usize - 2.0)); (_upos.xy =3D ((_upos.xy + vec2(0.51234001, 0.51234001)) / _usize)); (_upos.y =3D ((_upos.y + _ulayer) / _usize)); return mix(texture2D(_usampler, _upos.xy), texture2D(_usampler, (_upo= s.xy + vec2(0, (1.0 / _usize)))), (_upos.z - _ulayer)); } void main(){ mediump vec2 _utexCoord =3D _uv_texCoord; mediump vec4 _utexColor =3D texture2D(_us_texture, _utexCoord); if ((_utexColor.w > 0.0)) { (_utexColor.xyz /=3D _utexColor.w); } (_utexColor.xyz =3D _uLUT(_ulut_texture, _utexColor.xyz, _ulut_size).= xyz); (_utexColor.xyz *=3D _utexColor.w); (gl_FragColor =3D vec4(_utexColor.xyz, 1.0)); } (Note that in the original shader "0.51234001" is just "0.5", I just change= d it to make grepping easier.) I played around with changes to the _uLUT functio= n, and I found that any mixing of the two samples seems to trigger the bug, e.= g. I can mix with a constant 0.5 and the bug still happens. I also tried replaci= ng "mix" with an explicit a*(x-1)+b*x; no change. I found that disabling SB fixed the issue, and in particular just commenting out the "if_conversion" SB pass fixes the issue. I've attached the full sbdump output. Please let me know if there are more details I can provide that would help. --=20 You are receiving this mail because: You are the assignee for the bug.= --15392230380.8fe16.5459 Date: Thu, 11 Oct 2018 01:57:18 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 108321
Summary rv610: corrupt shader output with SB if_conversion optimizati= on pass
Product Mesa
Version git
Hardware x86-64 (AMD64)
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component Drivers/Gallium/r600
Assignee dri-devel@lists.freedesktop.org
Reporter nicholasbishop@gmail.com
QA Contact dri-devel@lists.freedesktop.org

Created attachment 141984 =
[details]
rv610 sbdump

I'm debugging some graphics corruption in Chromium on an iMac7,1 with rv610
graphics. Basically an area of the application has randomish blocks of colo=
r,
like it's reading from an uninitialized texture.

I've narrowed the problem down to a fragment shader:

    varying mediump vec2 _uv_texCoord;
    uniform lowp sampler2D _ulut_texture;
    uniform mediump float _ulut_size;

    mediump vec4 _uLUT(in lowp sampler2D _usampler, in mediump vec3 _upos, =
in
mediump float _usize){
      (_upos *=3D (_usize - 1.0));
      mediump float _ulayer =3D min(floor(_upos.z), (_usize - 2.0));
      (_upos.xy =3D ((_upos.xy + vec2(0.51234001, 0.51234001)) / _usize));
      (_upos.y =3D ((_upos.y + _ulayer) / _usize));
      return mix(texture2D(_usampler, _upos.xy), texture2D(_usampler, (_upo=
s.xy
+ vec2(0, (1.0 / _usize)))), (_upos.z - _ulayer));
    }

    void main(){
      mediump vec2 _utexCoord =3D _uv_texCoord;
      mediump vec4 _utexColor =3D texture2D(_us_texture, _utexCoord);
      if ((_utexColor.w > 0.0))
      {
        (_utexColor.xyz /=3D _utexColor.w);
      }
      (_utexColor.xyz =3D _uLUT(_ulut_texture, _utexColor.xyz, _ulut_size).=
xyz);
      (_utexColor.xyz *=3D _utexColor.w);
      (gl_FragColor =3D vec4(_utexColor.xyz, 1.0));
    }

(Note that in the original shader "0.51234001" is just "0.5&=
quot;, I just changed it
to make grepping easier.) I played around with changes to the _uLUT functio=
n,
and I found that any mixing of the two samples seems to trigger the bug, e.=
g. I
can mix with a constant 0.5 and the bug still happens. I also tried replaci=
ng
"mix" with an explicit a*(x-1)+b*x; no change.

I found that disabling SB fixed the issue, and in particular just commenting
out the "if_conversion" SB pass fixes the issue.

I've attached the full sbdump output. Please let me know if there are more
details I can provide that would help.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15392230380.8fe16.5459-- --===============0500808594== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0500808594==--