diff --git a/dist/index.d.ts b/dist/index.d.ts index 7565bb16..4d1fa52a 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -675,7 +675,7 @@ interface GPUBufferBinding { interface GPUBufferBindingLayout { /** - * Indicates the type required for buffers bound to this bindings. + * Indicates the type required for buffers bound to this binding. */ type?: GPUBufferBindingType; /** @@ -1098,9 +1098,11 @@ interface GPUPipelineLayoutDescriptor | null | undefined >; - /** * The size in bytes of the immediate data range. + * + * **PROPOSED** in [Immediates](https://github.com/gpuweb/gpuweb/pull/5423). + * Check support before using. (Use the non-null assertion operator `!` where needed.) */ immediateSize?: GPUSize32; } @@ -1455,16 +1457,35 @@ interface GPURenderPipelineDescriptor interface GPURequestAdapterOptions { /** - * "Feature level" for the adapter request. + * Requests an adapter that supports at least a particular set of capabilities. + * This influences the {@link adapter#[[default feature level]]} of devices created + * from this adapter. The capabilities for each level are defined below, and the exact + * steps are defined in {@link GPU#requestAdapter} and "a new device". + * If the implementation or system does not support all of the capabilities in the + * requested feature level, {@link GPU#requestAdapter} will return `null`. + * Note: + * Applications should typically make a single {@link GPU#requestAdapter} call with the lowest + * feature level they support, then inspect the adapter for additional capabilities they can + * use optionally, and request those in {@link GPUAdapter#requestDevice}. * The allowed feature level string values are: *
* : "core" - * No effect. + * The following set of capabilities: + * - The limit/Default limits. + * - {@link GPUFeatureName} `"core-features-and-limits"`. + * Note: + * Adapters with this {@link adapter#[[default feature level]]} may + * conventionally be referred to as "Core-defaulting". * : "compatibility" - * No effect. + * The following set of capabilities: + * - The limit/Compatibility Mode Default limits. + * - No features. (It excludes the {@link GPUFeatureName} `"core-features-and-limits"` feature.) + * If the implementation cannot enforce the stricter "Compatibility Mode" + * validation rules, {@link GPU#requestAdapter} will ignore this request and + * treat it as a request for feature level string/"core". * Note: - * This value is reserved for future use as a way to opt into additional validation restrictions. - * Applications should not use this value at this time. + * Adapters with this {@link adapter#[[default feature level]]} may + * conventionally be referred to as "Compatibility-defaulting". */ featureLevel?: string; /** @@ -1765,20 +1786,20 @@ interface GPUTextureDescriptor * * Formats in this list must be texture view format compatible with the texture format. *
- * Two {@link GPUTextureFormat}s `format` and `viewFormat` are texture view format compatible if: + * Two {@link GPUTextureFormat}s `format` and `viewFormat` are texture view format compatible on a given `device` if: * - `format` equals `viewFormat`, or - * - `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix). + * - `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix) and `device.features` list/contains {@link GPUFeatureName} `"core-features-and-limits"`. *
*/ viewFormats?: Iterable; /** - * **PROPOSED** in [Compatibility Mode](https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md). - * - * > [In compatibility mode,] - * > When specifying a texture, a textureBindingViewDimension property - * > determines the views which can be bound from that texture for sampling. - * > Binding a view of a different dimension for sampling than specified at - * > texture creation time will cause a validation error. + *
+ * On devices without {@link GPUFeatureName} `"core-features-and-limits"`, + * views created from this texture must have this as their {@link GPUTextureViewDescriptor#dimension}. + * If not specified, a default is chosen. + *
+ * On devices with {@link GPUFeatureName} `"core-features-and-limits"`, + * this is ignored, and there is no such restriction. */ textureBindingViewDimension?: GPUTextureViewDimension; } @@ -1937,8 +1958,11 @@ interface GPUBindingCommandsMixin { * `data` is a `TypedArray` and bytes otherwise. Defaults to 0. * @param size - Size of content to write from `data` to `buffer`. Given in elements if * `data` is a `TypedArray` and bytes otherwise. + * + * **PROPOSED** in [Immediates](https://github.com/gpuweb/gpuweb/pull/5423). + * Check support before using. (Use the non-null assertion operator `!` where needed.) */ - setImmediates( + setImmediates?( rangeOffset: GPUSize32, data: GPUAllowSharedBufferSource, dataOffset?: GPUSize64, @@ -2191,14 +2215,16 @@ interface GPUAdapterInfo { * If the "subgroups" feature is supported, the minimum supported subgroup size for the * adapter. * - * TODO: Temporarily optional until all browsers have implemented it. + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) */ readonly subgroupMinSize?: number; /** * If the "subgroups" feature is supported, the maximum supported subgroup size for the * adapter. * - * TODO: Temporarily optional until all browsers have implemented it. + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) */ readonly subgroupMaxSize?: number; /** @@ -3175,7 +3201,27 @@ interface GPUSupportedLimits { readonly maxSampledTexturesPerShaderStage: number; readonly maxSamplersPerShaderStage: number; readonly maxStorageBuffersPerShaderStage: number; + /** + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) + */ + readonly maxStorageBuffersInVertexStage?: number; + /** + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) + */ + readonly maxStorageBuffersInFragmentStage?: number; readonly maxStorageTexturesPerShaderStage: number; + /** + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) + */ + readonly maxStorageTexturesInVertexStage?: number; + /** + * @todo Temporarily optional until all browsers have implemented it. + * Check support before using. (Use the non-null assertion operator `!` where needed.) + */ + readonly maxStorageTexturesInFragmentStage?: number; readonly maxUniformBuffersPerShaderStage: number; readonly maxUniformBufferBindingSize: number; readonly maxStorageBufferBindingSize: number; @@ -3194,16 +3240,11 @@ interface GPUSupportedLimits { readonly maxComputeWorkgroupSizeY: number; readonly maxComputeWorkgroupSizeZ: number; readonly maxComputeWorkgroupsPerDimension: number; - /** **PROPOSED** in [Immediates](https://github.com/gpuweb/gpuweb/pull/5423). */ - readonly maxImmediateSize: number; - /** **PROPOSED** in [Compatibility Mode](https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md). */ - readonly maxStorageBuffersInVertexStage?: number; - /** **PROPOSED** in [Compatibility Mode](https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md). */ - readonly maxStorageBuffersInFragmentStage?: number; - /** **PROPOSED** in [Compatibility Mode](https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md). */ - readonly maxStorageTexturesInVertexStage?: number; - /** **PROPOSED** in [Compatibility Mode](https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md). */ - readonly maxStorageTexturesInFragmentStage?: number; + /** + * **PROPOSED** in [Immediates](https://github.com/gpuweb/gpuweb/pull/5423). + * Check support before using. (Use the non-null assertion operator `!` where needed.) + */ + readonly maxImmediateSize?: number; } declare var GPUSupportedLimits: { @@ -3258,6 +3299,22 @@ interface GPUTexture * The allowed usages for this {@link GPUTexture}. */ readonly usage: GPUFlagsConstant; + /** + * On devices without "core-features-and-limits", views created from this + * texture must have this as their dimension. + * + * On devices with "core-features-and-limits", this is undefined, and there is + * no such restriction. + * + * @todo Temporarily optional until all browsers have implemented it. + * It is safe to access on any browser, as it will just (correctly) return + * `undefined` if not implemented. Note, depending on the device, `undefined` + * is a valid value even in browsers that implement this attribute. (So be + * careful if using the non-null assertion operator `!` on this.) + */ + readonly textureBindingViewDimension?: + | GPUTextureViewDimension + | undefined; } declare var GPUTexture: { diff --git a/generated/index.d.ts b/generated/index.d.ts index a3dbf9a0..b2d360f3 100644 --- a/generated/index.d.ts +++ b/generated/index.d.ts @@ -675,7 +675,7 @@ interface GPUBufferBinding { interface GPUBufferBindingLayout { /** - * Indicates the type required for buffers bound to this bindings. + * Indicates the type required for buffers bound to this binding. */ type?: GPUBufferBindingType; /** @@ -1450,16 +1450,35 @@ interface GPURenderPipelineDescriptor interface GPURequestAdapterOptions { /** - * "Feature level" for the adapter request. + * Requests an adapter that supports at least a particular set of capabilities. + * This influences the {@link adapter/{@link https://www.w3.org/TR/webgpu/default feature level}} of devices created + * from this adapter. The capabilities for each level are defined below, and the exact + * steps are defined in {@link GPU#requestAdapter} and "a new device". + * If the implementation or system does not support all of the capabilities in the + * requested feature level, {@link GPU#requestAdapter} will return `null`. + * Note: + * Applications should typically make a single {@link GPU#requestAdapter} call with the lowest + * feature level they support, then inspect the adapter for additional capabilities they can + * use optionally, and request those in {@link GPUAdapter#requestDevice}. * The allowed feature level string values are: *
* : "core" - * No effect. + * The following set of capabilities: + * - The limit/Default limits. + * - {@link GPUFeatureName} `"core-features-and-limits"`. + * Note: + * Adapters with this {@link adapter/{@link https://www.w3.org/TR/webgpu/default feature level}} may + * conventionally be referred to as "Core-defaulting". * : "compatibility" - * No effect. + * The following set of capabilities: + * - The limit/Compatibility Mode Default limits. + * - No features. (It excludes the {@link GPUFeatureName} `"core-features-and-limits"` feature.) + * If the implementation cannot enforce the stricter "Compatibility Mode" + * validation rules, {@link GPU#requestAdapter} will ignore this request and + * treat it as a request for feature level string/"core". * Note: - * This value is reserved for future use as a way to opt into additional validation restrictions. - * Applications should not use this value at this time. + * Adapters with this {@link adapter/{@link https://www.w3.org/TR/webgpu/default feature level}} may + * conventionally be referred to as "Compatibility-defaulting". */ featureLevel?: string; powerPreference?: GPUPowerPreference; @@ -1469,7 +1488,7 @@ interface GPURequestAdapterOptions { interface GPUSamplerBindingLayout { /** - * Indicates the required type of a sampler bound to this bindings. + * Indicates the required type of a sampler bound to this binding. */ type?: GPUSamplerBindingType; } @@ -1731,12 +1750,22 @@ interface GPUTextureDescriptor * * Formats in this list must be texture view format compatible with the texture format. *
- * Two {@link GPUTextureFormat}s `format` and `viewFormat` are texture view format compatible if: + * Two {@link GPUTextureFormat}s `format` and `viewFormat` are texture view format compatible on a given `device` if: * - `format` equals `viewFormat`, or - * - `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix). + * - `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix) and `device.features` list/contains {@link GPUFeatureName} `"core-features-and-limits"`. *
*/ viewFormats?: Iterable; + /** + *
+ * On devices without {@link GPUFeatureName} `"core-features-and-limits"`, + * views created from this texture must have this as their {@link GPUTextureViewDescriptor#dimension}. + * If not specified, a default is chosen. + *
+ * On devices with {@link GPUFeatureName} `"core-features-and-limits"`, + * this is ignored, and there is no such restriction. + */ + textureBindingViewDimension?: GPUTextureViewDimension; } interface GPUTextureViewDescriptor @@ -2910,7 +2939,11 @@ interface GPUSupportedLimits { readonly maxSampledTexturesPerShaderStage: number; readonly maxSamplersPerShaderStage: number; readonly maxStorageBuffersPerShaderStage: number; + readonly maxStorageBuffersInVertexStage: number; + readonly maxStorageBuffersInFragmentStage: number; readonly maxStorageTexturesPerShaderStage: number; + readonly maxStorageTexturesInVertexStage: number; + readonly maxStorageTexturesInFragmentStage: number; readonly maxUniformBuffersPerShaderStage: number; readonly maxUniformBufferBindingSize: number; readonly maxStorageBufferBindingSize: number; @@ -2959,6 +2992,9 @@ interface GPUTexture readonly dimension: GPUTextureDimension; readonly format: GPUTextureFormat; readonly usage: GPUFlagsConstant; + readonly textureBindingViewDimension: + | GPUTextureViewDimension + | undefined; } declare var GPUTexture: { diff --git a/gpuweb b/gpuweb index 423b28bf..630ca2ae 160000 --- a/gpuweb +++ b/gpuweb @@ -1 +1 @@ -Subproject commit 423b28bfdf8ac2e5307ef0b6e0e68d6d14c2d3bd +Subproject commit 630ca2ae057701eb55c5bdf7a26efdb023e8d154