You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: proposals/compatibility-mode.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ if desc.dimension is "3d":
60
60
set textureBindingViewDimension to "3d"
61
61
```
62
62
63
+
Feature: `texture-views`.
64
+
63
65
**Justification**: OpenGL ES 3.1 does not support texture views.
64
66
65
67
### 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
68
70
69
71
**Justification**: OpenGL ES 3.1 does not support indexed draw buffer state.
70
72
73
+
Feature: `indexed-draw-buffers`. Supported via `GL_EXT_draw_buffers_indexed`, `GL_OES_draw_buffers_indexed`, or OpenGL ES 3.2.
74
+
71
75
### 3. Disallow `CommandEncoder.copyTextureToBuffer()` and `CommandEncoder.copyTextureToTexture()` for compressed texture formats
72
76
`CommandEncoder.copyTextureToBuffer()` and `CommandEncoder.copyTextureToTexture()` of a compressed texture are disallowed, and will result in a validation error.
73
77
74
78
**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()`.
75
79
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
+
76
84
### 4. Disallow `GPUTextureViewDimension``"CubeArray"` via validation
77
85
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.
79
89
80
90
### 5. Views of the same texture used in a single draw may not differ in aspect or mip levels.
81
91
82
92
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.
83
93
84
94
**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.
85
95
96
+
Feature: `texture-views`.
97
+
86
98
### 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.
87
99
88
100
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.
89
101
90
102
**Justification**: OpenGL ES does not support texture views.
91
103
104
+
Feature: `texture-views`.
105
+
92
106
### 7. Disallow `sample_mask` and `sample_index` builtins in WGSL.
93
107
94
108
Use of the `sample_mask` or `sample_index` builtins would cause a validation error at shader module creation time.
95
109
96
110
**Justification**: OpenGL ES 3.1 does not support `gl_SampleMask`, `gl_SampleMaskIn`, or `gl_SampleID`.
97
111
112
+
Feature: `sample-variables`. Supported via `GL_OES_sample_variables` or OpenGL ES 3.2.
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
103
119
104
120
**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.
105
121
122
+
Feature: `storage-texture-rg`.
123
+
106
124
### 9. Depth bias clamp must be zero.
107
125
108
126
During `createRenderPipeline()` and `createRenderPipelineAsync()`, `GPUDepthStencilState.depthBiasClamp` must be zero, or a validation error occurs.
109
127
110
128
**Justification**: GLSL ES 3.1 does not support `glPolygonOffsetClamp()`.
111
129
130
+
Feature: `depth-bias-clamp`. Supported via `GL_EXT_polygon_offset_clamp`.
131
+
112
132
### 10. Lower limits.
113
133
114
134
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
152
172
153
173
**Justification**: OpenGL ES 3.1 does not support `linear` interpolation nor `sample` sampling.
154
174
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
+
155
178
### 12. Disallow copying multisample textures.
156
179
157
180
`copyTextureToTexture` will generate a validation error if the sampleCount of the textures is not 1.
158
181
159
182
**Justification**: OpenGL ES 3.1 does not support copying of multisample textures.
160
183
184
+
Feature: `copy-multisampled-texture-to-texture`. Supported in OpenGL ES 3.2.
185
+
161
186
### 13. Disallow texture format reinterpretation
162
187
163
188
When calling `createTexture`, the `viewFormats`, if specified, must be the same format as the texture.
164
189
165
190
**Justification**: OpenGL ES 3.1 does not support texture format reinterpretation.
166
191
192
+
Feature: `texture-format-reinterpretation`.
193
+
167
194
### 14. Require `depthOrArrayLayers` to be compatible with `textureBindingViewDimension` in `createTexture`.
168
195
169
196
When creating a texture you can pass in a `textureBindingViewDimension`.
@@ -175,10 +202,14 @@ When creating a texture you can pass in a `textureBindingViewDimension`.
175
202
**Justification**: OpenGL ES 3.1 cannot create 2d textures with more than 1 layer nor can it
176
203
create cube maps that are not exactly 6 layers.
177
204
205
+
Feature: `texture-views`.
206
+
178
207
## 15. Disallow bgra8unorm-srgb textures
179
208
180
209
**Justification**: OpenGL ES 3.1 does not support bgra8unorm-srgb textures.
181
210
211
+
Feature: `bgra8unorm-srgb`.
212
+
182
213
## 16. Disallow `textureLoad` with `texture_depth?` textures
183
214
184
215
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.
188
219
189
220
Note: this does not affect textures made with depth formats bound to `texture_2d<f32>`.
190
221
222
+
Feature: `texture-depth-load`.
223
+
191
224
## 17. Disallow `@interpolation(flat)` and `@interpolation(flat, first)`
192
225
193
226
If code is passed to `createShaderModule` that uses `@interpolation(flat)` or `@interpolation(flat, first)`
@@ -197,6 +230,8 @@ generate a validation error.
197
230
other APIs only support the first vertex so only `@interpolation(flat, either)` is supported in
198
231
compatibility mode.
199
232
233
+
Feature: `provoking-vertex-first`.
234
+
200
235
## 18. Introduce new `maxStorageBuffersInVertexStage` and `maxStorageTexturesInVertexStage` limits.
201
236
202
237
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.
228
263
229
264
**Justification**: OpenGL ES 3.1 says such usage has undefined behavior.
230
265
266
+
Feature: `depth-texture-sample`.
267
+
231
268
## 21. Limit the number of texture+sampler combinations in a stage.
232
269
233
270
If the number of texture+sampler combinations used a in single stage in a pipeline exceeds
0 commit comments