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

Refactor: remove combiner update methods from CombinerInfo and call them

directly for ShaderCombiner object.
This commit is contained in:
Sergey Lipskiy 2014-09-02 20:05:53 +07:00
parent 9d692cc7ae
commit 2e5ad21ddd
5 changed files with 11 additions and 47 deletions

View File

@ -117,41 +117,6 @@ void CombinerInfo::destroy()
m_combiners.clear();
}
void CombinerInfo::updateCombineColors()
{
m_pCurrent->UpdateColors();
gDP.changed &= ~CHANGED_COMBINE_COLORS;
}
void CombinerInfo::updateCombineFBInfo()
{
m_pCurrent->UpdateFBInfo(true);
gDP.changed &= ~CHANGED_FB_TEXTURE;
}
void CombinerInfo::updateCombineDepthInfo()
{
if (m_pCurrent != NULL)
m_pCurrent->UpdateDepthInfo(true);
}
void CombinerInfo::updateAlphaTestInfo()
{
if (m_pCurrent != NULL)
m_pCurrent->UpdateAlphaTestInfo();
}
void CombinerInfo::updateTextureInfo()
{
if (m_pCurrent != NULL)
m_pCurrent->UpdateTextureInfo();
}
void CombinerInfo::updateRenderState() {
if (m_pCurrent != NULL)
m_pCurrent->UpdateRenderState();
}
static
void SimplifyCycle( CombineCycle *cc, CombinerStage *stage )
{

View File

@ -118,12 +118,6 @@ class CombinerInfo
{
public:
void init();
void updateCombineColors();
void updateCombineFBInfo();
void updateCombineDepthInfo();
void updateAlphaTestInfo();
void updateTextureInfo();
void updateRenderState();
void setCombine( u64 mux );
void destroy();

View File

@ -9,6 +9,7 @@
#include "VI.h"
#include "Textures.h"
#include "Combiner.h"
#include "GLSLCombiner.h"
#include "Types.h"
#include "Config.h"
#include "Debug.h"
@ -425,7 +426,7 @@ void FrameBuffer_AttachDepthBuffer()
#endif
assert(checkFBO());
}
CombinerInfo::get().updateCombineDepthInfo();
CombinerInfo::get().getCurrent()->UpdateDepthInfo(true);
}
#ifndef GLES2

View File

@ -621,6 +621,8 @@ void ShaderCombiner::UpdateColors(bool _bForce) {
const int nDither = (gDP.otherMode.colorDither == 2 || gDP.otherMode.alphaDither == 2 || gDP.otherMode.alphaCompare == 3) ? 1 : 0;
if ((m_nInputs & (1<<NOISE)) + nDither != 0)
_setFUniform(m_uniforms.uNoiseTime, (float)(rand()&255), _bForce);
gDP.changed &= ~CHANGED_COMBINE_COLORS;
}
void ShaderCombiner::UpdateTextureInfo(bool _bForce) {
@ -680,6 +682,8 @@ void ShaderCombiner::UpdateFBInfo(bool _bForce) {
}
_setIUniform(m_uniforms.uFb8Bit, nFb8bitMode, _bForce);
_setIUniform(m_uniforms.uFbFixedAlpha, nFbFixedAlpha, _bForce);
gDP.changed &= ~CHANGED_FB_TEXTURE;
}
void ShaderCombiner::UpdateDepthInfo(bool _bForce) {

View File

@ -794,7 +794,7 @@ void OGL_UpdateStates()
}
if ((gDP.changed & (CHANGED_ALPHACOMPARE|CHANGED_RENDERMODE|CHANGED_BLENDCOLOR)) != 0)
CombinerInfo::get().updateAlphaTestInfo();
CombinerInfo::get().getCurrent()->UpdateAlphaTestInfo();
if (gDP.changed & CHANGED_SCISSOR)
{
@ -827,10 +827,10 @@ void OGL_UpdateStates()
}
if (gDP.changed & CHANGED_FB_TEXTURE)
CombinerInfo::get().updateCombineFBInfo();
CombinerInfo::get().getCurrent()->UpdateFBInfo(true);
if ((gDP.changed & CHANGED_RENDERMODE) || (gSP.geometryMode & G_ZBUFFER))
CombinerInfo::get().updateCombineDepthInfo();
CombinerInfo::get().getCurrent()->UpdateDepthInfo(true);
if ((gDP.changed & CHANGED_RENDERMODE) || (gDP.changed & CHANGED_CYCLETYPE))
{
@ -957,7 +957,7 @@ void OGL_DrawTriangles()
OGL_UpdateCullFace();
OGL_UpdateViewport();
glEnable(GL_SCISSOR_TEST);
CombinerInfo::get().updateRenderState();
CombinerInfo::get().getCurrent()->UpdateRenderState();
}
CombinerInfo::get().getCurrent()->UpdateColors(true);
@ -985,7 +985,7 @@ void OGL_DrawLine(int v0, int v1, float width )
OGL_UpdateCullFace();
OGL_UpdateViewport();
OGL.renderState = GLInfo::rsLine;
CombinerInfo::get().updateRenderState();
CombinerInfo::get().getCurrent()->UpdateRenderState();
}
unsigned short elem[2];