Module limits

Module limits 

Source
Expand description

Functionality related to device and adapter limits.

Β§Limit Bucketing

Web browsers make various information about their operating environment available to content to provide a better experience. For example, content is able to detect whether the device has a touch-screen, in order to provide an appropriate user interface.

Browser fingerprinting employs this information for the purpose of constructing a unique β€œfingerprint” value that is unique to a single browser or shared among a relatively small number of browsers. Fingerprinting can be used for various purposes, including to identify and track users across different websites.

Limit bucketing can reduce the ability to fingerprint users based on GPU hardware characteristics when using wgpu in applications like a web browser.

When limit bucketing is enabled, the adapter limits offered by wgpu do not necessarily reflect the exact capabilities of the hardware. Instead, the hardware capabilities are rounded down to one of several pre-defined buckets. The goal of doing this is for there to be enough devices assigned to each bucket that knowledge of which bucket applies is minimally useful for fingerprinting.

Limit bucketing may be requested by setting apply_limit_buckets in [wgt::RequestAdapterOptions] or by setting apply_limit_buckets to true when calling enumerate_adapters.

If your application does not expose wgpu to untrusted content, limit bucketing is not necessary.

StructsΒ§

Bucket πŸ”’
BucketedAdapterInfo πŸ”’
Fields in [wgt::AdapterInfo] relevant to limit bucketing.
FailedLimit

ConstantsΒ§

BUCKET_A1 πŸ”’
BUCKET_A2 πŸ”’
BUCKET_DEFAULT πŸ”’
BUCKET_FALLBACK πŸ”’
BUCKET_I1 πŸ”’
BUCKET_LLVMPIPE πŸ”’
BUCKET_M1 πŸ”’
BUCKET_N1 πŸ”’
BUCKET_NO_F16 πŸ”’
BUCKET_WARP πŸ”’
EXEMPT_FEATURES πŸ”’
These features are left alone by limit bucketing. They will be exposed to higher layers whenever the device supports them, and they are not considered when determining bucket compatibility.
UPLEVEL πŸ”’

FunctionsΒ§

apply_limit_buckets
Apply limit bucketing to the adapter limits and features in raw.
buckets πŸ”’
Return the defined adapter feature/limit buckets
check_limits πŸ”’