← 输入框|github.com|刷新
Skip to content

maxBindingsPerBindGroup has arbitrary limit of 640 #3864

Closed

Description

@mwyrzykowski

I read over the discussion in #3279 but what is the usefulness of having a limit which is arbitrary if the purpose of the limit is to avoid driver issues with large binding indices?

Why not set this limit exactly to (max bindings per shader stage × max shader stages per pipeline) which I believe is 112 with default limits?

Or if there is a reason to use a higher limit, why not select such a value in a non-arbitrary fashion as opposed to something which is funny which seems unprofessional in a publicly documented W3C specification. E.g., at what point do the drivers have issues? > 2^16 - 1 or much lower?

Activity

  1. Kangz commented on Mar 6, 2023

    @Kangz
    Contributor

    In general I have a concern about how many limits we are starting to have that intersect each other: it will not be sufficient for developers to raise a single one, like maxColorAttachments, maxFragmentCombinedOutputResources and maxColorAttachmentBytesPerSample. So we'll be teaching developers to just directly copy the adapter limits into the requestDevice call and not check / raise individual limits. Setting a "low" value of maxBindingsPerBindGroup runs into the same issue, although the current value is still a small-ish number compared to the previous 2^16-1. (a large space helps developers easily choose binding numbers automatically in such a way that they don't conflict).

    It isn't clear exactly when drivers start having issues, and these issues are something an implementation could paper over by compacting pipeline layouts (and requiring a pipeline layout to generate SPIR-V on these drivers). But to help implementations, while still having a large space for developers, we agreed to a lower limit for now, in between 112 and 2^16-1 so an arbitrary number was picked. It was 640 because it is a number with a relatively known connotation of being arbitrary in comp sci culture.

  2. kainino0x commented on Mar 8, 2023

    @kainino0x
    Contributor

    Why not set this limit exactly to (max bindings per shader stage × max shader stages per pipeline) which I believe is 112 with default limits?

    There's a possible design for bindless in which the max bindings per shader stage limits become extremely large. I don't remember if that's why we decided to add a new limit but I think it is a good reason.

    Agreed with @Kangz's concerns though, the intersecting limits definitely need more thought.

  3. added this to the V1.0 milestone on Mar 8, 2023
  4. kainino0x commented on Mar 15, 2023

    @kainino0x
    Contributor

    Re: 112: also, as was pointed out by someone in the meeting, there is significant value in being able to use sparse binding indices - we just wanted to make the sparse space reasonably-sized.

  5. kainino0x commented on Mar 15, 2023

    @kainino0x
    Contributor

    Bindless is an argument not to just remove this limit from the limits struct and validate against max bindings per shader stage * 10 or something though.

  6. greggman commented on Mar 15, 2023

    @greggman
    Member

    I'm probably wrong but it seemed like no matter what is picked, 512, 640, 641, 789, 1000, 1024, the choice will be arbitrary. As such, if people are going to wonder "why this limit?" it seemed like adding a "why" section would be useful. (or not?) That, was my takeaway.

  7. mwyrzykowski commented on Mar 23, 2023

    @mwyrzykowski
    Author

    @litherum and I discussed internally and we would like to propose an arbitrary limit of 1000. Adding the "why" section seems useful as well.

  8. added
    needs-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
    copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)
    on Apr 4, 2023
  9. kainino0x commented on Apr 4, 2023

    @kainino0x
    Contributor

    I believe we resolved to use 1000. Moving to 'editorial' to implement that.
    https://github.com/gpuweb/gpuweb/wiki/Minutes-2023-03-15

  10. self-assigned this
    on Apr 18, 2023
  11. removed
    needs-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
    on Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions