diff --git a/spec/index.bs b/spec/index.bs index d5dc3f0f46..2640e761b7 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -159,6 +159,16 @@ table.data td[colspan] { border-right-style: dotted; } +table.data.no-colspan-center td[colspan], +table.data.no-colspan-center th[colspan] { + text-align: unset; +} + +table.data tr.row-continuation td, +table.data tr.row-continuation th { + border-top: none; +} + /* * Sticky table headers. */ @@ -794,9 +804,9 @@ An [=adapter=] has the following internal slots: : \[[limits]], of type {{GPULimits}}, readonly :: - The [=better|best=] limits which can be used to create devices on this adapter. + The [=limit/better|best=] limits which can be used to create devices on this adapter. - Each adapter limit must be the same or [=better=] than its default value in {{GPULimits}}. + Each adapter [=limit=] must be the same or [=limit/better=] than its default value in {{GPULimits}}. [=Adapters=] are exposed via {{GPUAdapter}}. @@ -828,8 +838,8 @@ A [=device=] has the following internal slots: : \[[limits]], of type {{GPULimits}}, readonly :: - The limits which can be used on this device. - No [=better=] limits can be used, even if the underlying [=adapter=] can support them. + The [=limits=] which can be used on this device. + No [=limit/better=] limits can be used, even if the underlying [=adapter=] can support them.
@@ -849,6 +859,166 @@ A [=device=] has the following internal slots: ### Limits ### {#limits} +Each limit is a numeric limit on the usage of WebGPU on a device. +Each [=adapter=] has a set of supported limits, and [=devices=] are created +with specific limits in place. The device limits are enforced regardless of the +adapter's limits, and default to a strictly-specified [=limit/baseline=]. + +One limit value may be better than another. +For each limit, "better" is defined. + +Note: +Setting "better" limits may not necessarily be desirable. +While they enable strictly more programs to be valid, they may have a performance impact. +Because of this, and to improve portability across devices and implementations, +applications should generally request the "worst" limits that work for their content. + +Each limit also has a baseline value. +Every [=adapter=] is guaranteed to support the baseline value or [=limit/better=]. +The baseline value is also the default value for the limit in {{GPULimits}} if +a better limit is not specified. + + + + + +
{{GPULimitName}} Type [=limit/Better=] [=limit/Baseline=] +
"maxBindGroups" + {{GPUSize32}} Higher 4 +
+ The maximum number of {{GPUBindGroupLayout|GPUBindGroupLayouts}} + allowed in {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxDynamicUniformBuffersPerPipelineLayout" + {{GPUSize32}} Higher 8 +
+ The maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"uniform-buffer"}}, and + - {{GPUBindGroupLayoutEntry/hasDynamicOffset}} is `true`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxDynamicStorageBuffersPerPipelineLayout" + {{GPUSize32}} Higher 4 +
+ The maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}, and + - {{GPUBindGroupLayoutEntry/hasDynamicOffset}} is `true`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxSampledTexturesPerShaderStage" + {{GPUSize32}} Higher 16 +
+ For each possible {{GPUShaderStage}} `stage`, + the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampled-texture"}} or + {{GPUBindingType/"multisampled-texture"}}, and + - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxSamplersPerShaderStage" + {{GPUSize32}} Higher 16 +
+ For each possible {{GPUShaderStage}} `stage`, + the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampler"}} or {{GPUBindingType/"comparison-sampler"}}, and + - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxStorageBuffersPerShaderStage" + {{GPUSize32}} Higher 4 +
+ For each possible {{GPUShaderStage}} `stage`, + the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}, and + - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxStorageTexturesPerShaderStage" + {{GPUSize32}} Higher 4 +
+ For each possible {{GPUShaderStage}} `stage`, + the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"readonly-storage-texture"}} or + {{GPUBindingType/"writeonly-storage-texture"}}, and + - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxUniformBuffersPerShaderStage" + {{GPUSize32}} Higher 12 +
+ For each possible {{GPUShaderStage}} `stage`, + the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: + + - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/uniform-buffer}}, and + - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, + + across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} + when creating a {{GPUPipelineLayout}}. + +
"maxUniformBufferBindingSize" + {{GPUSize32}} Higher 16384 +
+ The maximum {{GPUBufferBinding}}.{{GPUBufferBinding/size}} for bindings + of type {{GPUBindingType/uniform-buffer}}. +
+ +#### GPULimitName #### {#gpulimitname} + +A {{GPULimitName}} identifies a particular [=limit=]. +It is used to query the supported limits on a {{GPUAdapter}}. + + + +#### GPULimits #### {#gpulimits} + +{{GPULimits}} describes the limits with which a device should be created. +See {{GPUDeviceDescriptor/limits|GPUDeviceDescriptor.limits}}. + + + ### Extensions ### {#extensions} @@ -1013,7 +1183,9 @@ To get a {{GPUAdapter}}, use {{GPU/requestAdapter()}}. interface GPUAdapter { readonly attribute DOMString name; readonly attribute FrozenArray extensions; - //readonly attribute GPULimits limits; Don't expose higher limits for now. + + boolean supportsLimit(GPULimitName name, double value); + double getLimit(GPULimitName name); Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); }; @@ -1043,6 +1215,40 @@ interface GPUAdapter { {{GPUAdapter}} has the following methods:
+ : supportsLimit(name, value) + :: + Queries whether a [=limit=] is supported by the adapter. + +
+ **Called on:** {{GPUAdapter}} |this|. + + **Arguments:** +
+                |name|: Name of the limit to query.
+                |value|: Limit value to query for support.
+            
+ + Return `true` if + |this|.{{GPUAdapter/[[adapter]]}}.{{adapter/[[limits]]}}[|name|] + is [=limit/better=] or equal to |value|. Otherwise, return `false`. +
+ + : getLimit(name) + :: + Returns the [=limit/better|best=] [=limit=] value supported by the adapter. + +
+ **Called on:** {{GPUAdapter}} |this|. + + **Arguments:** +
+                |name|: Name of the limit to query.
+            
+ + Return the value of + |this|.{{GPUAdapter/[[adapter]]}}.{{adapter/[[limits]]}}[|name|]. +
+ : requestDevice(descriptor) :: Requests a [=device=] from the [=adapter=]. @@ -1069,11 +1275,11 @@ interface GPUAdapter { is a subset of those in |adapter|.{{adapter/[[extensions]]}}. - - For each type of limit in {{GPULimits}}, - the value of that limit in - |descriptor|.{{GPUDeviceDescriptor/limits}} - is no [=better=] than the value of that limit in - |adapter|.{{adapter/[[limits]]}}. + - For each member |limitName| of {{GPULimitName}}, + the value of + |descriptor|.{{GPUDeviceDescriptor/limits}}[|limitName|] + is no [=limit/better=] than the value of + |adapter|.{{adapter/[[limits]]}}[|limitName|]. where |adapter| is |this|.{{GPUAdapter/[[adapter]]}}.
@@ -1147,140 +1353,6 @@ enum GPUExtensionName { Allows for explicit creation of textures of format {{GPUTextureFormat/"depth32float-stencil8"}}. -#### GPULimits #### {#gpulimits} - -{{GPULimits}} describes various limits in the usage of WebGPU on a device. - -One limit value may be better than another. -For each limit, "better" is defined. - -Note: -Setting "better" limits may not necessarily be desirable. -While they enable strictly more programs to be valid, they may have a performance impact. -Because of this, and to improve portability across devices and implementations, -applications should generally request the "worst" limits that work for their content. - - - -
- : maxBindGroups - :: - The maximum number of {{GPUBindGroupLayout|GPUBindGroupLayouts}} - allowed in {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxDynamicUniformBuffersPerPipelineLayout - :: - The maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"uniform-buffer"}}, and - - {{GPUBindGroupLayoutEntry/hasDynamicOffset}} is `true`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxDynamicStorageBuffersPerPipelineLayout - :: - The maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}, and - - {{GPUBindGroupLayoutEntry/hasDynamicOffset}} is `true`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxSampledTexturesPerShaderStage - :: - For each possible {{GPUShaderStage}} `stage`, - the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampled-texture"}} or - {{GPUBindingType/"multisampled-texture"}}, and - - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxSamplersPerShaderStage - :: - For each possible {{GPUShaderStage}} `stage`, - the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampler"}} or {{GPUBindingType/"comparison-sampler"}}, and - - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxStorageBuffersPerShaderStage - :: - For each possible {{GPUShaderStage}} `stage`, - the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}, and - - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxStorageTexturesPerShaderStage - :: - For each possible {{GPUShaderStage}} `stage`, - the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"readonly-storage-texture"}} or - {{GPUBindingType/"writeonly-storage-texture"}}, and - - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxUniformBuffersPerShaderStage - :: - For each possible {{GPUShaderStage}} `stage`, - the maximum number of {{GPUBindGroupLayoutDescriptor/entries}} for which: - - - {{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/uniform-buffer}}, and - - {{GPUBindGroupLayoutEntry/visibility}} includes `stage`, - - across all {{GPUPipelineLayoutDescriptor/bindGroupLayouts}} - when creating a {{GPUPipelineLayout}}. - - Higher is [=better=]. - - : maxUniformBufferBindingSize - :: - The maximum {{GPUBufferBinding}}.{{GPUBufferBinding/size}} for bindings of type {{GPUBindingType/uniform-buffer}}. - - Higher is [=better=]. -
- ## GPUDevice ## {#gpu-device} A {{GPUDevice}} encapsulates a [=device=] and exposes