WebGLSamples / WebGL2Samples

Short and easy to understand samples demonstrating WebGL 2 features
Other
1.01k stars 143 forks source link

Should samples favour using immutable textures? #151

Open tsherif opened 7 years ago

tsherif commented 7 years ago

The spec suggests (section 3.7.6) that they should be preferred over mutable textures. If it's considered best practice, perhaps the samples should use them exclusively?

kenrussell commented 7 years ago

That'd be great. The memory savings on some platforms can be significant.

tsherif commented 7 years ago

Shannon Woods also mentioned that she saw reduced CPU overhead in ANGLE: https://twitter.com/ShannonIn3D/status/544915451940442112

Update should be straightforward, since I don't think any of the samples are resizing textures. It might be nice to have at least one example of generating mipmaps for an immutable texture, since it's a little more involved (here's the code that handles it in PicoGL).

tsherif commented 7 years ago

Just made an equivalent update to my WebGL 2 Examples: https://github.com/tsherif/webgl2examples/commit/667f69ed5b00e9f4f9f411c745a07e22334b43d9