From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 104602] [apitrace] Graphical artifacts in Civilization VI on RX Vega Date: Thu, 01 Nov 2018 06:39:55 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0656271988==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D5926E410 for ; Thu, 1 Nov 2018 06:39:55 +0000 (UTC) In-Reply-To: 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 --===============0656271988== Content-Type: multipart/alternative; boundary="15410543950.d77BcBDeB.4323" Content-Transfer-Encoding: 7bit --15410543950.d77BcBDeB.4323 Date: Thu, 1 Nov 2018 06:39:55 +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=3D104602 --- Comment #17 from Timothy Arceri --- After talking this over with Marek here is a summary of the problem. LLVM's VGPR indexing code on gfx9+ is broken for immediate arrays. Usually = this is not a problem as GLSL IR in mesa will lower these to Uniforms via lower_const_arrays_to_uniforms(). However this does not work for the shader= s in Civ6 because these arrays are not actually defined as constant arrays for example the original shader looks like this: vec4 x0[3]; vec4 x1[6]; vec4 x2[6]; vec4 x3[6]; x0[0].xy =3D vec2(0.031250, 0.500000); x0[1].xy =3D vec2(0.968750, 0.031250); x0[2].xy =3D vec2(0.968750, 0.968750); x1[0].xy =3D vec2(1.000000, 1.000000); x1[1].xy =3D vec2(0.000000, 1.000000); x1[2].xy =3D vec2(-1.000000, 0.000000); x1[3].xy =3D vec2(-1.000000, -1.000000); x1[4].xy =3D vec2(0.000000, -1.000000); x1[5].xy =3D vec2(1.000000, 0.000000); x2[0].xy =3D vec2(1.000000, -1.000000); x2[1].xy =3D vec2(2.000000, 1.000000); x2[2].xy =3D vec2(1.000000, 2.000000); x2[3].xy =3D vec2(-1.000000, 1.000000); x2[4].xy =3D vec2(-2.000000, -1.000000); x2[5].xy =3D vec2(-1.000000, -2.000000); Without SSA I don't see any way for GLSL IR to easily recognise this as a constant array. Unfortunately by the time LLVM is done it is recognised and= is exposed to the buggy indexing support. --=20 You are receiving this mail because: You are the assignee for the bug.= --15410543950.d77BcBDeB.4323 Date: Thu, 1 Nov 2018 06:39:55 +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

Comme= nt # 17 on bug 10460= 2 from Timothy Arceri
After talking this over with Marek here is a summary of the pr=
oblem.

LLVM's VGPR indexing code on gfx9+ is broken for immediate arrays. Usually =
this
is not a problem as GLSL IR in mesa will lower these to Uniforms via
lower_const_arrays_to_uniforms(). However this does not work for the shader=
s in
Civ6 because these arrays are not actually defined as constant arrays for
example the original shader looks like this:

        vec4 x0[3];
        vec4 x1[6];
        vec4 x2[6];
        vec4 x3[6];

        x0[0].xy =3D vec2(0.031250, 0.500000);
        x0[1].xy =3D vec2(0.968750, 0.031250);
        x0[2].xy =3D vec2(0.968750, 0.968750);
        x1[0].xy =3D vec2(1.000000, 1.000000);
        x1[1].xy =3D vec2(0.000000, 1.000000);
        x1[2].xy =3D vec2(-1.000000, 0.000000);
        x1[3].xy =3D vec2(-1.000000, -1.000000);
        x1[4].xy =3D vec2(0.000000, -1.000000);
        x1[5].xy =3D vec2(1.000000, 0.000000);
        x2[0].xy =3D vec2(1.000000, -1.000000);
        x2[1].xy =3D vec2(2.000000, 1.000000);
        x2[2].xy =3D vec2(1.000000, 2.000000);
        x2[3].xy =3D vec2(-1.000000, 1.000000);
        x2[4].xy =3D vec2(-2.000000, -1.000000);
        x2[5].xy =3D vec2(-1.000000, -2.000000);

Without SSA I don't see any way for GLSL IR to easily recognise this as a
constant array. Unfortunately by the time LLVM is done it is recognised and=
 is
exposed to the buggy indexing support.


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