Bug 107428

Summary: Flickering artifacts in OpenRA with Vega 56
Product: Mesa Reporter: Isaac Curtis <isaaccurtis1>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED NOTOURBUG QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Capture of artifacts during menu screen.
video of artifacts

Description Isaac Curtis 2018-07-30 16:34:03 UTC
Created attachment 140898 [details]
Capture of artifacts during menu screen.

System is Arch Linux running kernel 4.17.10 with Mesa 18.1.4.

glinfo line:
GL_VERSION: 3.1 Mesa 18.1.4
GL_RENDERER: Radeon RX Vega (VEGA10, DRM 3.25.0, 4.17.10-1-zen, LLVM 6.0.1)
GL_VENDOR: X.Org
GL_SHADING_LANGUAGE_VERSION = 1.40
GLU_VERSION: 1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
GLUT_API_VERSION: 4
GLUT_XLIB_IMPLEMENTATION: 13

When opening the game a large number of blocky artifacts appear making fonts unintelligible and the game unplayable. The artifacts are not static and move around, much like static. 

OpenRA is an open source game engine. This is a new bug that has been isolated to a particular commit: https://github.com/OpenRA/OpenRA/commit/bfcbe8c0043bfadd1b38c4987f133e29aa54275c

However, this is the only GPU that currently displays this bug that has been found.
Comment 1 Michel Dänzer 2018-07-30 16:42:59 UTC
Mesa seems more likely than the kernel for this.
Comment 2 Isaac Curtis 2018-07-30 16:56:57 UTC
A second machine works just fine without the artifacts. Same kernel, same Mesa version.

Glinfo:
GL_VERSION: 3.0 Mesa 18.1.4
GL_RENDERER: Mesa DRI Intel(R) Haswell Mobile 
GL_VENDOR: Intel Open Source Technology Center
GL_SHADING_LANGUAGE_VERSION = 1.30
GLU_VERSION: 1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
GLUT_API_VERSION: 4
GLUT_XLIB_IMPLEMENTATION: 13
Comment 3 Isaac Curtis 2018-07-30 16:58:24 UTC
Created attachment 140900 [details]
video of artifacts

I captured a small video to show the nature of the artifacts.
Comment 4 Isaac Curtis 2018-09-24 17:36:33 UTC
The bug has been identified. It can be seen on Lines 40-53 of https://github.com/OpenRA/OpenRA/blob/bfcbe8c0043bfadd1b38c4987f133e29aa54275c/glsl/shp.frag

Basically, it was a floating point comparison bug. It checked for samplerIndex a float that takes int values, against 1.0, 2.0, etc. However, sometimes 1 is less than 1 due to floating point issues. Changing samplerIndex < 1.0 to samplerIndex < 0.5 fixes the issue.

It turns out that AMDGPU drivers seem to be the only implementation that experience this particular issue. 

This case is resolved. I don't see anything to fix in the drivers here.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.