Skip to content

Limit the binding number for resources #1783

Closed

Description

@kvark

Following #1721, there is an issue uncovered that making the binding numbers implicit would effectively require all the implementations to do binding re-mapping. This re-mapping can only be done at pipeline creation time, and thus precludes creating SPIR-V shader modules earlier.

Thinking about a compromise, we could say that binding numbers are limited to 65535 (similar to the overridable constant indices). This should allow a non-remapping implementation to reason about binding numbers at shader module creation time.

Activity

  1. Kangz commented on May 31, 2021

    @Kangz
    Contributor

    This seems fine, as in it helps your implementation and doesn't lose developer flexiblity. (and we can reduce some u32 to u16 in implementations too :))

  2. kvark commented on May 31, 2021

    @kvark
    ContributorAuthor

    There are still details to be figured out, like what binding indices would be assigned. Maybe if the external texture binding is x, then the associated textures would be x + 0x10000, x + 0x20000, etc. Seems doable, but we'll probably have to keep u32 :)

  3. kainino0x commented on Jun 7, 2021

    @kainino0x
    Contributor

    Resolution: accept. Easy to lift the restriction later if it ultimately turns out not to be necessary. Firefox to see whether it turns out to be unnecessary (e.g. because passing sparse layouts to the driver turns out to be slow).

  4. Kangz commented on Aug 20, 2021

    @Kangz
    Contributor

    This restriction hasn't been added in the spec yet, and the WGSL spec still says "non-negative i32 literal".

  5. added this to the V1.0 milestone on Sep 2, 2021
  6. added a commit that references this issue on Nov 10, 2021
    ca56bfe
  7. added a commit that references this issue on Nov 16, 2021
    2836fd9
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions