mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-24 21:39:35 +00:00
Fix shader texture uniforms update for GLES2.
Fixed issue #586. Thanks Gillou68310 for the hint.
This commit is contained in:
parent
12bc0c928d
commit
b897c449a1
|
@ -295,8 +295,8 @@ void CombinerInfo::updateLightParameters()
|
|||
gSP.changed &= ~CHANGED_LIGHT;
|
||||
}
|
||||
|
||||
void CombinerInfo::updateParameters()
|
||||
void CombinerInfo::updateParameters(OGLRender::RENDER_STATE _renderState)
|
||||
{
|
||||
if (m_pUniformCollection != NULL)
|
||||
m_pUniformCollection->updateUniforms(m_pCurrent);
|
||||
m_pUniformCollection->updateUniforms(m_pCurrent, _renderState);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
void updateTextureParameters();
|
||||
void updateLightParameters();
|
||||
// Update uniforms for GL without UniformBlock support
|
||||
void updateParameters();
|
||||
void updateParameters(OGLRender::RENDER_STATE _renderState);
|
||||
|
||||
private:
|
||||
CombinerInfo() : m_bChanged(false), m_pCurrent(NULL) {}
|
||||
|
|
|
@ -763,7 +763,7 @@ void FrameBufferList::renderBuffer(u32 _address)
|
|||
textureCache().activateTexture(0, pBuffer->m_pTexture);
|
||||
gSP.textureTile[0]->fuls = gSP.textureTile[0]->fult = 0.0f;
|
||||
currentCombiner()->updateTextureInfo(true);
|
||||
CombinerInfo::get().updateParameters();
|
||||
CombinerInfo::get().updateParameters(OGLRender::rsTexRect);
|
||||
|
||||
glScissor(0, 0, ogl.getScreenWidth(), ogl.getScreenHeight() + ogl.getHeightOffset());
|
||||
|
||||
|
|
|
@ -126,14 +126,13 @@ void UniformSet::_updateLightUniforms(UniformSetLocation & _location, bool _bFor
|
|||
}
|
||||
}
|
||||
|
||||
void UniformSet::updateUniforms(ShaderCombiner * _pCombiner)
|
||||
void UniformSet::updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState)
|
||||
{
|
||||
UniformSetLocation & location = m_uniforms.at(_pCombiner->getMux());
|
||||
|
||||
_updateColorUniforms(location, false);
|
||||
|
||||
OGLRender::RENDER_STATE rs = video().getRender().getRenderState();
|
||||
if ((rs == OGLRender::rsTriangle || rs == OGLRender::rsLine) && _pCombiner->usesTexture())
|
||||
if ((_renderState == OGLRender::rsTriangle || _renderState == OGLRender::rsLine) && _pCombiner->usesTexture())
|
||||
_updateTextureUniforms(location, _pCombiner->usesTile(0), _pCombiner->usesTile(1), false);
|
||||
|
||||
if (_pCombiner->usesTexture())
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data) {}
|
||||
virtual void updateTextureParameters() {}
|
||||
virtual void updateLightParameters() {}
|
||||
virtual void updateUniforms(ShaderCombiner * _pCombiner);
|
||||
virtual void updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState);
|
||||
|
||||
private:
|
||||
struct fv3Uniform {
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data);
|
||||
virtual void updateTextureParameters();
|
||||
virtual void updateLightParameters();
|
||||
virtual void updateUniforms(ShaderCombiner * _pCombiner) {}
|
||||
virtual void updateUniforms(ShaderCombiner * /*_pCombiner*/, OGLRender::RENDER_STATE /*_renderState*/) {}
|
||||
|
||||
private:
|
||||
void _initTextureBuffer(GLuint _program);
|
||||
|
|
|
@ -634,7 +634,7 @@ void OGLRender::_updateStates(RENDER_STATE _renderState) const
|
|||
gDP.changed &= ~(CHANGED_RENDERMODE | CHANGED_CYCLETYPE);
|
||||
}
|
||||
|
||||
cmbInfo.updateParameters();
|
||||
cmbInfo.updateParameters(_renderState);
|
||||
}
|
||||
|
||||
void OGLRender::_setColorArray() const
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
virtual void setColorData(ColorUniforms _index, u32 _dataSize, const void * _data) = 0;
|
||||
virtual void updateTextureParameters() = 0;
|
||||
virtual void updateLightParameters() = 0;
|
||||
virtual void updateUniforms(ShaderCombiner * _pCombiner) = 0;
|
||||
virtual void updateUniforms(ShaderCombiner * _pCombiner, OGLRender::RENDER_STATE _renderState) = 0;
|
||||
};
|
||||
|
||||
UniformCollection * createUniformCollection();
|
||||
|
|
Loading…
Reference in New Issue
Block a user