protonscr

Invalid SPIR-V causes crash in vkCreateComputePipelines

vkd3dopen
HansKristian-Work/vkd3d-proton#2864 · opened 2026-03-06 by SpicySwordfish · updated 2026-03-23 · 6 comments · github
SSpicySwordfish 2026-03-06 github

Conversion to SPIR-V for a lens flare compute shader is successful but generates invalid SPIR-V, which causes a winevulkan assertion when calling vkCreateComputePipelines. The dxil and generated spv for the shader is attached.

VKD3D-Proton logs this:

02a8:err:vkd3d_debug_messenger_callback: VUID-VkShaderModuleCreateInfo-pCode-08737: vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Block '5184[%5184]' is already a merge block for another header
  %main = OpFunction %void None %3

Command to reproduce:
	spirv-val <input.spv> --relax-block-layout --uniform-buffer-standard-layout --scalar-block-layout --allow-localsizeid --allow-offset-texture-operand --target-env vulkan1.3

The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08737)

System information

  • GPU: 7900 XTX
  • Driver: Mesa 26.0.1-arch1.1
  • Wine version: Proton Experimental (experimental-10.0-20260227)
  • VKD3D-Proton version: bf4a024

shader.tar.gz

HHansKristian-Work maintainer 2026-03-09 github

Are you sure you uploaded the .dxil shader correctly? That file looks corrupt, and I get an error:

shaders/c26afb49ae5ce17a.dxil
tar: shaders/c26afb49ae5ce17a.dxil: implausibly old time stamp -9223372036854775808
shaders/c26afb49ae5ce17a.spv
tar: shaders/c26afb49ae5ce17a.spv: implausibly old time stamp -9223372036854775808

Which game is this?

SSpicySwordfish 2026-03-09 github

The file data looks fine, the timestamps are just messed up because of how I created the tar. The game is in development. Thanks for taking a look.

HHansKristian-Work maintainer 2026-03-10 github

Well, the problem is that the DXIL itself is just corrupt and does not parse at all. The DXBC blob header itself is corrupt, so not sure what happened.

SSpicySwordfish 2026-03-10 github

Interesting. That was dumped with VKD3D_SHADER_DUMP_PATH. There are a few more shaders with this problem, but many more work fine, and this build of the game works on Windows. I'm out of town this week but will take a look when I get back.

HHansKristian-Work maintainer 2026-03-10 github

I'll try to run the shader through native driver and see if it blows up. I've never seen SHADER_DUMP_PATH export an obviously corrupt blob before, but clearly something must have happened since you provided an invalid .spv coming out of dxil-spirv, but in my case, the DXIL fails on the first 3 lines of DXBC file container parsing.

HHansKristian-Work maintainer 2026-03-23 github

@SpicySwordfish did you get around to checking this?

Proton versions

Launch options