Skip to content

texture index for MSL #1448

Answered by billhollings
wtholliday asked this question in Q&A
Oct 13, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The index-based resource mapping for Metal is different than location-binding mapping used by Vulkan. SPIRV-Cross, which is used by MoltenVK for shader conversion, defaults to automatically incrementing index numbers.

At runtime, MoltenVK passes the mappings to SPIRV-Cross, based on how the Vulkan pipeline is configured, so that both the shader and pipeline use the same Metal indexes for the same resources.

If you are trying to convert shaders off-line for some other use, it's up to you to define that Vulkan-Metal resource mapping, either by accepting the SPIRV-Cross default approach, or by setting the contents of your ctx.resourceBindings (mvk::SPIRVToMSLConversionConfiguration::resource…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wtholliday
Comment options

Answer selected by wtholliday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants