Skip to content

Commit

Permalink
Temp commit for debugging; do not test on this one.
Browse files Browse the repository at this point in the history
  • Loading branch information
TJnotJT committed Jan 15, 2025
1 parent 6697757 commit 66e3b9a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
6 changes: 5 additions & 1 deletion pcsx2/GS/GSState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int GSState::s_last_transfer_draw_n = 0;
int GSState::s_transfer_n = 0;

#if MY_DEBUG == 1
bool savePoints = true;
bool savePoints = false;
int s_n_debug = -1;
int s_n_exit = -1;
int primID = 0;
Expand Down Expand Up @@ -622,6 +622,10 @@ void GSState::GetTriangleMinMaxUV(int W, int H, bool bilinear, int& minU, int& m
{
#if MY_DEBUG == 1
primID = tri_i;
if (s_n == 58 && tri_i == 1094)
{
printf("\n");
}
#endif
Point verts[3];
for (int vert_i = 0; vert_i < 3; vert_i++)
Expand Down
8 changes: 8 additions & 0 deletions pcsx2/GS/Renderers/Common/GSVertexTraceFMM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ void GSVertexTraceFMM::FindMinMax(GSVertexTrace& vt, const void* vertex, const u
for (; i < (count - 1); i += 2) // 2x loop unroll
{
processVertices(v[index[i + 0]], v[index[i + 1]], true);
if (GSState::s_n == 58)
{
fprintf(stderr, "%d: %f %f %f %f\n", i, tmin.x, tmin.y, tmax.x, tmax.y);
}
if (GSState::s_n == 58 && i == 164)
{
fprintf(stderr, "hi\n");
}
}
if (count & 1)
{
Expand Down
11 changes: 8 additions & 3 deletions pcsx2/GS/Renderers/SW/GSDrawScanline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,13 +640,18 @@ __ri void GSDrawScanline::CDrawScanline(int pixels, int left, int top, const GSV
}
}

// TODO: REMOVE DEBUG CODE
#if MY_DEBUG == 1
int x = left - 4;

#endif
while (1)
{
// TODO: REMOVE DEBUG CODE
#if MY_DEBUG == 1
x += 4;
#endif
if (global.s_n == 58 && top == 188 && (*primIDSW - 1 == 1094))
{
printf("");
}
do
{
int fa = 0, za = 0;
Expand Down
15 changes: 11 additions & 4 deletions pcsx2/GS/Renderers/SW/GSRendererSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

MULTI_ISA_UNSHARED_IMPL;

#define USE_HACK 0

#include "debug.h"

#if MY_DEBUG == 1
Expand Down Expand Up @@ -1079,7 +1081,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
#if MY_DEBUG == 1
fprintf(stderr, "%d\n", s_n);
#endif
if (m_vt.m_primclass == GS_TRIANGLE_CLASS)
if (m_vt.m_primclass == GS_TRIANGLE_CLASS && USE_HACK)
{
int minU = std::numeric_limits<int>::max();
int minV = std::numeric_limits<int>::max();
Expand All @@ -1089,15 +1091,19 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
GetTriangleMinMaxUV(1 << m_context->TEX0.TW, 1 << m_context->TEX0.TH, gd.sel.ltf, minU, minV, maxU, maxV);

r = GSVector4i(minU, minV, maxU + 1, maxV + 1);

#if MY_DEBUG == 1
if (s_n == 58)
{
printf("");
}
GSVector4i r2 = GetTextureMinMax(TEX0, context->CLAMP, gd.sel.ltf, true).coverage;
if (savePoints)
{
pointsHackRange[s_n] = {minU, minV, maxU, maxV};
}
#endif
}
else if (m_vt.m_primclass == GS_SPRITE_CLASS)
else if (m_vt.m_primclass == GS_SPRITE_CLASS && USE_HACK)
{
int minU = std::numeric_limits<int>::max();
int minV = std::numeric_limits<int>::max();
Expand All @@ -1106,13 +1112,14 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
//GetSpriteMinMaxUV(1 << TEX0.TW, 1 << TEX0.TH, gd.sel.ltf, minU, minV, maxU, maxV);
GetSpriteMinMaxUV(1 << m_context->TEX0.TW, 1 << m_context->TEX0.TH, gd.sel.ltf, minU, minV, maxU, maxV);

r = GSVector4i(minU, minV, maxU + 1, maxV + 1);
#if MY_DEBUG == 1
GSVector4i r2 = GetTextureMinMax(TEX0, context->CLAMP, gd.sel.ltf, true).coverage;
if (savePoints)
{
pointsHackRange[s_n] = {minU, minV, maxU, maxV};
}
#endif
r = GSVector4i(minU, minV, maxU + 1, maxV + 1);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/debug.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#pragma once
#define MY_DEBUG 0
#define MY_DEBUG 1

0 comments on commit 66e3b9a

Please sign in to comment.