Summary: | [radeonsi] Arma 3 crashes: Too many fragment shader texture samplers | ||
---|---|---|---|
Product: | Mesa | Reporter: | riku |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | gribua, step2back+freedesktop |
Version: | 11.0 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
See Also: | https://bugs.freedesktop.org/show_bug.cgi?id=94835 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Backtrace
Crash report (eon.txt) Log with MESA_GLSL=dump (gzipped) failing shader |
Created attachment 118173 [details]
Crash report (eon.txt)
Should show up if you do MESA_GLSL=dump. I suspect they have a sampler somewhere funny... the number of samplers is counted with link_uniforms.cpp:values_for_type which seems like it'll be off for a sampler inside a struct or something. Created attachment 118179 [details]
Log with MESA_GLSL=dump (gzipped)
Thank you for looking at this. Here is the gzipped log from Arma 3 with MESA_GLSL=dump. It is pretty big, and I was unsure where to cut it, so I'm attaching it uncut. Sorry about that.
Created attachment 118201 [details]
failing shader
Looks like for maximal convenience, the shader dump truncates the text representation. Anyways, this thing has 34 sampler uniforms. Not sure if they all get counted as used.
Haven't gone over the LISP-y IR that's printed.
FWIW Arma 3 works on i965 (tested today with Mesa @ afa1efd). disabling shadows allows me to play the game on radeonsi fyi @altosk
> disabling shadows allows me to play the game on radeonsi fyi
Yes. But it would be better to have shadows. I'm affected too and play without shadows.
I believe radeonsi only advertises support for 32 samplers, and this shader declares 33. $ grep 'uniform[[:space:]]\+sampler' ~/file_91951.txt | wc -l 33 Looking at the code, far fewer than 33 are used. $ grep 'var_ref tex[0-9]' ~/file_91951.txt | wc -l 21 If there are only 21 references to sampler variables, it is impossible for more than 21 samplers to be used. I also notice that this shader has #ifdef GL_ARB_separate_shader_objects #extension GL_ARB_separate_shader_objects : enable #endif at the top. GL_ARB_separate_shader_objects changes some of the rules about what things are allowed to be eliminated from a linked shader. I didn't think it had any affect on uniforms, so it's possible there's some bad interaction there. Can someone try running this on radeonsi with the environment variable MESA_EXTENSION_OVERRIDE=-GL_ARB_separate_shader_objects? Thank you Ian for looking at this. Unfortunately, MESA_EXTENSION_OVERRIDE=-GL_ARB_separate_shader_objects didn't help. Same error message with same CRC for the failing shader, and no differences in any of the 207 shaders I got with MESA_GLSL=log. Maybe I did something wrong, or is it normal to get an implementation error with MESA_EXTENSION_OVERRIDE? MESA_EXTENSION_OVERRIDE=-GL_ARB_separate_shader_objects MESA_GLSL=log ./arma3 Mesa 11.0.8 implementation error: Trying to disable permanently enabled extensions: GL_ARB_separate_shader_objects Tested with mesa 11.0.8 and llvm-3.7.1. Please let me know if there is something more I can do. There should be a new version of Arma 3 out soon, so this might resolve itself. Arma 3: version 1.54 OpenGL renderer string: Gallium 0.4 on AMD CAPE VERDE (DRM 2.43.0, LLVM 3.8.0) OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.3.0-devel (git-4420f18 2016-04-08 wily-oibaf-ppa) Shadows is set to "standart". There is no crash and shadows are on there places. I report "bug is fixed". Thank you. Fixed for me too. Thank you! |
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.
Created attachment 118172 [details] Backtrace Arma 3 crashes when entering map. Last lines from eon.txt: [thread 0000000f][E][48299]: Program from shader GL_FRAGMENT_SHADER with length 20611 and CRC 0xae61bc1c has not been successfully linked. Program info log: error: Too many fragment shader texture samplers Mesa version: 11.0.0-rc3 GPU: R9 390 GCC options: -O1 -ggdb -march=native Attaching backtrace and eon.txt in case there is some useful information. MESA_GLSL=log didn't save the failing shader, just all before it. Please let me know if I can provide more information.