Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1f6ee9

Browse files
committed
Add Features for all Compat Mode limitations.
Naming these now will allow Core-only browsers to safely support all Compatibility mode extensions. A non-exhaustive effort was made to explore OpenGL extension support for these features.
1 parent 73a75f5 commit b1f6ee9

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

proposals/compatibility-mode.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ if desc.dimension is "3d":
6060
set textureBindingViewDimension to "3d"
6161
```
6262

63+
Feature: `texture-views`.
64+
6365
**Justification**: OpenGL ES 3.1 does not support texture views.
6466

6567
### 2. Color blending state may not differ between color attachments in a `GPUFragmentState`.
@@ -68,33 +70,47 @@ Each `GPUColorTargetState` in a `GPUFragmentState` must have the same `blend.alp
6870

6971
**Justification**: OpenGL ES 3.1 does not support indexed draw buffer state.
7072

73+
Feature: `indexed-draw-buffers`. Supported via `GL_EXT_draw_buffers_indexed`, `GL_OES_draw_buffers_indexed`, or OpenGL ES 3.2.
74+
7175
### 3. Disallow `CommandEncoder.copyTextureToBuffer()` and `CommandEncoder.copyTextureToTexture()` for compressed texture formats
7276
`CommandEncoder.copyTextureToBuffer()` and `CommandEncoder.copyTextureToTexture()` of a compressed texture are disallowed, and will result in a validation error.
7377

7478
**Justification**: Compressed texture formats are non-renderable in OpenGL ES, and `glReadPixels()` requires a framebuffer-complete FBO, preventing `copyTextureToBuffer()`. Additionally, because ES 3.1 does not support `glCopyImageSubData()`, texture-to-texture copies must be worked around with `glBlitFramebuffer()`. Since compressed textures are not renderable, they cannot use the `glBlitFramebuffer()` workaround, preventing implementation of `copyTextureToTexture()`.
7579

80+
Feature: `copy-compressed-texture-to-buffer`.
81+
82+
Feature: `copy-compressed-texture-to-texture`. Supported via `GL_EXT_copy_image` or OpenGL ES 3.2.
83+
7684
### 4. Disallow `GPUTextureViewDimension` `"CubeArray"` via validation
7785

78-
**Justification**: OpenGL ES does not support Cube Array textures.
86+
**Justification**: OpenGL ES 3.1 does not support Cube Array textures.
87+
88+
Feature: `cube-map-array`. Supported via `GL_EXT_texture_cube_map_array` or OpenGL ES 3.2.
7989

8090
### 5. Views of the same texture used in a single draw may not differ in aspect or mip levels.
8191

8292
A draw call may not bind two views of the same texture differing in `aspect`, `baseMipLevel`, or `mipLevelCount`. Only a single aspect and mip level range per texture is supported. This is enforced via validation at draw time.
8393

8494
**Justification**: OpenGL ES does not support texture views, but one set of these parameters per texture is supported via glTexParameteri(). In particular, one depth/stencil aspect may be specified via `GL_DEPTH_STENCIL_TEXTURE_MODE`, and one mip level subset via the `GL_TEXTURE_BASE_LEVEL` and `GL_TEXTURE_MAX_LEVEL` parameters.
8595

96+
Feature: `texture-views`.
97+
8698
### 6. Array texture views used in bind groups must consist of the entire array. That is, `baseArrayLayer` must be zero, and `arrayLayerCount` must be equal to the size of the texture array.
8799

88100
A bind group may not reference a subset of array layers. Only views of the entire array are supported for sampling or storage bindings. This is enforced via validation at bind group creation time.
89101

90102
**Justification**: OpenGL ES does not support texture views.
91103

104+
Feature: `texture-views`.
105+
92106
### 7. Disallow `sample_mask` and `sample_index` builtins in WGSL.
93107

94108
Use of the `sample_mask` or `sample_index` builtins would cause a validation error at shader module creation time.
95109

96110
**Justification**: OpenGL ES 3.1 does not support `gl_SampleMask`, `gl_SampleMaskIn`, or `gl_SampleID`.
97111

112+
Feature: `sample-variables`. Supported via `GL_OES_sample_variables` or OpenGL ES 3.2.
113+
98114
### 8. Disallow two-component (RG) texture formats in storage texture bindings.
99115

100116
The `rg32uint`, `rg32sint`, and `rg32float` texture formats no longer support the `"write-only" or "read-only" STORAGE_BINDING` capability by default.
@@ -103,12 +119,16 @@ Calls to `createTexture()` or `createBindGroupLayout()` with this combination ca
103119

104120
**Justification**: GLSL ES 3.1 (section 4.4.7, "Format Layout Qualifiers") does not permit any two-component (RG) texture formats in a format layout qualifier.
105121

122+
Feature: `storage-texture-rg`.
123+
106124
### 9. Depth bias clamp must be zero.
107125

108126
During `createRenderPipeline()` and `createRenderPipelineAsync()`, `GPUDepthStencilState.depthBiasClamp` must be zero, or a validation error occurs.
109127

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

130+
Feature: `depth-bias-clamp`. Supported via `GL_EXT_polygon_offset_clamp`.
131+
112132
### 10. Lower limits.
113133

114134
The differences in limits between compatibility mode and standard WebGPU
@@ -152,18 +172,25 @@ If either are used in the code passed to `createShaderModule` a validation error
152172

153173
**Justification**: OpenGL ES 3.1 does not support `linear` interpolation nor `sample` sampling.
154174

175+
Feature: `linear-interpolation-type`. Supported via the `noperspective` interpolation qualifier in desktop GLSL.
176+
Feature: `sample-interpolation-mode`. supported via `GL_OES_shader_multisample_interpolation` or OpenGL ES 3.2.
177+
155178
### 12. Disallow copying multisample textures.
156179

157180
`copyTextureToTexture` will generate a validation error if the sampleCount of the textures is not 1.
158181

159182
**Justification**: OpenGL ES 3.1 does not support copying of multisample textures.
160183

184+
Feature: `copy-multisampled-texture-to-texture`. Supported in OpenGL ES 3.2.
185+
161186
### 13. Disallow texture format reinterpretation
162187

163188
When calling `createTexture`, the `viewFormats`, if specified, must be the same format as the texture.
164189

165190
**Justification**: OpenGL ES 3.1 does not support texture format reinterpretation.
166191

192+
Feature: `texture-format-reinterpretation`.
193+
167194
### 14. Require `depthOrArrayLayers` to be compatible with `textureBindingViewDimension` in `createTexture`.
168195

169196
When creating a texture you can pass in a `textureBindingViewDimension`.
@@ -175,10 +202,14 @@ When creating a texture you can pass in a `textureBindingViewDimension`.
175202
**Justification**: OpenGL ES 3.1 cannot create 2d textures with more than 1 layer nor can it
176203
create cube maps that are not exactly 6 layers.
177204

205+
Feature: `texture-views`.
206+
178207
## 15. Disallow bgra8unorm-srgb textures
179208

180209
**Justification**: OpenGL ES 3.1 does not support bgra8unorm-srgb textures.
181210

211+
Feature: `bgra8unorm-srgb`.
212+
182213
## 16. Disallow `textureLoad` with `texture_depth?` textures
183214

184215
If a `texture_depth`, `texture_depth_2d_array`, or `texture_depth_cube` are used in a `textureLoad` call
@@ -188,6 +219,8 @@ in code passed to `createShaderModule` a validation error is generated.
188219

189220
Note: this does not affect textures made with depth formats bound to `texture_2d<f32>`.
190221

222+
Feature: `texture-depth-load`.
223+
191224
## 17. Disallow `@interpolation(flat)` and `@interpolation(flat, first)`
192225

193226
If code is passed to `createShaderModule` that uses `@interpolation(flat)` or `@interpolation(flat, first)`
@@ -197,6 +230,8 @@ generate a validation error.
197230
other APIs only support the first vertex so only `@interpolation(flat, either)` is supported in
198231
compatibility mode.
199232

233+
Feature: `provoking-vertex-first`.
234+
200235
## 18. Introduce new `maxStorageBuffersInVertexStage` and `maxStorageTexturesInVertexStage` limits.
201236

202237
If the number of shader variables of type `storage_buffer` in a vertex shader exceeds the `maxStorageBuffersInVertexStage` limit, a validation error will occur at pipeline creation time.
@@ -228,6 +263,8 @@ sampler in a shader will generate a validation error at pipeline creation time.
228263

229264
**Justification**: OpenGL ES 3.1 says such usage has undefined behavior.
230265

266+
Feature: `depth-texture-sample`.
267+
231268
## 21. Limit the number of texture+sampler combinations in a stage.
232269

233270
If the number of texture+sampler combinations used a in single stage in a pipeline exceeds

0 commit comments

Comments
 (0)