KhronosGroup / KhronosGroup/SPIRV-Cross

MSL: Feature request: Add a "enable_decoration_location" option.

Open
#1,816 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
GLSL
Stars
2.5k
Forks
713
Avg merge
2d 18h
Merged PRs (30d)
16

Description

I want to convert some SPIR-V modules from OpenGL GLSL and GL_ARB_gl_spirv, in which there are default uniforms with DecorationLocation, and I want keep them as MSL's buffer index.

Currently the CompilerMSL does not provide a function to do this kind of auto-remap, and implementing it with add_msl_resource_binding is just not a very easy work. And, CompilerMSL::get_metal_resource_index is not a virtual function.

So is it possible to add a enable_decoration_location option in CompilerMSL::Options just like enable_decoration_binding? If it is approved, I could make a PR to accomplish it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing CompilerMSL::Options::enable_decoration_binding with the requested enable_decoration_location behavior. Review add_msl_resource_binding and CompilerMSL::get_metal_resource_index to understand the existing resource-remapping path. Done means the option automatically preserves DecorationLocation as the MSL buffer index without requiring manual bindings.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.