|
1 | 1 | # Change List
|
2 | 2 |
|
| 3 | +* 6.0.0 |
| 4 | + |
| 5 | + Internal change. `gl.pixelStorei` state for `UNPACK_COLORSPACE_CONVERSION_WEBGL` |
| 6 | + `UNPACK_PREMULTIPLY_ALPHA_WEBGL` and `UNPACK_FLIP_Y_WEBGL` |
| 7 | + is now saved and restored as the previous behavior had a race condition. |
| 8 | + |
| 9 | + Before v6.0.0 |
| 10 | + |
| 11 | + ```js |
| 12 | + t1 = twgl.createTexture(gl, {src: 'https://p.com/slow.jpg'}); // may or may not be flipped!!!! |
| 13 | + t2 = twgl.createTexture(gl, {src: 'https://p.com/fast.jpg', flipY: true }); // flipped |
| 14 | + ``` |
| 15 | + |
| 16 | + In the example above, whether or not `t1` is flipped was unknown |
| 17 | + since if `t2` loads first, it would be flipped. If `t1` loads first |
| 18 | + it would not be flipped. |
| 19 | + |
| 20 | + The fix is to save and restore the `pixelStorei` state for each texture. |
| 21 | + |
| 22 | + Unfortunately, this is a breaking change. |
| 23 | + |
| 24 | + Before v6.0.0 |
| 25 | + |
| 26 | + ```js |
| 27 | + twgl.createTexture(gl, {src: someImageElem1, flipY: true }); // flipped |
| 28 | + twgl.createTexture(gl, {src: someImageElem2 }); // also flipped |
| 29 | + ``` |
| 30 | + |
| 31 | + From v6.0.0 on |
| 32 | + |
| 33 | + ```js |
| 34 | + twgl.createTexture(gl, {src: someImage, flipY: true }); // flipped |
| 35 | + twgl.createTexture(gl, {src: someImage }); // NOT flipped |
| 36 | + ``` |
| 37 | + |
| 38 | + Note: in all versions the behavior was and still is, that if you set |
| 39 | + the `pixelStorei` parameters outside they applied. |
| 40 | + |
| 41 | + ```js |
| 42 | + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true) |
| 43 | + twgl.createTexture(gl, {src: someImage }); // flipped |
| 44 | + twgl.createTexture(gl, {src: someImage }); // flipped |
| 45 | + ``` |
| 46 | + |
3 | 47 | * 5.6.0
|
4 | 48 |
|
5 | 49 | Support offsets and shared buffers in uniform block infos.
|
|
0 commit comments