summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Tev.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-10-09 20:50:36 +0200
committerdegasus <wickmarkus@web.de>2016-01-06 22:10:29 +0100
commitefbe5bc4b651d1f7f726bb064255e0e2562f7490 (patch)
tree6166a471269a9b1eb2bf703a31c915489e428b44 /Source/Core/VideoBackends/Software/Tev.cpp
parent7fcb5a803b2e6179fe57654496fcea7f6b2ff183 (diff)
VideoSW: Use more VideoCommon
Now we require lots of empty functions, but this removes by far more duplicated code.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Tev.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Tev.cpp49
1 files changed, 12 insertions, 37 deletions
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp
index 7391dfefb3..939b9f98a4 100644
--- a/Source/Core/VideoBackends/Software/Tev.cpp
+++ b/Source/Core/VideoBackends/Software/Tev.cpp
@@ -8,12 +8,13 @@
#include "Common/CommonTypes.h"
#include "VideoBackends/Software/DebugUtil.h"
#include "VideoBackends/Software/EfbInterface.h"
-#include "VideoBackends/Software/SWStatistics.h"
-#include "VideoBackends/Software/SWVideoConfig.h"
#include "VideoBackends/Software/Tev.h"
#include "VideoBackends/Software/TextureSampler.h"
-#include "VideoBackends/Software/XFMemLoader.h"
+
#include "VideoCommon/BoundingBox.h"
+#include "VideoCommon/Statistics.h"
+#include "VideoCommon/VideoConfig.h"
+#include "VideoCommon/XFMemory.h"
#ifdef _DEBUG
#define ALLOW_TEV_DUMPS 1
@@ -509,7 +510,7 @@ void Tev::Draw()
_assert_(Position[0] >= 0 && Position[0] < EFB_WIDTH);
_assert_(Position[1] >= 0 && Position[1] < EFB_HEIGHT);
- INCSTAT(swstats.thisFrame.tevPixelsIn);
+ INCSTAT(stats.thisFrame.tevPixelsIn);
for (unsigned int stageNum = 0; stageNum < bpmem.genMode.numindstages; stageNum++)
{
@@ -527,7 +528,7 @@ void Tev::Draw()
IndirectLod[stageNum], IndirectLinear[stageNum], texmap, IndirectTex[stageNum]);
#if ALLOW_TEV_DUMPS
- if (g_SWVideoConfig.bDumpTevStages)
+ if (g_ActiveConfig.bDumpTevStages)
{
u8 stage[4] = {
IndirectTex[stageNum][TextureSampler::ALP_SMP],
@@ -565,7 +566,7 @@ void Tev::Draw()
TextureSampler::Sample(TexCoord.s, TexCoord.t, TextureLod[stageNum], TextureLinear[stageNum], texmap, texel);
#if ALLOW_TEV_DUMPS
- if (g_SWVideoConfig.bDumpTevTextureFetches)
+ if (g_ActiveConfig.bDumpTevTextureFetches)
DebugUtil::DrawTempBuffer(texel, DIRECT_TFETCH + stageNum);
#endif
@@ -632,7 +633,7 @@ void Tev::Draw()
Reg[ac.dest][ALP_C] = Clamp1024(Reg[ac.dest][ALP_C]);
#if ALLOW_TEV_DUMPS
- if (g_SWVideoConfig.bDumpTevStages)
+ if (g_ActiveConfig.bDumpTevStages)
{
u8 stage[4] = {(u8)Reg[0][RED_C], (u8)Reg[0][GRN_C], (u8)Reg[0][BLU_C], (u8)Reg[0][ALP_C]};
DebugUtil::DrawTempBuffer(stage, DIRECT + stageNum);
@@ -754,7 +755,7 @@ void Tev::Draw()
output[BLU_C] = (output[BLU_C] * invFog + fogInt * bpmem.fog.color.b) >> 8;
}
- bool late_ztest = !bpmem.zcontrol.early_ztest || !g_SWVideoConfig.bZComploc;
+ bool late_ztest = !bpmem.zcontrol.early_ztest || !g_ActiveConfig.bZComploc;
if (late_ztest && bpmem.zmode.testenable)
{
// TODO: Check against hw if these values get incremented even if depth testing is disabled
@@ -773,7 +774,7 @@ void Tev::Draw()
BoundingBox::coords[BoundingBox::BOTTOM] = std::max((u16)Position[1], BoundingBox::coords[BoundingBox::BOTTOM]);
#if ALLOW_TEV_DUMPS
- if (g_SWVideoConfig.bDumpTevStages)
+ if (g_ActiveConfig.bDumpTevStages)
{
for (u32 i = 0; i < bpmem.genMode.numindstages; ++i)
DebugUtil::CopyTempBuffer(Position[0], Position[1], INDIRECT, i, "Indirect");
@@ -781,7 +782,7 @@ void Tev::Draw()
DebugUtil::CopyTempBuffer(Position[0], Position[1], DIRECT, i, "Stage");
}
- if (g_SWVideoConfig.bDumpTevTextureFetches)
+ if (g_ActiveConfig.bDumpTevTextureFetches)
{
for (u32 i = 0; i <= bpmem.genMode.numtevstages; ++i)
{
@@ -792,7 +793,7 @@ void Tev::Draw()
}
#endif
- INCSTAT(swstats.thisFrame.tevPixelsOut);
+ INCSTAT(stats.thisFrame.tevPixelsOut);
EfbInterface::IncPerfCounterQuadCount(PQ_BLEND_INPUT);
EfbInterface::BlendTev(Position[0], Position[1], output);
@@ -810,29 +811,3 @@ void Tev::SetRegColor(int reg, int comp, bool konst, s16 color)
}
}
-void Tev::DoState(PointerWrap &p)
-{
- p.DoArray(Reg);
-
- p.DoArray(KonstantColors);
- p.DoArray(TexColor);
- p.DoArray(RasColor);
- p.DoArray(StageKonst);
-
- p.DoArray(FixedConstants);
- p.Do(AlphaBump);
- p.DoArray(IndirectTex);
- p.Do(TexCoord);
-
- p.DoArray(m_BiasLUT);
- p.DoArray(m_ScaleLShiftLUT);
- p.DoArray(m_ScaleRShiftLUT);
-
- p.DoArray(Position);
- p.DoArray(Color);
- p.DoArray(Uv);
- p.DoArray(IndirectLod);
- p.DoArray(IndirectLinear);
- p.DoArray(TextureLod);
- p.DoArray(TextureLinear);
-}