@@ -1366,9 +1366,8 @@ WebGPU
1366
1366
1367
1367
{{{example url="../webgpu-cube-multiple.html"}}}
1368
1368
1369
- The important part to take away is that unlike WebGL, you'll need unique uniform buffers for
1370
- any uniforms that are object specific (like a world matrix), and, because of that you also
1371
- need a unique bind group per object.
1369
+ The important part to take away is that unlike WebGL, you'll need uniform buffers for
1370
+ any uniforms that are object specific (like a world matrix), and, because of that you also may need a unique bind group per object.
1372
1371
1373
1372
## Other random differences
1374
1373
@@ -1387,7 +1386,7 @@ corner in both WebGL and WebGPU. On the other hand, setting the viewport or scis
1387
1386
### WGSL uses ` @builtin(???) ` for GLSL's ` gl_XXX ` variables.
1388
1387
1389
1388
` gl_FragCoord ` is ` @builtin(position) myVarOrField: vec4f ` and unlike
1390
- WebGL goes down the screen instead of up so 0,0 is the top left vs WebGL where 0,0 is the bottom left.
1389
+ WebGL, goes down the screen instead of up so 0,0 is the top left vs WebGL where 0,0 is the bottom left.
1391
1390
1392
1391
` gl_VertexID ` is ` @builtin(vertex_index) myVarOrField: u32 `
1393
1392
@@ -1410,6 +1409,14 @@ different GPU would clip or not clip based on the center of the point. So, it's
1410
1409
a good thing WebGPU doesn't support points of sizes other than 1.
1411
1410
This forces you to implement a portable point solution.
1412
1411
1412
+ ### WebGPU optimizations are different than WebGL
1413
+
1414
+ If you take a WebGL app and directly convert it to WebGPU you might find
1415
+ it runs slower. To get the benefits of WebGPU you'll need to change the
1416
+ way you organize and optimize how you draw.
1417
+ See [ this article on WebGPU optimization] ( webgpu-optimization.html ) for
1418
+ ideas.
1419
+
1413
1420
---
1414
1421
1415
1422
If you were already familiar with WebGL then I hope this article was useful.
0 commit comments