gpu: make it easier to query Device/Adapter limits correctly

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-11-24 09:55:18 -07:00
parent 661ac75a31
commit 3f51ef6fde

View file

@ -707,9 +707,17 @@ pub const RequiredLimits = extern struct {
limits: Limits,
};
/// Used to query limits from a Device or Adapter. Can be used as follows:
///
/// ```
/// var limits: gpu.SupportedLimits = .{};
/// if (!adapter.getLimits(&limits)) @panic("unsupported options");
/// ```
///
/// Note that `getLimits` can only fail if `next_in_chain` options are invalid.
pub const SupportedLimits = extern struct {
next_in_chain: ?*ChainedStructOut = null,
limits: Limits,
limits: Limits = undefined,
};
pub const VertexBufferLayout = extern struct {