Fix Kokiri loading crashes with RX_VK_MESH_FIRST enabled #217

Merged
klimovich008 merged 3 commits from codex/mesh-first-types into main 2026-11-07 23:46:13 +00:00
klimovich008 commented 2026-11-07 16:23:06 +00:00 (Migrated from github.com)

What this fixes

With RX_VK_MESH_FIRST=1, loading Kokiri Forest can abort with 0xc0000409 on an RX 9070 XT when a task shader has no guest 64-bit operations.

Why merge

  • Creates the Int64 type and capability required by the generated address read; reuses an existing type.
  • Checks device support before enabling this path.
  • Keeps the option off by default and preserves other stages and environment-variable controls.

Change

  • gpu/vk/eden/shader_recompiler/backend/spirv/spirv_emit_context.cpp: add the support check and if (!Sirit::ValidId(U64)) { AddCapability(spv::Capability::Int64); U64 = Name(TypeInt(64, false), "u64"); }.
  • nx2/test_mesh_first_types.py: check actual setup with the option on/off, existing/missing types, other stages and unsupported profiles.

Tested

  • In a compiler developer shell with RX_CPM set: python nx2/test_mesh_first_types.py --headers "$env:RX_CPM/spirv-headers/vulkan-sdk-1.4.341.0/include" --cxx clang++ checks ten setup/type/capability cases. Fails on the old code, passes now.
  • RX 9070 XT: the newer renderer aborts during loading; with #217, #225 and #162, a 258-second run reaches Kokiri Forest with zero validation errors. All 73 reached task/mesh modules validate.

Not covered

  • Tested on AMD only; the latest GPU run combines the three fixes.
  • Colored noise remains. This does not claim correct final rendering.
## What this fixes With `RX_VK_MESH_FIRST=1`, loading Kokiri Forest can abort with `0xc0000409` on an RX 9070 XT when a task shader has no guest 64-bit operations. ## Why merge - Creates the Int64 type and capability required by the generated address read; reuses an existing type. - Checks device support before enabling this path. - Keeps the option off by default and preserves other stages and environment-variable controls. ## Change - `gpu/vk/eden/shader_recompiler/backend/spirv/spirv_emit_context.cpp`: add the support check and `if (!Sirit::ValidId(U64)) { AddCapability(spv::Capability::Int64); U64 = Name(TypeInt(64, false), "u64"); }`. - `nx2/test_mesh_first_types.py`: check actual setup with the option on/off, existing/missing types, other stages and unsupported profiles. ## Tested - In a compiler developer shell with `RX_CPM` set: `python nx2/test_mesh_first_types.py --headers "$env:RX_CPM/spirv-headers/vulkan-sdk-1.4.341.0/include" --cxx clang++` checks ten setup/type/capability cases. Fails on the old code, passes now. - RX 9070 XT: the newer renderer aborts during loading; with #217, #225 and #162, a 258-second run reaches Kokiri Forest with zero validation errors. All 73 reached task/mesh modules validate. ## Not covered - Tested on AMD only; the latest GPU run combines the three fixes. - Colored noise remains. This does not claim correct final rendering.
Commenting is not possible because the repository is archived.
No description provided.