Bug 106790 - [SKL] Some graphical effects don't appear when using Intel HD Graphics 520 in The Ruins of the Lost Kingdom CHRONICLE
Summary: [SKL] Some graphical effects don't appear when using Intel HD Graphics 520 in...
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-03 02:22 UTC by leozinho29_eu
Modified: 2018-09-01 02:15 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
The game in Intel GPU, notice the arrow that blinks over the enemies (it should be shown all the time when far away from them) (3.29 MB, video/webm)
2018-06-03 02:22 UTC, leozinho29_eu
Details

Description leozinho29_eu 2018-06-03 02:22:59 UTC
Created attachment 139979 [details]
The game in Intel GPU, notice the arrow that blinks over the enemies (it should be shown all the time when far away from them)

When playing The Ruins of the Lost Kingdom CHRONICLE, there are some visual effects that do not appear or are bugged when using Intel HD Graphics 520. Those effects appear properly when using a AMD Radeon HD 5450.

Initially I asked for help in the #winehq IRC channel, as the game is run using Wine. It was noticed that, in the machine with the Intel GPU, there were hundreds of thousands of errors in Wine like:
0030:err:d3d:wined3d_debug_callback 0x1a0db0: "GL_INVALID_OPERATION in glDrawArrays(vertex buffers are mapped)".

It was asked to make a apitrace of the game. The apitrace made in the computer with Intel GPU was not running on the computer with AMD GPU, but the apitrace made in the AMD GPU worked on both.

glxinfo -B from the AMD GPU
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD CEDAR (DRM 2.50.0 / 4.15.0-23-generic, LLVM 6.0.0) (0x68f9)
    Version: 18.0.0
    Accelerated: yes
    Video memory: 512MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 511 MB, largest block: 511 MB
    VBO free aux. memory - total: 1021 MB, largest block: 1021 MB
    Texture free memory - total: 511 MB, largest block: 511 MB
    Texture free aux. memory - total: 1021 MB, largest block: 1021 MB
    Renderbuffer free memory - total: 511 MB, largest block: 511 MB
    Renderbuffer free aux. memory - total: 1021 MB, largest block: 1021 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 512 MB
    Total available memory: 1533 MB
    Currently available dedicated video memory: 511 MB
OpenGL vendor string: X.Org
OpenGL renderer string: AMD CEDAR (DRM 2.50.0 / 4.15.0-23-generic, LLVM 6.0.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.0-rc5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 18.0.0-rc5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.0.0-rc5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

glxinfo -B from the Intel GPU:
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)  (0x1916)
    Version: 18.2.0
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.0-devel (git-8841c2cda5)
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 18.2.0-devel (git-8841c2cda5)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.2.0-devel (git-8841c2cda5)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Both computers are running Xubuntu 18.04. The computer with AMD GPU uses the Mesa from Ubuntu repositories. The computer with Intel GPU uses Mesa from git (git-8841c2cda5), it has the issue using Ubuntu's Mesa build too.

The apitrace I made is available here: https://mega.nz/#!59BQDSpA!xjxYXeuAGShFSiSEEha9sE4FH9RP2lnkT7YUuUQU-zU

The game can be found in the site http://www.tomoshibi.net/guide/rolo/
Comment 1 Denis 2018-06-05 09:01:10 UTC
hi. Does provided apitrace display the issue? I watched your video, and then apitrace - they look different (in the video red threangle over the targets, and in the apitrace - purple treangle over your character).

Could you please point exact issue in apitrace?
Comment 2 leozinho29_eu 2018-06-05 14:32:02 UTC
Sorry, my description should be more clear. On the apitrace, there are significant differences between what Intel and AMD GPU shows. There are two images that show what happens on them:

Intel HD Graphics 520: https://cdn.discordapp.com/attachments/234032525297582081/452632355753033729/IntelHd520.png

AMD Radeon HD 5450: https://cdn.discordapp.com/attachments/234032525297582081/452632462015594506/AMDRadeonHD5450.png

Notice the lines around the portal, they may blink for a instant in Intel HD Graphics 520, when they should circle it all the time, as it happens on Windows and using the AMD GPU.
Comment 3 leozinho29_eu 2018-07-06 22:46:53 UTC
Is there any additional information I could provide to improve this bug report?
Comment 4 Mark Janes 2018-07-06 23:10:50 UTC
I tested your trace with Kabylake (very similar to your 520 part) and the trace looked like the picture you posted for radeon.  I tested with Mesa 18.0 and 18.2-devel

The circles rotated around the portal with no blinking.
Comment 5 leozinho29_eu 2018-07-07 00:23:21 UTC
Thank you for your quick answer. I took some time to answer because I was rebuilding Mesa to test. Unfortunately it did not work, the lights around the portal still do not appear properly. Below there are some details:

Build configuration, based on what Ubuntu uses to build Mesa:

./autogen.sh --prefix=/usr/local/mesa --enable-dri --with-dri-drivers=i915,i965,swrast \
--with-vulkan-drivers=intel --enable-libglvnd --enable-osmesa --enable-glx-tls \
--enable-shared-glapi --enable-xvmc --disable-omx-bellagio \
--enable-driglx-direct --enable-gbm --enable-dri3 --with-platforms=x11,surfaceless,drm \
--enable-xa --enable-llvm --enable-opencl --enable-opencl-icd ac_cv_path_LLVM_CONFIG=llvm-config-6.0 \
--enable-vdpau --enable-va --enable-gallium-extra-hud --enable-lmsensors --with-gallium-drivers=i915,svga,swrast \
--enable-gles1 --enable-gles2 --enable-nine CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall" \
CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall" \
FCFLAGS="-g -O2 -fstack-protector-strong" FFLAGS="-g -O2  -fstack-protector-strong" \
GCJFLAGS="-g -O2 -fstack-protector-strong" LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" \
OBJCFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \
OBJCXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security"

The glxinfo -B output:

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) x86/MMX/SSE2 (0x1916)
    Version: 18.2.0
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) x86/MMX/SSE2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.0-devel (git-f8e54d02f7)
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 18.2.0-devel (git-f8e54d02f7)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.2.0-devel (git-f8e54d02f7)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Comment 6 Denis 2018-07-11 09:08:52 UTC
Hi!
>>>Notice the lines around the portal, they may blink for a instant in Intel HD Graphics 520, when they should circle it all the time, as it happens on Windows and using the AMD GPU.

Thanks a lot for clarification. I reproduced and bisected the issue to the first "bad" commit.

_____________________________________________________________
aaaa22c775f484922ccac705de41dd892e2aff4d is the first bad commit
commit aaaa22c775f484922ccac705de41dd892e2aff4d
Author: Jordan Justen <jordan.l.justen@intel.com>
Date: Mon Apr 25 16:09:21 2016 -0700

vbo: Return INVALID_OPERATION during draw with a mapped buffer

Fixes the OpenGLES 3.1 CTS:

    ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos

Because this is triggering the error message after the normal API
validation phase, we don't have the API function name available, and
therefore we generate an error message without the draw call name:

Mesa: User error: GL_INVALID_OPERATION in draw call (vertex buffers are mapped)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95142
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Comment 7 Denis 2018-07-11 09:09:45 UTC
oh, forgot to mention. Issue was checked and reproduced on SKL and KBL laptops.
Comment 8 asimiklit 2018-07-11 13:32:22 UTC
Actually it is an expected behavior here because the game calls draw functions when buffer is mapped and according to spec it is an incorrect behavior:

Section 6.3.2 of the GL 4.5 spec says: 

"Any GL command which attempts to read from, write to, or change the state of a buffer object may generate an INVALID_OPERATION error if all or part of the buffer object is mapped ... However, only commands which explicitly describe this error are required to do so. If an error is not generated, such commands will have undefined results and may result in GL interruption or termination."

But actually the Mesa already has an feature/ability to allow such behavior:

Commit 	e401cfa28a6e32d7081f9de998e731965ce966fb:
https://cgit.freedesktop.org/mesa/mesa/commit/?id=e401cfa28a6e32d7081f9de998e731965ce966fb

>i965: Allow mapped VBOs during drawing in non-debug contexts.


This option will be enabled automatically only for non-debug contexts.
But unfortunately Game creates context with flag GLX_CONTEXT_FLAGS_ARB=GLX_CONTEXT_DEBUG_BIT_ARB and the Game is unable to use this feature/ability and as far as I researched the mesa source code there is no way to force Mesa to enable it.
Comment 9 Denis 2018-07-18 15:10:34 UTC
as we found out that it is not mesa issue, this ticket may be closed.
Also, I sent email to support@tomoshibi.NET with kind request to add the fix into the game.
Comment 10 leozinho29_eu 2018-09-01 02:15:28 UTC
I'm commenting to say I solved the issue. It wasn't a Mesa bug, it wasn't a game bug, it was also not a bug, it was a feature. A Wine feature.

Wine was creating the debug context somehow. Setting the environment variable:

WINEDEBUG="-all"

Solved the problem. It's strange that Wine created debug contexts as I set nothing related to Wine debug and, as I had set no debug option, I expected there would be no debug context and never suspected of that.

All effects are appearing correctly, the game is running perfectly and I'm very happy.

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.