empaempa / GLOW

GLOW is a WebGL wrapper, which focuses on easy creation and use of shaders.
http://i-am-glow.com
MIT License
244 stars 28 forks source link

Float32Array Textures creation #21

Closed psulat closed 11 years ago

psulat commented 11 years ago

Textures of Float32Array type call texture2D with no width or height

psulat commented 11 years ago

Will do. You are right, it is a state change and we should set it to default if it is not set. I just hate making redundant calls to the GPU if nothing has changed. I'm sure you considered caching state to determine if a call really needs to be made. What are your thoughts, just not worth the effort?

empaempa commented 11 years ago

Yes, there's a cache for states like this but not for flipY, right now. Check out...

https://github.com/empaempa/GLOW/blob/master/src/core/Cache.js

I'm not really worried in this case as textures usually is created at init and not at runtime, and we might actually end up with worse performance if we check the cache. Feel free to implement it as you wish - I have no preference in this case :)