Skip to content

Commit

Permalink
Software: Remove config to disable ZComploc and ZFreeze
Browse files Browse the repository at this point in the history
These aren't particularly useful, and make the code a bit more confusing.  If for some reason someone wants to test what happens when these functions are disabled, it's easier to just edit the code that implements them.  They aren't exposed in the UI, so one would need to restart Dolphin to do it anyways.
  • Loading branch information
Pokechu22 committed Dec 1, 2021
1 parent 7f39871 commit 93a203c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Source/Core/Core/Config/GraphicsSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ const Info<int> GFX_SHADER_PRECOMPILER_THREADS{
const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE{
{System::GFX, "Settings", "SaveTextureCacheToState"}, true};

const Info<bool> GFX_SW_ZCOMPLOC{{System::GFX, "Settings", "SWZComploc"}, true};
const Info<bool> GFX_SW_ZFREEZE{{System::GFX, "Settings", "SWZFreeze"}, true};
const Info<bool> GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false};
const Info<bool> GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false};
const Info<bool> GFX_SW_DUMP_TEV_TEX_FETCHES{{System::GFX, "Settings", "SWDumpTevTexFetches"},
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/Config/GraphicsSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ extern const Info<int> GFX_SHADER_COMPILER_THREADS;
extern const Info<int> GFX_SHADER_PRECOMPILER_THREADS;
extern const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE;

extern const Info<bool> GFX_SW_ZCOMPLOC;
extern const Info<bool> GFX_SW_ZFREEZE;
extern const Info<bool> GFX_SW_DUMP_OBJECTS;
extern const Info<bool> GFX_SW_DUMP_TEV_STAGES;
extern const Info<bool> GFX_SW_DUMP_TEV_TEX_FETCHES;
Expand Down
17 changes: 13 additions & 4 deletions Source/Core/VideoBackends/Software/Rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,21 @@ static void Draw(s32 x, s32 y, s32 xi, s32 yi)
{
INCSTAT(g_stats.this_frame.rasterized_pixels);

float dx = vertexOffsetX + (float)(x - vertex0X);
float dy = vertexOffsetY + (float)(y - vertex0Y);
float dx, dy;
if (!bpmem.genMode.zfreeze)
{
dx = vertexOffsetX + (float)(x - vertex0X);
dy = vertexOffsetY + (float)(y - vertex0Y);
}
else
{
dx = x;
dy = y;
}

s32 z = (s32)std::clamp<float>(ZSlope.GetValue(dx, dy), 0.0f, 16777215.0f);

if (bpmem.UseEarlyDepthTest() && g_ActiveConfig.bZComploc)
if (bpmem.UseEarlyDepthTest())
{
// TODO: Test if perf regs are incremented even if test is disabled
EfbInterface::IncPerfCounterQuadCount(PQ_ZCOMP_INPUT_ZCOMPLOC);
Expand Down Expand Up @@ -357,7 +366,7 @@ void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v
// SWVertexLoader (via VertexManagerBase) manually updates the slope if CullMode::All is in use,
// which works since many games use that to draw an invisible reference triangle, but there are
// other cases where this may fail.
if (!bpmem.genMode.zfreeze || !g_ActiveConfig.bZFreeze)
if (!bpmem.genMode.zfreeze)
InitSlope(&ZSlope, v0->screenPosition[2], v1->screenPosition[2], v2->screenPosition[2], fltdx31,
fltdx12, fltdy12, fltdy31);

Expand Down
3 changes: 1 addition & 2 deletions Source/Core/VideoBackends/Software/Tev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,7 @@ void Tev::Draw()
output[BLU_C] = (output[BLU_C] * invFog + fogInt * bpmem.fog.color.b) >> 8;
}

const bool late_ztest = !bpmem.zcontrol.early_ztest || !g_ActiveConfig.bZComploc;
if (late_ztest && bpmem.zmode.testenable)
if (bpmem.UseLateDepthTest())
{
// TODO: Check against hw if these values get incremented even if depth testing is disabled
EfbInterface::IncPerfCounterQuadCount(PQ_ZCOMP_INPUT);
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/VideoCommon/VideoConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ void VideoConfig::Refresh()
iShaderCompilerThreads = Config::Get(Config::GFX_SHADER_COMPILER_THREADS);
iShaderPrecompilerThreads = Config::Get(Config::GFX_SHADER_PRECOMPILER_THREADS);

bZComploc = Config::Get(Config::GFX_SW_ZCOMPLOC);
bZFreeze = Config::Get(Config::GFX_SW_ZFREEZE);
bDumpObjects = Config::Get(Config::GFX_SW_DUMP_OBJECTS);
bDumpTevStages = Config::Get(Config::GFX_SW_DUMP_TEV_STAGES);
bDumpTevTextureFetches = Config::Get(Config::GFX_SW_DUMP_TEV_TEX_FETCHES);
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/VideoCommon/VideoConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ struct VideoConfig final
// VideoSW Debugging
int drawStart = 0;
int drawEnd = 0;
bool bZComploc = false;
bool bZFreeze = false;
bool bDumpObjects = false;
bool bDumpTevStages = false;
bool bDumpTevTextureFetches = false;
Expand Down

0 comments on commit 93a203c

Please sign in to comment.