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:
parent
f7ee508c94
commit
868b708f71
|
@ -122,6 +122,7 @@ private:
|
|||
UniformLocation m_uniforms;
|
||||
GLuint m_program;
|
||||
int m_nInputs;
|
||||
bool m_bNeedUpdate;
|
||||
};
|
||||
|
||||
void InitShaderCombiner();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user