Bug 95412 - black overlay on The Talos principle
Summary: black overlay on The Talos principle
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-15 21:45 UTC by Grazvydas Ignotas
Modified: 2017-01-18 18:03 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
screenshot (77.07 KB, image/jpeg)
2016-05-15 21:45 UTC, Grazvydas Ignotas
Details

Description Grazvydas Ignotas 2016-05-15 21:45:38 UTC
Created attachment 123762 [details]
screenshot

This started appearing with one of the game's updates (used to be fine before) and doesn't show up on r600g even with the same trace.

Tested on Mesa 11.2.0 and 11.3.0-devel (git-be2b13e)
Hardware: HD Graphics 530 (Skylake GT2)
Trace: https://drive.google.com/file/d/0Bz8fw_SGGDzsQThwMlIzZnE0RlU/view?usp=sharing
Comment 1 Grazvydas Ignotas 2016-05-19 18:01:09 UTC
It tuns out Mesa 10.1.3 (on Ubuntu 14.04) is not affected, so I ran bisect and got:

commit fdd90fcb15c109f3dcbf5e46fa8a1f8284b9c266
Author: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
Date:   Sun Mar 29 16:52:57 2015 +0200

    i965: Implement support for ARB_clip_control.
Comment 2 Grazvydas Ignotas 2016-05-20 00:01:34 UTC
The game calls glClipControl(origin = GL_LOWER_LEFT, depth = GL_ZERO_TO_ONE)

Then gen6_clip_state.c sets the GEN6_CLIP_API_D3D bit, and that seems to cause the issue. I wonder if that bit actually means GL_ZERO_TO_ONE, the documentation isn't very clear, and only SNB doc lists the description for '1' value, newer ones don't.
Comment 3 Matt Turner 2016-11-02 05:58:25 UTC
Thanks for the nice report and apitrace!

I can confirm that the trace shows black overlays like in the screenshot on HSW, and if I invert the condition

from == GL_ZERO_TO_ONE to != GL_ZERO_TO_ONE, like so

   if (ctx->Transform.ClipDepthMode != GL_ZERO_TO_ONE)
      dw2 |= GEN6_CLIP_API_D3D;
   else
      dw2 |= GEN6_CLIP_API_OGL;

it renders in a way that I suspect is correct (though I don't see anything where the black overlay was?).

The ARB_clip_control spec is pretty clear that 

>    This extension can be used to render content used in a Direct3D
>    application in OpenGL in a straightforward way without modifying vertex or
>    matrix data.  When rendering into a window, the command
>
>        glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);

so GL_ZERO_TO_ONE corresponds with D3D.

Can you still reproduce this with Talos today? I suspect it might be (have been?) a game bug and not a driver bug.

If you can still reproduce with the current version of Talos please change the bug's status to REOPENED and if you cannot to RESOLVED/NOTOURBUG.

[1] https://www.opengl.org/registry/specs/ARB/clip_control.txt
Comment 4 Grazvydas Ignotas 2016-11-02 10:50:46 UTC
It's not supposed to render anything extra, just the wall.

Anyway the problem went away with one of the game's updates, so maybe it was the game's fault after all. It's interesting only Intel was affected, I'm sure r600g was fine and I think I even tried nvidia and it was fine too.
Comment 5 Germano Massullo 2017-01-18 17:46:21 UTC
(In reply to Grazvydas Ignotas from comment #0)
> Created attachment 123762 [details]
> screenshot
> 
> This started appearing with one of the game's updates (used to be fine
> before) and doesn't show up on r600g even with the same trace.
> 
> Tested on Mesa 11.2.0 and 11.3.0-devel (git-be2b13e)
> Hardware: HD Graphics 530 (Skylake GT2)
> Trace:
> https://drive.google.com/file/d/0Bz8fw_SGGDzsQThwMlIzZnE0RlU/view?usp=sharing

Hi, can I ask you how did you get such api trace while running The Talos Principle?
I tried running
$ apitrace trace steam
but it collected almost only Steam calls, not The Talos Principle API calls.
Thank you very much
Comment 6 Germano Massullo 2017-01-18 18:03:48 UTC
I solved with the following suggestion
[18:54] <bnieuwenhuizen>  in steam in the left bar, right click on the game, properties -> set launch options -> apitrace trace -o /path/to/trace/file %command%


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.