Skip to content

[SPIR-V] Automatically map SV_BaseVertexLocation/SV_StartInstanceLocation to BaseVertex/BaseInstance #6671

Closed

Description

Description

Shader model 6.8 added two new semantics to refer to the base instance and vertex index of a draw call within a vertex shader. #2907 explicitly mentions that they are semanitcally equal to the SPIR-V builtin variables BaseVertex and BaseInstance. As a result I was a bit surprised that they are currently not mapped automatically to those when compiling to SPIR-V. Instead attempting to compile a shader produces the error semantic SV_StartInstanceLocation unimplemented. To fix this, I manually have to specify the [[vk::builtin("BaseInstance")]] attribute, which then produces a warning if I attempt to compile the shader for DXIL.

Steps to Reproduce

https://godbolt.org/z/xP5Mzev9P

Actual Behavior

As the semanitcs are equal, I would expect them to be mapped automatically to their SPIR-V builtin counterparts, without the explicit attribute.

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.2405.15 (fd7e54b); dxil.dll: 1.8(101.8.2405.17)
  • Windows 10 Pro 22H2

Activity

  1. added
    bug
    needs-triage
    spirv
    on Jun 5, 2024
  2. changed the title [-][SPIR-V] Automatically map SV_BaseVertexLocation/SV_StartInstanceLocation to BaseVertex/BaseVertex[/-] [+][SPIR-V] Automatically map SV_BaseVertexLocation/SV_StartInstanceLocation to BaseVertex/BaseInstance[/+] on Jun 5, 2024
  3. added
    sm6.8
    enhancement
    and removed
    bug
    needs-triage
    on Jun 6, 2024
  4. Keenuts commented on Jun 6, 2024

    @Keenuts
    Collaborator

    Hi!
    Thanks for the feedback! I added this in our SM6.8 task list.
    Right now our team is a bit short of staff so I cannot give a time estimate, but we'll get to that eventually. 😊

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

Metadata

Metadata

Labels

enhancementsm6.8spirv

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions