protonscr

Empires demo crashes with "syntax error, unexpected NEW_IDENTIFIER"

vkd3dclosed
HansKristian-Work/vkd3d-proton#2049 · opened 2024-07-21 by rkfg · updated 2024-07-22 · 9 comments · github
Rrkfg 2024-07-21 github

The new demo called Empires by Conspiracy crashes after launch (it shows a window with parameters before that). It's a 64k demo, so I suppose it can be quite hacky. Still, it works on Windows and uses D3D12. On Linux with vkd3d-proton it crashes and the most probable cause is:

0024:err:d3dcompiler:D3DCompile2 Failed to compile shader, vkd3d result -4.                                                                                                           
0024:err:d3dcompiler:D3DCompile2 Shader log:                                               
0024:err:d3dcompiler:D3DCompile2     <anonymous>:3:637: E5000: syntax error, unexpected NEW_IDENTIFIER                                                                                

Software information

The demo is here: https://www.pouet.net/prod.php?which=96589

System information

  • GPU: 3090Ti
  • Driver: 555.58
  • Wine version: Proton Experimental (9.0)
  • VKD3D-Proton version: master ebe7279e7960d204f5b1bd3d89408929140cdd0f

Log files

empires.log

Mmbriar 2024-07-22 github

From the log it looks like the problem is d3dcompiler, which is not part of vkd3d-proton. Try to install native d3dcompiler_47 with winetricks.

Rrkfg 2024-07-22 github

I had no idea the compiler is separate, thanks! Indeed, that fixes it. The demo still crashes with OOM but that's probably expected.

Mmbriar 2024-07-22 github

You may want to report this to wine, the HLSL d3dcompiler is implemented in upstream vkd3d. Proton also uses upstream vkd3d for that.

Rrkfg 2024-07-22 github

There's an issue though, it seems that the resulting code runs on OpenGL and there's no image produced at all. I tried another demo by the same group which also crashes with a similar error, it loads with d3dcompiler_47.dll but then there's just white screen with music and a lot of errors in the log like:

0130:err:d3d:wined3d_debug_callback 01FF0480: "GL_INVALID_FRAMEBUFFER_OPERATION error generated. Operation is not valid because a bound framebuffer is not framebuffer complete.".
0130:fixme:d3d:wined3d_context_gl_check_fbo_status FBO status GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT (0x8cd6).
0130:fixme:d3d:context_dump_fbo_attachment     GL_DEPTH_ATTACHMENT: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_STENCIL_ATTACHMENT: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT0: 2d texture 122, 0x0, 0 samples, format 0x881a.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT1: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT2: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT3: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT4: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT5: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT6: NONE.
0130:fixme:d3d:context_dump_fbo_attachment     GL_COLOR_ATTACHMENT7: NONE.

I suppose it's wined3d OpenGL-based implementation working instead of a Vulkan one. But I have no idea how to change that.

KK0bin 2024-07-22 github

If it runs on WineD3D, the game is not using D3D12.

Mmbriar 2024-07-22 github

Wined3d doesn't support d3d12. But it looks to me like the demo uses d3d11 and not 12, it works with DXVK:

image

FWIW, vkd3d-proton requires DXVK's dxgi anyways, so you should always install both.

Rrkfg 2024-07-22 github

Thank you for testing! It's very weird, I created a fresh prefix, compiled and installed DXVK manually and still can't run it. I'll take a closer look. The initial error was about it not being able to find libvkd3d-1.dll and libvkd3d-shader-1.dll which I then symlinked from Proton and it suggested it uses D3D12 and vkd3d. Apparently I was wrong.

Mmbriar 2024-07-22 github

The initial error was about it not being able to find libvkd3d-1.dll and libvkd3d-shader-1.dll which I then symlinked from Proton and it suggested it uses D3D12 and vkd3d. Apparently I was wrong.

Yes, wine uses upstream vkd3d for HLSL to DXBC for both d3d11 and 12, and neither DXVK nor vkd3d-proton handle the HLSL compiler part.

Rrkfg 2024-07-22 github

Okay, solved it. Indeed, I needed to install DXVK and override the corresponding libraries in winecfg. Maybe a part of the problem was that I used wine from Proton Experimental (it handles many programs better such as Electron-based apps and those that change resolution and fail on vanilla wine). Thanks again for your help, I learned something new today 😄

Proton versions

DLLs