Bug 110424 - Rendering artifacts created by long switch statement
Summary: Rendering artifacts created by long switch statement
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
: 93676 (view as bug list)
Depends on:
Reported: 2019-04-14 20:30 UTC by Clive McCarthy
Modified: 2019-09-25 20:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

a complete program that illustrates the issues (9.17 MB, application/octet-stream)
2019-04-16 00:41 UTC, Clive McCarthy

Description Clive McCarthy 2019-04-14 20:30:54 UTC
Mesa 19.1.0-devel (git b46b661) from Oibaf grabs around 1GB of system memory when my application starts. When using Mesa 18.2.8 with the same application and same code, this does not happen.

Hardware: Intel Iris Graphics 655 GT3e (Coffeelake 3x8 GT3)
Linux Mint Kernel 4.15
Comment 1 Clive McCarthy 2019-04-14 21:12:54 UTC
Whoops, looks like 18.2 does it too. Is this just the driver grabbing a chunk of working memory? In a small 4GB system it looks like a lot.

I see no leak in my code but the system memory continues to be chewed up such that swap space is used.
Comment 2 Clive McCarthy 2019-04-16 00:41:14 UTC
Created attachment 143980 [details]
a complete program that illustrates the issues

The attached code and libraries illustrate two issues:

[1] The strange behavior of the memory used -- the program itself has no leak
[2] Nasty artifacts that appear as an image is rendered.

Neither of these issues exist on a similar Linux system with an Nvidia GPU and driver.

I have boiled my code down to a minimum build-able set including my GLSL loader.
Comment 3 Clive McCarthy 2019-05-27 01:55:48 UTC
Thank you for working so hard on this issue. The FBO blitting turns out to be a red herring.

My fragment shader is 'odd' in that is has large switch statement. This has caused the linking time to be rather long as reported in bug #91857
and, to my surprise, it also causes the artifacts I reported here and in bug #93676

I created a sample application that illustrates the problem. I'm afraid it will be troublesome to build but it is possible to reproduce the artifacts in it.

The fragment shader's case statement has a #if ... #endif section that will enable/disable the artifact problem.
Comment 4 Andrii K 2019-08-14 11:19:04 UTC
*** Bug 93676 has been marked as a duplicate of this bug. ***
Comment 5 GitLab Migration User 2019-09-25 20:33:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1806.

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.