[Bug 104602] [apitrace] Graphical artifacts in Civilization VI on RX Vega

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 1 06:39:55 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=104602

--- Comment #17 from Timothy Arceri <t_arceri at yahoo.com.au> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20181101/a97600f0/attachment.html>


More information about the dri-devel mailing list