Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Video_Software: Toggable zfreeze and early_z support for testing.
  • Loading branch information
neobrain committed Feb 15, 2013
1 parent 8923f0e commit 183ad0c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/Plugins/Plugin_VideoSoftware/Src/Rasterizer.cpp
Expand Up @@ -125,7 +125,7 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi)
if (z < 0 || z > 0x00ffffff)
return;

if (bpmem.zcontrol.early_ztest && bpmem.zmode.testenable)
if (bpmem.zcontrol.early_ztest && bpmem.zmode.testenable && g_SWVideoConfig.bZComploc)
{
// early z
if (!EfbInterface::ZCompare(x, y, z))
Expand Down
7 changes: 7 additions & 0 deletions Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.cpp
Expand Up @@ -35,6 +35,9 @@ SWVideoConfig::SWVideoConfig()
bDumpObjects = false;
bDumpFrames = false;

bZComploc = true;
bZFreeze = true;

bDumpTevStages = false;
bDumpTevTextureFetches = false;

Expand All @@ -52,6 +55,8 @@ void SWVideoConfig::Load(const char* ini_file)
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);

iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, false);
iniFile.Get("Rendering", "ZComploc", &bZComploc, true);
iniFile.Get("Rendering", "ZFreeze", &bZFreeze, true);

iniFile.Get("Info", "ShowStats", &bShowStats, false);

Expand All @@ -74,6 +79,8 @@ void SWVideoConfig::Save(const char* ini_file)
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);

iniFile.Set("Rendering", "HwRasterizer", bHwRasterizer);
iniFile.Set("Rendering", "ZComploc", &bZComploc);
iniFile.Set("Rendering", "ZFreeze", &bZFreeze);

iniFile.Set("Info", "ShowStats", bShowStats);

Expand Down
4 changes: 4 additions & 0 deletions Source/Plugins/Plugin_VideoSoftware/Src/SWVideoConfig.h
Expand Up @@ -36,6 +36,10 @@ struct SWVideoConfig : NonCopyable

bool bHwRasterizer;

// Emulation features
bool bZComploc;
bool bZFreeze;

bool bShowStats;

bool bDumpTextures;
Expand Down
11 changes: 6 additions & 5 deletions Source/Plugins/Plugin_VideoSoftware/Src/Tev.cpp
Expand Up @@ -784,11 +784,12 @@ void Tev::Draw()
output[BLU_C] = (output[BLU_C] * invFog + fogInt * bpmem.fog.color.b) >> 8;
}

if (!bpmem.zcontrol.early_ztest && bpmem.zmode.testenable)
{
if (!EfbInterface::ZCompare(Position[0], Position[1], Position[2]))
return;
}
bool late_ztest = !bpmem.zcontrol.early_ztest || g_SWVideoConfig.bZComploc;
if (late_ztest && bpmem.zmode.testenable)
{
if (!EfbInterface::ZCompare(Position[0], Position[1], Position[2]))
return;
}

#if ALLOW_TEV_DUMPS
if (g_SWVideoConfig.bDumpTevStages)
Expand Down

0 comments on commit 183ad0c

Please sign in to comment.