Bug 99730 - Metro Redux game(s) needs override for midshader extension declaration
Summary: Metro Redux game(s) needs override for midshader extension declaration
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 77449
  Show dependency treegraph
 
Reported: 2017-02-09 13:06 UTC by Eero Tamminen
Modified: 2018-04-13 12:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
drirc patch (654 bytes, patch)
2017-02-09 13:06 UTC, Eero Tamminen
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Eero Tamminen 2017-02-09 13:06:26 UTC
Created attachment 129435 [details] [review]
drirc patch

Use-case:
- Install Steam & Metro 2033 Redux game
- Run game and switch it to High gfx quality
- Run again with warnings enabled

Actual outcome (from apitrace replay):
- This:
--------------------
warning: compilation failed
warning: 0:16(1): error: #extension directive is not allowed in the middle of a shader
warning: link failed
warning: error: linking with uncompiled shader
warning: link failed
warning: error: linking with uncompiled shader
--------------------
- And tens of these during startup & browsing game options:
--------------------
warning: glGetError(glUseProgram) = GL_INVALID_OPERATION
warning: program validation failed
--------------------

That shader seems to be used only during loading & menus, and I didn't notice any obvious rendering issues, but may be still better to add drirc workaround for it.  See attached patch for an example.

Note: I don't have Metro Last Light Redux, but it may have the same issue and same binary name.  Earlier non-Redux version of MetroLL didn't have this issue, and has different binary name.
Comment 1 Eero Tamminen 2017-02-09 13:34:52 UTC
PS. At least on Intel SKL with latest Mesa, something weird happens when switching between gfx quality levels.  Trying e.g. to switch to "Very high" level (by exiting the video options with ESC) freezes the game for few minutes after which it back to viddeo options.

Can somebody reproduce that behavior?
Comment 2 Grigori Goronzy 2017-02-09 14:17:20 UTC
> At least on Intel SKL with latest Mesa, something weird happens when switching between gfx quality levels.  Trying e.g. to switch to "Very high" level (by exiting the video options with ESC) freezes the game for few minutes after which it back to viddeo options.

The game seems to recreate *all* shaders in this case. The game also starts a prompt to ask the user to accept the new settings with a 30 second timeout and if there's no input in the meantime, it will reset to the old settings. However, due to the shader compiler hang, the prompt never actually displays.

This used to be a problem with radeonsi, but with the more recent optimizations to shader compilation, it now typically takes less than 30 seconds to recover from the hang, so it mostly works.
Comment 3 Eero Tamminen 2017-02-09 16:14:31 UTC
Thanks!  I guess this is one of the use-cases that actually *requires* shader compiler cache to work, so that user can (on second try) actually exit from the gfx options.  Should I file (a separate) bug about that too?
Comment 4 Timothy Arceri 2018-04-13 06:04:36 UTC
Is this still a problem? If so can you rebase the patch and send it to the list?
Comment 5 Eero Tamminen 2018-04-13 12:40:19 UTC
(In reply to Timothy Arceri from comment #4)
> Is this still a problem? If so can you rebase the patch and send it to the
> list?

I don't know, I haven't had time to try any Steam stuff for several months. Unfortunately it seems that I won't have time for that in next few months either.

I assume the second issue (gfx level change failing because shader compilation takes too long), will now succeed at least on second try due to shader cache being enabled by default.


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.