HansKristian-Work / dxil-spirv

DXIL conversion to SPIR-V for D3D12 translation libraries
Other
167 stars 32 forks source link

Star Wars Outlaws RT option crash #199

Closed Blisto91 closed 2 months ago

Blisto91 commented 3 months ago

Edit: see second comment below (https://github.com/HansKristian-Work/dxil-spirv/issues/199#issuecomment-2321718287) for newest update

Port of https://gitlab.freedesktop.org/mesa/mesa/-/issues/11792 as @KonstantinSeurer says it is a likely dxil-spirv issue.

When setting "Raytraced contact shadows" to medium or high in Star Wars Outlaws the game will crash to desktop.

Lines of interest from Proton log

SPIR-V parsing FAILED:
    In file ../src/compiler/spirv/vtn_structured_cfg.c:759
    count_construct_stack(&stack) == 1
    57800 bytes into the SPIR-V binary

spirv-val output from fossilize dump

Fossilize ERROR: spirv-val: Block '2277[%2277]' is already a merge block for another header
  %main = OpFunction %void None %3

Fossilize WARN: Failed to validate SPIR-V module: 77A1CA823A69C837, skipping!
Fossilize ERROR: spirv-val: Header block '2214[%2214]' is contained in the loop construct headed by '2187[%2187]', but its merge block '2269[%2269]' is not
  %2214 = OpLabel

Fossilize WARN: Failed to validate SPIR-V module: 375CAED7A0FC8DFD, skipping!
Fossilize ERROR: spirv-val: [VUID-StandaloneSpirv-Base-04781] Expected 32-bit int type for Base operand: BitCount
  %693 = OpBitCount %uint %692

Fossilize WARN: Failed to validate SPIR-V module: 610BDB6326633B92, skipping!

System information

Steps to reproduce

  1. Start game (only to main menu is fine)
  2. Enter SETTINGS -> Graphics -> Advanced graphics
  3. Change "Raytraced contact shadows" to medium or high and hit apply
  4. Observe crash

API captures

fossizile-dump.tar.gz

Log

outlaws-rt-crash-debug.tar.gz

Blisto91 commented 2 months ago

https://github.com/HansKristian-Work/vkd3d-proton/pull/2096 have fixed the spir-v validation errors. Mesa issue have been reopened as radv still crashes

Blisto91 commented 2 months ago

@KonstantinSeurer Managed to dump the crashing spirv and it fails validation. Not sure why fossilize wasn't showing anything.

spirv-val fail-0.spirv 
error: line 1799: Header block '2214[%2214]' is contained in the loop construct headed by '2187[%2187]', but its merge block '2269[%2269]' is not
  %2214 = OpLabel

fail-0.spirv.tar.gz

Blisto91 commented 2 months ago

Shader dump made with VKD3D_SHADER_DUMP_PATH https://drive.proton.me/urls/VYMEH7P5YR#i4RvXvtBAIWJ

Edit: Updated link since i accidentally made a dump with 2.13 stable instead of master

Saancreed commented 2 months ago

Another dump, this time made from about half an hour of gameplay with every setting cranked up to max on Nvidia: https://drive.google.com/file/d/1_D7fxoZe9u1A0kUbRPHY-GUxbnER0JiA/view?usp=drivesdk

Blisto91 commented 2 months ago

Fixed https://github.com/HansKristian-Work/vkd3d-proton/pull/2110