protonscr

[d3d11] Unity Enemies Demo crashes with DXVK

dxvkclosed d3d11
doitsujin/dxvk#3086 · opened 2022-11-20 by mbriar · updated 2022-11-21 · 8 comments · github
1 matching comments, n / p to jump
Mmbriar 2022-11-20 github

The Unity Enemies Demo crashes with DXVK, it starts up fine with wined3d, albeit with broken rendering.
I think it might be crashing while compiling this shader: shader.zip

Getting this backtrace with gdb:

(gdb) bt
#0  0x0000000359077c5f in dxvk::D3D11CommonShader::D3D11CommonShader (this=<optimized out>, pDevice=<optimized out>, pShaderKey=<optimized out>, pDxbcModuleInfo=<optimized out>, pShaderBytecode=<error reading variable: Could not find the frame base for "dxvk::D3D11CommonShader::D3D11CommonShader(dxvk::D3D11Device*, dxvk::DxvkShaderKey const*, dxvk::DxbcModuleInfo const*, void const*, unsigned long long)".>, BytecodeLength=<error reading variable: Could not find the frame base for "dxvk::D3D11CommonShader::D3D11CommonShader(dxvk::D3D11Device*, dxvk::DxvkShaderKey const*, dxvk::DxbcModuleInfo const*, void const*, unsigned long long)".>) at ../src/d3d11/../dxbc/dxbc_chunk_shex.h:24
#1  0x0000000359078d4f in dxvk::D3D11ShaderModuleSet::GetShaderModule (this=<optimized out>, pDevice=<optimized out>, pShaderKey=<optimized out>, pDxbcModuleInfo=<optimized out>, pShaderBytecode=<error reading variable: Could not find the frame base for "dxvk::D3D11ShaderModuleSet::GetShaderModule(dxvk::D3D11Device*, dxvk::DxvkShaderKey const*, dxvk::DxbcModuleInfo const*, void const*, unsigned long long, dxvk::D3D11CommonShader*)".>, BytecodeLength=<error reading variable: Could not find the frame base for "dxvk::D3D11ShaderModuleSet::GetShaderModule(dxvk::D3D11Device*, dxvk::DxvkShaderKey const*, dxvk::DxbcModuleInfo const*, void const*, unsigned long long, dxvk::D3D11CommonShader*)".>, pShader=<error reading variable: Could not find the frame base for "dxvk::D3D11ShaderModuleSet::GetShaderModule(dxvk::D3D11Device*, dxvk::DxvkShaderKey const*, dxvk::DxbcModuleInfo const*, void const*, unsigned long long, dxvk::D3D11CommonShader*)".>) at ../src/d3d11/d3d11_shader.cpp:105
#2  0x0000000359064b6e in dxvk::D3D11Device::CreateShaderModule (this=<optimized out>, pShaderModule=<optimized out>, ShaderKey=..., pShaderBytecode=<optimized out>, BytecodeLength=<error reading variable: Could not find the frame base for "dxvk::D3D11Device::CreateShaderModule(dxvk::D3D11CommonShader*, dxvk::DxvkShaderKey, void const*, unsigned long long, ID3D11ClassLinkage*, dxvk::DxbcModuleInfo const*)".>, pClassLinkage=<error reading variable: Could not find the frame base for "dxvk::D3D11Device::CreateShaderModule(dxvk::D3D11CommonShader*, dxvk::DxvkShaderKey, void const*, unsigned long long, ID3D11ClassLinkage*, dxvk::DxbcModuleInfo const*)".>, pModuleInfo=<error reading variable: Could not find the frame base for "dxvk::D3D11Device::CreateShaderModule(dxvk::D3D11CommonShader*, dxvk::DxvkShaderKey, void const*, unsigned long long, ID3D11ClassLinkage*, dxvk::DxbcModuleInfo const*)".>) at ../src/d3d11/d3d11_device.cpp:1967
#3  0x0000000359067424 in dxvk::D3D11Device::CreateVertexShader (this=<optimized out>, pShaderBytecode=<optimized out>, BytecodeLength=<optimized out>, pClassLinkage=<optimized out>, ppVertexShader=<error reading variable: Could not find the frame base for "dxvk::D3D11Device::CreateVertexShader(void const*, unsigned long long, ID3D11ClassLinkage*, ID3D11VertexShader**)".>) at ../src/d3d11/d3d11_device.cpp:748
#4  0x00000001809106c2 in ?? ()
#5  0x0000000000000000 in ?? ()

Software information

https://unity.com/demos/enemies

System information

  • GPU: RX 6700 XT
  • Driver: Mesa main, amdvlk, amdgpu-pro
  • Wine version: 7.20 or Proton Experimental
  • DXVK version: 2.0 or 1.10.3

Apitrace file(s)

Doesn't seem to work on linux, I might try on Windows later.

Log files

Mmbriar 2022-11-21 github

Probably unrelated fun fact: all of the *.bat files the demo comes with, have -force-d3d12 as launch parameter, but I can't get it to launch in d3d12 mode. Tried VKD3D_CONFIG=dxr11, VKD3D_FEATURE_LEVEL=12_2, etc...
Still, the demo launches and renders something in d3d11 mode with wined3d, so DXVK should probably at least get this far... I'll give it a try on Windows tomorrow.

KK0bin maintainer 2022-11-21 github

Yeah, the demo is using D3D12 for the most part but for some reason it's passing D3D12 shaders into D3D11.

Mmbriar 2022-11-21 github

This PR does solve the crash, but it renders completely black and still refuses the do anything with d3d12 for me, no vkd3d-proton logs are generated at all.

FWIW, with wined3d it renders something like this:

Screenshot from 2022-11-21 01-41-36

Well, given that vkd3d-proton doesn't even get loaded, i'm not sure if there is anything that can be done about that from the dxvk or vkd3d-proton side..

Ddoitsujin maintainer 2022-11-21 github

Is the demo even supposed to work with D3D11 (rather than D3D12)?

Mmbriar 2022-11-21 github

The *.bat files very much make it look like it's meant to run on d3d12.. but it doesn't want to do it on wine/proton/ for some reason.

KK0bin maintainer 2022-11-21 github

When I just try the exe, it also tries to use shared resources, so there might even be some D3D11 <-> D3D12 interop happening.

Mmbriar 2022-11-21 github

Actually, it does seem to initialize d3d12 and vkd3d-proton, it just seems to destroy the d3d12 device again and continue to render with d3d11: vkd3d.txt

Well, the original crash is fixed and it's probably not meant to work with d3d11, so I'll close this and maybe move it over to vkd3d-proton.

Mmbriar 2022-11-21 github

FYI @doitsujin, with https://github.com/doitsujin/dxvk/tree/shader-fix it actually renders mostly correctly and isn't a blackscreen like with the earlier crash fix.

Some broken rendering is left:

Screenshot from 2022-11-21 22-24-33

But I'll put that down as the game running on d3d11 when it should run on d3d12 until i can prove otherwise 😅

Proton versions

Launch options