evanw / glfx.js

An image effects library for JavaScript using WebGL
https://evanw.github.io/glfx.js/
MIT License
3.28k stars 403 forks source link

Get viewport dimensions without `gl.getParameter` #60

Open Axel-Jacobsen opened 2 years ago

Axel-Jacobsen commented 2 years ago

getParameter can be slow in webGl because it can potentially require a possible flush + round trip: Mozilla Docs

If this is equivalent, removing it increases performance.

edit: draft because I made a mistake with including the previous commit 23bc248 in this PR as well. Leaving it up because I am curious about the response of this.