Bug 95285 - [radeonsi,apitrace] Tomb Raider: enabling TressFX makes hair disappear
Summary: [radeonsi,apitrace] Tomb Raider: enabling TressFX makes hair disappear
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-05 14:36 UTC by Kai
Modified: 2016-05-05 18:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
No hair with TressFX (662.51 KB, image/jpeg)
2016-05-05 14:36 UTC, Kai
Details
Hair is visible without TressFX enabled (563.38 KB, image/jpeg)
2016-05-05 14:39 UTC, Kai
Details

Description Kai 2016-05-05 14:36:25 UTC
Created attachment 123497 [details]
No hair with TressFX

When I enable TressFX in Tomb Raider with the stack detailed below, Lara's hair disappears partially (the part rendered with TressFX). Going back to "normal" settings makes the hair fully visible again. The attached screenshot shows how it looks with TressFX enabled.

I thought it might help to set the GLSL and GL overrides to 430 and 4.3 respectively, but then the game launcher refuses to start with tons of GL_INVALID_OPERATION errors (see <https://paste.debian.net/hidden/84a0115a/>). Not sure if this is a bug in the launcher or Mesa, but since 4.3 support is imminent I thought I mention it here as well.


The following stack (Debian testing as a base) was used:
GPU: Hawaii PRO [Radeon R9 290] (ChipID = 0x67b1)
Mesa: Git:master/76a36ac3ea
libdrm: 2.4.67-1
LLVM: SVN:trunk/r268388 (3.9 devel)
X.Org: 2:1.18.3-1
Linux: 4.5.1
Firmware: firmware-amd-graphics/20160110-1
libclc: Git:master/20d977a3e6
DDX: 1:7.7.0-1

Let me know, if you need something else.
Comment 1 Kai 2016-05-05 14:39:33 UTC
Created attachment 123498 [details]
Hair is visible without TressFX enabled
Comment 2 Ilia Mirkin 2016-05-05 15:09:41 UTC
Try some of Ken's patches at

https://cgit.freedesktop.org/~kwg/mesa/log/?h=tombraider-2

There are some issues which tressfx happens to hit. (And some other option too...) However at least on nouveau, tressfx is still a fail even with those. [Sorry, don't have the game myself, so don't have further details. Just an FYI with the current state of affairs.]
Comment 3 Nicolai Hähnle 2016-05-05 16:38:57 UTC
If the patches mentioned by Ilia don't help, an apitrace showing the problem would be useful.
Comment 4 Kai 2016-05-05 17:07:14 UTC
(In reply to Ilia Mirkin from comment #2)
> Try some of Ken's patches at
> 
> https://cgit.freedesktop.org/~kwg/mesa/log/?h=tombraider-2

Thanks for the pointer, Ilia! I've applied the following patches:
fb4f8f9 glsl: Make opt_constant_variable() bail in useless cases.
a6bebce glsl: Remove bonus tree walking in opt_constant_folding().
b01114f glsl: Consolidate duplicate copies of constant folding.
2040a80 glsl: Avoid excess tree walking when folding ir_dereference_arrays.
285e966 glsl: Don't do constant propagation in opt_constant_folding.
862fb32 glsl: Make lower_const_arrays_to_uniforms work directly on constants.
341ee51 glsl: Don't constant propagate arrays

Additionally, I think I should mention, that I've applied <https://patchwork.freedesktop.org/patch/85101/> locally, since I'm using a LLVM > 268259. Just in case that could have an impact.

Anyway, with those patches applied the game freezes the system (ie. the system stops responding to any kind of input) while entering the main menu. The only output I could capture was "[0505/185411:WARNING:x11_util.cc(1490)] X error received: serial 1001, error_code 3 (BadWindow (invalid Window parameter)), request_code 4, minor_code 0 (X_DestroyWindow)"
CCing Kenneth, maybe he has an idea which of his patches could cause this.

> There are some issues which tressfx happens to hit. (And some other option
> too...)

Do you mean bug 95190 or something else? I'm seeing bug 95190 as well. Therefore I've kept post processing disabled so far.

> However at least on nouveau, tressfx is still a fail even with
> those. [Sorry, don't have the game myself, so don't have further details.
> Just an FYI with the current state of affairs.]

No need to apologize! Any piece of information is appreciated. As far as access to TR goes: did you try contacting Feral? They were willing to give access to XCOM 2 to some Mesa developers IIRC, maybe they're willing to do the same here?


(In reply to Nicolai Hähnle from comment #3)
> If the patches mentioned by Ilia don't help, an apitrace showing the problem
> would be useful.
Ok, I'll do that.
Comment 5 Kai 2016-05-05 18:28:42 UTC
Apitrace is now available at <http://dev.carbon-project.org/debian/mesa.bugs/95285/tombraider.trace.xz>.

Access to that file is password protected to prevent needless downloads, since the trace is > 800 MB in this compressed form (1.9 GB uncompressed). Known Mesa developers can drop me a message requesting access. If you had access to another apitrace I produced, those credentials continue to work and will give you access to this trace as well.

The trace includes me activating TressFX in the options and therefore you can see the full settings I'm using for Tomb Raider. Just in case you spot something in there, that you might think I should try.
Comment 6 Kai 2016-05-05 18:58:09 UTC
Ok, I did one last test. I only set "MESA_GLSL_VERSION_OVERRIDE=430" (notice the missing override for MESA_GL_VERSION_OVERRIDE in comparison to comment #0). When launched this way, TressFX works (at least in the benchmark, I used to check this and to produce the trace from comment #5)!

I'm closing this bug as NOTOURBUG as it seems the game is using functionality, when the TressFX option is enabled, it should only use when GLSL 4.30 is available. Or put differently: it shouldn't offer TressFX unless GLSL 4.30 is available, ie. this is a game bug.

The launcher problem described in comment #0 seems to stem from the fact, that MESA_GL_VERSION_OVERRIDE also overrides the compatibility profile version as well and the launcher then uses that instead of a core profile. While forcing GLSL to 4.30 only enables 4.3 in the core profile.


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.