Bug 109738 - Child of Light shows only a black screen
Summary: Child of Light shows only a black screen
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/Iris (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Kenneth Graunke
QA Contact: Intel 3D Bugs Mailing List
Depends on:
Reported: 2019-02-22 04:03 UTC by leozinho29_eu
Modified: 2019-02-25 09:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Apitrace and Steam Play log (131.80 MB, application/x-xz)
2019-02-22 04:03 UTC, leozinho29_eu

Description leozinho29_eu 2019-02-22 04:03:42 UTC
Created attachment 143437 [details]
Apitrace and Steam Play log

In the game Child of Light, played on Steam using Steam Play, it was noticed the screen is entirely black. The sound effects and the game work correctly, but the screen is entirely black, being impossible to see the game. Using i965 the game shows its graphics. The Steam logs have relevant messages as:

449855.540:009a:00a4:err:d3d:wined3d_debug_callback 0x22fee20: "GL_INVALID_FRAMEBUFFER_OPERATION in glDrawArrays(incomplete framebuffer)".
449855.540:009a:00a4:fixme:d3d:context_check_fbo_status FBO status GL_FRAMEBUFFER_UNSUPPORTED (0x8cdd).
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_DEPTH_ATTACHMENT: 2d texture 19, 1280x720, 0 samples, format 0x88f0.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_STENCIL_ATTACHMENT: 2d texture 19, 1280x720, 0 samples, format 0x88f0.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT0: 2d texture 11, 1280x720, 0 samples, format 0x8c41.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT1: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT2: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT3: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT4: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT5: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT6: NONE.
449855.540:009a:00a4:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT7: NONE.

I recorded an Apitrace and its replay is very strange: using default settings, the replay is perfect, even if the screen is black in-game. If MESA_LOADER_DRIVER_OVERRIDE=iris is set for apitrace replay, then the replay screen is entirely black too.

The apitrace and Steam log are attached.

System specifications:

Processor: Intel Core i3-6100U;
Video: Intel HD Graphics 520;
Architecture: amd64;
RAM memory: 8 GB;
Mesa: 19.1.0-devel (git-b21de090d6);
Kernel version: 4.18.0-15-lowlatency;
Distribution: Xubuntu 18.04.1 amd64.
Comment 1 Kenneth Graunke 2019-02-22 09:26:43 UTC
Hi there,

Thanks for the bug report!  You found a pretty glaring bug - I was telling the state tracker that we couldn't render to RGBX format FBOs, even though we totally can.  Wrote a simple fix, but that uncovered another bug in my RGBX blend handling.  Figured that one out as well, but need another round of testing.

This branch ought to fix it:

Assuming testing comes back green, I'll send it out for review and possibly land the fixes tomorrow.

By the way, I noticed that the trace is hitting a whole ton of stalls, which will probably lead to poor performance.  This is a known issue and I've got fixes in the works for that, but unfortunately those are not on the tomorrow timeframe. :)

Comment 2 leozinho29_eu 2019-02-22 15:10:45 UTC
I tested that Mesa branch and it worked, the graphics appeared normally and the logs do not have that error messages anymore. Now it has just this fixme:

455479.405:0099:009a:fixme:d3d:wined3d_texture_add_dirty_region Ignoring dirty_region (0, 0, 0)-(1280, 720, 1).
455479.405:0099:009a:fixme:d3d:wined3d_texture_add_dirty_region Ignoring dirty_region (0, 0, 0)-(640, 360, 1).
455479.405:0099:009a:fixme:d3d:wined3d_texture_add_dirty_region Ignoring dirty_region (0, 0, 0)-(640, 360, 1).
455479.428:0099:009a:fixme:d3d:wined3d_texture_add_dirty_region Ignoring dirty_region (0, 0, 0)-(1280, 720, 1).

I tested both with the game and the apitrace, both worked.
Comment 3 Kenneth Graunke 2019-02-25 09:40:23 UTC
Should be fixed by:

commit b45186a6cd0ed7539e427d4443671faef9f95058
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Feb 21 23:37:58 2019 -0800

    iris: Properly allow rendering to RGBX formats.
    I was converting them at pipe_surface creation time, but not when
    answering queries about whether formats support rendering.  This caused
    a lot of FBO incomplete errors for formats that ought to be supported.
    Fixes "Child of Light", which uses PIPE_FORMAT_R8G8B8X8_UNORM_SRGB.
    Also fixes Witcher 1 using wined3d (GL) according to Timur Kristóf.
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109738

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.