<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - [apitrace] Graphical artifacts in Civilization VI on RX Vega"
href="https://bugs.freedesktop.org/show_bug.cgi?id=104602#c17">Comment # 17</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - [apitrace] Graphical artifacts in Civilization VI on RX Vega"
href="https://bugs.freedesktop.org/show_bug.cgi?id=104602">bug 104602</a>
from <span class="vcard"><a class="email" href="mailto:t_arceri@yahoo.com.au" title="Timothy Arceri <t_arceri@yahoo.com.au>"> <span class="fn">Timothy Arceri</span></a>
</span></b>
<pre>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 shaders 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 = vec2(0.031250, 0.500000);
x0[1].xy = vec2(0.968750, 0.031250);
x0[2].xy = vec2(0.968750, 0.968750);
x1[0].xy = vec2(1.000000, 1.000000);
x1[1].xy = vec2(0.000000, 1.000000);
x1[2].xy = vec2(-1.000000, 0.000000);
x1[3].xy = vec2(-1.000000, -1.000000);
x1[4].xy = vec2(0.000000, -1.000000);
x1[5].xy = vec2(1.000000, 0.000000);
x2[0].xy = vec2(1.000000, -1.000000);
x2[1].xy = vec2(2.000000, 1.000000);
x2[2].xy = vec2(1.000000, 2.000000);
x2[3].xy = vec2(-1.000000, 1.000000);
x2[4].xy = vec2(-2.000000, -1.000000);
x2[5].xy = 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>