1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Force update shader after load from storage.

Fixed Shader Storage Breaks Fog (Ocarina of Time) #775
This commit is contained in:
Sergey Lipskiy 2015-11-21 22:16:41 +06:00
parent f7ee508c94
commit 868b708f71
2 changed files with 5 additions and 2 deletions

View File

@ -122,6 +122,7 @@ private:
UniformLocation m_uniforms;
GLuint m_program;
int m_nInputs;
bool m_bNeedUpdate;
};
void InitShaderCombiner();

View File

@ -273,13 +273,13 @@ void DestroyShaderCombiner() {
#endif // GL_IMAGE_TEXTURES_SUPPORT
}
ShaderCombiner::ShaderCombiner()
ShaderCombiner::ShaderCombiner() : m_bNeedUpdate(true)
{
m_program = glCreateProgram();
_locate_attributes();
}
ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCombine & _combine) : m_combine(_combine)
ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCombine & _combine) : m_combine(_combine), m_bNeedUpdate(true)
{
char strCombiner[1024];
m_nInputs = compileCombiner(_color, _alpha, strCombiner);
@ -500,6 +500,8 @@ void ShaderCombiner::_locate_attributes() const {
}
void ShaderCombiner::update(bool _bForce) {
_bForce |= m_bNeedUpdate;
m_bNeedUpdate = false;
glUseProgram(m_program);
if (_bForce) {