Skip to content

[naga] Enforce a maximum array size #7383

@andyleiserson

Description

@andyleiserson

We should enforce a maximum array size. Places where this might matter:

  • In the bounds-checking implementation, we are casting between signed and unsigned integers, which implies we may be indexing arrays with signed integers, which would imply a maximum array size of 2^31.
  • The function TypeInner::size returns the size of a type in a u32, which implies a maximum byte size of any array. WGSL attempt to multiply with overflow due to large array #4339 reports an overflow error here due to a large array.

gpuweb#2118 discussed, and gpuweb#3078 set, a limit on array size, although the current spec has different language about the maximum amount of data accessed by a function or shader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    nagaShader Translator

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions