Skip to content

Commit

Permalink
Add Compat Limits to Proposal (gpuweb#4397)
Browse files Browse the repository at this point in the history
* Add Compat Limits Proposal
  • Loading branch information
greggman authored Jan 25, 2024
1 parent 584375a commit 7b23391
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions proposals/compatibility-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,39 @@ During createRenderPipeline(), GPUDepthStencilState.depthBiasClamp must be zero,

**Justification**: GLSL ES 3.1 does not support glPolygonOffsetClamp().

### 10. Lower limits.

The differences in limits between compatibility mode and standard WebGPU
are as follows


| limit | compat | standard | gl limit |
| :---------------------------------- | ------: | --------: | :------------------------------------------- |
| `maxColorAttachments` | 4 | 8 | min(MAX_COLOR_ATTACHMENTS, MAX_DRAW_BUFFERS) |
| `maxComputeInvocationsPerWorkgroup` | 128 | 256 | MAX_COMPUTE_WORK_GROUP_INVOCATIONS |
| `maxComputeWorkgroupSizeX` | 128 | 256 | MAX_COMPUTE_WORK_GROUP_SIZE |
| `maxComputeWorkgroupSizeY` | 128 | 256 | MAX_COMPUTE_WORK_GROUP_SIZE |
| `maxInterStageShaderVariables` | 15 | 16 | MAX_VARYING_VECTORS |
| `maxStorageBuffersPerShaderStage` | 4 | 8 | min(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS) |
| `maxTextureDimension1D` | 4096 | 8192 | MAX_TEXTURE_SIZE |
| `maxTextureDimension2D` | 4096 | 8192 | MAX_TEXTURE_SIZE |
| `maxUniformBufferBindingSize` | 16384 | 65536 | MAX_UNIFORM_BLOCK_SIZE |
| `maxVertexAttributes` | 16<sup>a</sup> | 16 | MAX_VERTEX_ATTRIBS |

(a) In compatibility mode, using `@builtin(vertex_index)`
and/or `@builtin(instance_index)` each count as an
attribute.

Note: Some of the limits are derived from a survey of OpenGL ES 3.1 devices
and are higher than the limit specified in the OpenGL ES 3.1 spec.

For example, in OpenGL ES 3.1, GL_MAX_FRAGMENT_IMAGE_UNIFORMS and GL_MAX_VERTEX_IMAGE_UNIFORMS can be
zero but `maxStorageTexturesPerShaderStage` is 4 above as all 3.1 devices support at
least 4 of each.

Similar limits include GL_MAX_TEXTURE_SIZE (2048) and GL_MAX_3D_TEXTURE_SIZE (256) but actual
devices support the values above.

## Issues

Q: OpenGL ES does not have "coarse" and "fine" variants of the derivative instructions (`dFdx()`, `dFdy()`, `fwidth()`). Should WGSL's "fine" derivatives (`dpdxFine()`, `dpdyFine()`, and `fwidthFine()`) be required to deliver high precision results? See [Issue 4325](https://github.com/gpuweb/gpuweb/issues/4325).
Expand Down

0 comments on commit 7b23391

Please sign in to comment.