From 7936ff082bd0d018bbf85128b7ea68a901260cd7 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 12 Dec 2025 11:51:25 -0800 Subject: [PATCH] Add Compat Changes Compat related limits are official, not proposed. textureBindingViewDimension is property of GPUTexture --- dist/index.d.ts | 37 ++++++++++++++++-------------- generated/index.d.ts | 54 ++++++++++++++++++++++++++++++++++++-------- gpuweb | 2 +- 3 files changed, 66 insertions(+), 27 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 7565bb16..1c9d90aa 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; /** @@ -1503,7 +1503,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; } @@ -1772,13 +1772,13 @@ interface GPUTextureDescriptor */ 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; } @@ -3175,7 +3175,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; @@ -3196,14 +3200,6 @@ interface GPUSupportedLimits { 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; } declare var GPUSupportedLimits: { @@ -3258,6 +3254,13 @@ interface GPUTexture * The allowed usages for this {@link GPUTexture}. */ readonly usage: GPUFlagsConstant; + /** + * On devices without {@link GPUFeatureName} `"core-features-and-limits"` + * the only view dimension when used as a TEXTURE_BINDING. + */ + 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..33fd3471 160000 --- a/gpuweb +++ b/gpuweb @@ -1 +1 @@ -Subproject commit 423b28bfdf8ac2e5307ef0b6e0e68d6d14c2d3bd +Subproject commit 33fd347160db60f7bbaf195e90dc4b838242ee04