mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Refactor: remove combiner update methods from CombinerInfo and call them
directly for ShaderCombiner object.
This commit is contained in:
parent
9d692cc7ae
commit
2e5ad21ddd
35
Combiner.cpp
35
Combiner.cpp
|
@ -117,41 +117,6 @@ void CombinerInfo::destroy()
|
||||||
m_combiners.clear();
|
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
|
static
|
||||||
void SimplifyCycle( CombineCycle *cc, CombinerStage *stage )
|
void SimplifyCycle( CombineCycle *cc, CombinerStage *stage )
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,12 +118,6 @@ class CombinerInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
void updateCombineColors();
|
|
||||||
void updateCombineFBInfo();
|
|
||||||
void updateCombineDepthInfo();
|
|
||||||
void updateAlphaTestInfo();
|
|
||||||
void updateTextureInfo();
|
|
||||||
void updateRenderState();
|
|
||||||
void setCombine( u64 mux );
|
void setCombine( u64 mux );
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "VI.h"
|
#include "VI.h"
|
||||||
#include "Textures.h"
|
#include "Textures.h"
|
||||||
#include "Combiner.h"
|
#include "Combiner.h"
|
||||||
|
#include "GLSLCombiner.h"
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
|
@ -425,7 +426,7 @@ void FrameBuffer_AttachDepthBuffer()
|
||||||
#endif
|
#endif
|
||||||
assert(checkFBO());
|
assert(checkFBO());
|
||||||
}
|
}
|
||||||
CombinerInfo::get().updateCombineDepthInfo();
|
CombinerInfo::get().getCurrent()->UpdateDepthInfo(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GLES2
|
#ifndef GLES2
|
||||||
|
|
|
@ -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;
|
const int nDither = (gDP.otherMode.colorDither == 2 || gDP.otherMode.alphaDither == 2 || gDP.otherMode.alphaCompare == 3) ? 1 : 0;
|
||||||
if ((m_nInputs & (1<<NOISE)) + nDither != 0)
|
if ((m_nInputs & (1<<NOISE)) + nDither != 0)
|
||||||
_setFUniform(m_uniforms.uNoiseTime, (float)(rand()&255), _bForce);
|
_setFUniform(m_uniforms.uNoiseTime, (float)(rand()&255), _bForce);
|
||||||
|
|
||||||
|
gDP.changed &= ~CHANGED_COMBINE_COLORS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderCombiner::UpdateTextureInfo(bool _bForce) {
|
void ShaderCombiner::UpdateTextureInfo(bool _bForce) {
|
||||||
|
@ -680,6 +682,8 @@ void ShaderCombiner::UpdateFBInfo(bool _bForce) {
|
||||||
}
|
}
|
||||||
_setIUniform(m_uniforms.uFb8Bit, nFb8bitMode, _bForce);
|
_setIUniform(m_uniforms.uFb8Bit, nFb8bitMode, _bForce);
|
||||||
_setIUniform(m_uniforms.uFbFixedAlpha, nFbFixedAlpha, _bForce);
|
_setIUniform(m_uniforms.uFbFixedAlpha, nFbFixedAlpha, _bForce);
|
||||||
|
|
||||||
|
gDP.changed &= ~CHANGED_FB_TEXTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderCombiner::UpdateDepthInfo(bool _bForce) {
|
void ShaderCombiner::UpdateDepthInfo(bool _bForce) {
|
||||||
|
|
10
OpenGL.cpp
10
OpenGL.cpp
|
@ -794,7 +794,7 @@ void OGL_UpdateStates()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gDP.changed & (CHANGED_ALPHACOMPARE|CHANGED_RENDERMODE|CHANGED_BLENDCOLOR)) != 0)
|
if ((gDP.changed & (CHANGED_ALPHACOMPARE|CHANGED_RENDERMODE|CHANGED_BLENDCOLOR)) != 0)
|
||||||
CombinerInfo::get().updateAlphaTestInfo();
|
CombinerInfo::get().getCurrent()->UpdateAlphaTestInfo();
|
||||||
|
|
||||||
if (gDP.changed & CHANGED_SCISSOR)
|
if (gDP.changed & CHANGED_SCISSOR)
|
||||||
{
|
{
|
||||||
|
@ -827,10 +827,10 @@ void OGL_UpdateStates()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDP.changed & CHANGED_FB_TEXTURE)
|
if (gDP.changed & CHANGED_FB_TEXTURE)
|
||||||
CombinerInfo::get().updateCombineFBInfo();
|
CombinerInfo::get().getCurrent()->UpdateFBInfo(true);
|
||||||
|
|
||||||
if ((gDP.changed & CHANGED_RENDERMODE) || (gSP.geometryMode & G_ZBUFFER))
|
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))
|
if ((gDP.changed & CHANGED_RENDERMODE) || (gDP.changed & CHANGED_CYCLETYPE))
|
||||||
{
|
{
|
||||||
|
@ -957,7 +957,7 @@ void OGL_DrawTriangles()
|
||||||
OGL_UpdateCullFace();
|
OGL_UpdateCullFace();
|
||||||
OGL_UpdateViewport();
|
OGL_UpdateViewport();
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
CombinerInfo::get().updateRenderState();
|
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||||
}
|
}
|
||||||
|
|
||||||
CombinerInfo::get().getCurrent()->UpdateColors(true);
|
CombinerInfo::get().getCurrent()->UpdateColors(true);
|
||||||
|
@ -985,7 +985,7 @@ void OGL_DrawLine(int v0, int v1, float width )
|
||||||
OGL_UpdateCullFace();
|
OGL_UpdateCullFace();
|
||||||
OGL_UpdateViewport();
|
OGL_UpdateViewport();
|
||||||
OGL.renderState = GLInfo::rsLine;
|
OGL.renderState = GLInfo::rsLine;
|
||||||
CombinerInfo::get().updateRenderState();
|
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short elem[2];
|
unsigned short elem[2];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user