Skip to content

Add SV_BaseVertexLocation and SV_StartInstanceLocation to VSIn #2907

Closed

Description

@tex3d

These would return the index start offsets passed to DrawIndexedInstanced in the corresponding BaseVertexLocation and StartInstanceLocation arguments. GLSL has the equivalent values: gl_BaseVertex and gl_BaseInstance. While the names are long, they match the API, and consistency is important.

These have been an ongoing request, and can save extra root argument overhead required to get these without built-in support.

edited to fix BaseVertexLocation name (StartVertexLocation is from DrawInstanced, not DrawIndexedInstanced).

Activity

  1. AdamJMiles commented on May 26, 2020

    @AdamJMiles
    Member

    While we do have StartInstanceLocation in the API, the other one I think corresponds to BaseVertexLocation? There's no 'StartVertexLocation' in the Draw command API.

  2. sebbbi commented on May 28, 2020

    @sebbbi

    DrawIndexedInstanced arguments and the indirect argument struct has these:

      UINT IndexCountPerInstance,
      UINT InstanceCount,
      UINT StartIndexLocation,
      INT  BaseVertexLocation,
      UINT StartInstanceLocation
    

    gl_BaseInstance = StartInstanceLocation
    gl_BaseVertex = BaseVertexLocation

  3. otanter-at-ubi commented on Jun 8, 2020

    @otanter-at-ubi
    Contributor

    I second all of these. We've asked for them a few years ago at the xfest.

  4. changed the title [-]Add SV_StartVertexLocation and SV_StartInstanceLocation to VSIn[/-] [+]Add SV_BaseVertexLocation and SV_StartInstanceLocation to VSIn[/+] on Aug 6, 2020
  5. lijianwen13 commented on May 14, 2023

    @lijianwen13

    I think it's very important for us to build cross-platform game engines.

  6. yuriy-odonnell-epic commented on Jun 3, 2023

    @yuriy-odonnell-epic
    Contributor

    +1e9 to this. Implementing advanced cross-platform GPU-driven rendering techniques is extremely inconvenient without automatic SV_StartInstanceLocation. Workarounds exist, but they're very yucky.

  7. kingofthebongo2008 commented on Jul 19, 2023

    @kingofthebongo2008
    Contributor

    something about this?
    if someone wants to help, where one can look?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsm6.8

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions