GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

PostEffect Doesn't clear out constants on shader reload #679

Open jamesu opened 10 years ago

jamesu commented 10 years ago

In the PostEffect class, if you cause the shader to be updated (e.g. by changing a macro via setShaderMacro() or reload()), the shader will be cleared in checkRequirements, but the shader constant buffer (mShaderConsts) and the constants list (mEffectConsts) will not be updated to point to the new shader.

This causes problems in the OpenGL renderer as the constant buffer state becomes out of sync with the shader state. e.g. the render target size may be 0,0 since it still thinks the size is 1024,1024. The Direct3D renderer doesn't appear to be affected by this, possibly because it updates using ranges rather than on a per-constant basis.

LuisAntonRebollo commented 10 years ago

I think this are fixed on #934

@jamesu, what you think?

crabmusket commented 9 years ago

Any update on this?

LuisAntonRebollo commented 9 years ago

Moved to 3.8 for get time to confirm/test.