Skip to content

spirv-val: Add --allow-vulkan-linkage option#6580

Open
s-perron wants to merge 1 commit intoKhronosGroup:mainfrom
s-perron:users/s-perron/linkage-val
Open

spirv-val: Add --allow-vulkan-linkage option#6580
s-perron wants to merge 1 commit intoKhronosGroup:mainfrom
s-perron:users/s-perron/linkage-val

Conversation

@s-perron
Copy link
Copy Markdown
Collaborator

Adds a new option to spirv-val that permits the Linkage capability
when targeting Vulkan environments. This is needed to validate SPIR-V
generated by compilers that may still go through a linking process
before being provided to the driver.

  • Adds allow_vulkan_linkage to spv_validator_options_t.
  • Updates C and C++ validator option APIs to support setting this flag.
  • Modifies CapabilityPass to allow Capability Linkage when targeting
    Vulkan if the option is enabled.
  • Exposes the new --allow-vulkan-linkage flag in the spirv-val CLI.
  • Adds corresponding tests for the new option and capability validation.

Adds a new option to spirv-val that permits the Linkage capability
when targeting Vulkan environments. This is needed to validate SPIR-V
generated by compilers that may still go through a linking process
before being provided to the driver.

* Adds `allow_vulkan_linkage` to `spv_validator_options_t`.
* Updates C and C++ validator option APIs to support setting this flag.
* Modifies `CapabilityPass` to allow `Capability Linkage` when targeting
  Vulkan if the option is enabled.
* Exposes the new `--allow-vulkan-linkage` flag in the `spirv-val` CLI.
* Adds corresponding tests for the new option and capability validation.
@s-perron s-perron requested a review from alan-baker March 11, 2026 14:17
@alan-baker
Copy link
Copy Markdown
Contributor

I haven't looked at the code, but a question: does it make sense to just use universal validation until linking has occurred? Do you expect imported resources, etc?

@spencer-lunarg
Copy link
Copy Markdown
Contributor

Would it be simpler to just always always Linkage and have Validation Layers make sure at runtime you aren't trying to submit SPIR-V with a linker?

(only asking because I doubt the value of checking "ahead with spirv-val" for OpCapability Linkage is a real issue and would prevent yet-another-spirv-val-argument-flag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants