Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] allow users to access gl_InstanceIndex #3479

Closed
jaebaek opened this issue Feb 19, 2021 · 1 comment
Closed

[SPIR-V] allow users to access gl_InstanceIndex #3479

jaebaek opened this issue Feb 19, 2021 · 1 comment
Labels
spirv Work related to SPIR-V

Comments

@jaebaek
Copy link
Collaborator

jaebaek commented Feb 19, 2021

This issue is from #3361 (comment)

Could the gl_InstanceIndex be exposed directly as a built in ([[vk::builtin("InstanceIndex")]])?
I'm using DXC to generate Vulkan shaders for PC where I want the functionality of gl_InstanceIndex with a non-zero BaseInstance. A built-in would allow SV_InstanceID to continue to work as is, while also allowing a shader access to the built-in SPIR-V BaseInstance and InstanceIndex variables. The SPIR-V DXC documentation is currently incorrect, because it states SV_InstanceID maps to the InstanceIndex built-in, with no mention of the "correction" applied to align it with DX12 semantics.

@sudonatalie
Copy link
Collaborator

Requests for new language features (including Vulkan-specific attributes) now fall under the scope of the microsoft/hlsl-specs repository, and access to arbitrary SPIR-V builtin inputs is being considered as part of the Update to inline SPIR-V proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spirv Work related to SPIR-V
Projects
None yet
Development

No branches or pull requests

2 participants