Skip to content

vk_shaders: rename the reflected entry point, not 'main' (MARVEL Cosmic Invasion) - #2597

Open
bensaadmucret wants to merge 1 commit into
seedds:mainfrom
bensaadmucret:pr-vk-entry-point
Open

bensaadmucret wants to merge 1 commit into
seedds:mainfrom
bensaadmucret:pr-vk-entry-point

Conversation

@bensaadmucret

Copy link
Copy Markdown

What and why

vk_shaders.py stopped on a captured SPIR-V module with spirv-cross failed: Entry point does not exist: the translate command passed --rename-entry-point main vk_<key> <stage>, but SDL_GPU names its entry points ShaderFunction1, ShaderFunction2, … — there is no main to rename.

The reflected entry point's name (eps[0] of the --reflect output, already read for the stage) is passed instead, with main kept as the fallback when the reflection names none.

Adds the finding to docs/reference/rendering.md (Vulkan layer: SPIR-V entry points that are not main).

Checked

  • Tests: python3 -m unittest dm.tools.tests.test_docs (6 tests)
  • Games run, with title ID and version: MARVEL Cosmic Invasion 010059D020C26000 v0 (build D6A37DEAFF3F5AEA, provisional profile): its four captured modules (entry points ShaderFunction1 / ShaderFunction2) failed translation before and translate after; the resulting vk_shaders.metallib is what the game draws with at 60 fps
  • Devices and OS: Apple M6, macOS 27.0
  • One of four PRs from the same bring-up (the others: EOS platform handle, vkCmdBlitImage + SDL_GPU device procs, profile_guess detection). The change touches only the command vk_shaders.py runs on each captured module; a module whose entry point is main gets the same command as before.

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run (the symptom index)
  • A chain tool changed: dmsh_chain.py --header was run and dm/gfx/nvn/dmsh_chain.h is part of the change
  • No game files, keys or data extracted from a game in the change or the attachments

…ic Invasion)

SPIRV-Cross refused a module whose entry point is not named main: 'Entry point does not exist.' SDL_GPU's SPIR-V
names its entry points ShaderFunction1 / ShaderFunction2, so MARVEL Cosmic Invasion's whole capture failed to
translate. The reflection already reads the name (eps[0]); --rename-entry-point now takes it and falls back to
'main' only when the reflection names none.

Checked: MARVEL Cosmic Invasion's four captured modules (2 vertex ShaderFunction1, 2 fragment ShaderFunction2)
translate to vk_shaders.metallib and draw in a window at 60 FPS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant