Skip to content

Commit

Permalink
Remove some outdated debugging code (SetDebugTexture)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 13, 2020
1 parent 3dff978 commit 5d5e5fe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
8 changes: 0 additions & 8 deletions GPU/Common/TextureCacheCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,6 @@ void TextureCacheCommon::UpdateMaxSeenV(TexCacheEntry *entry, bool throughMode)
}

TexCacheEntry *TextureCacheCommon::SetTexture(bool force) {
#ifdef DEBUG_TEXTURES
if (SetDebugTexture()) {
// A different texture was bound, let's rebind next time.
InvalidateLastTexture();
return;
}
#endif

if (force) {
InvalidateLastTexture();
}
Expand Down
42 changes: 0 additions & 42 deletions GPU/GLES/TextureCacheGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,48 +282,6 @@ void TextureCacheGLES::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBas
clutLastFormat_ = gstate.clutformat;
}

// #define DEBUG_TEXTURES

#ifdef DEBUG_TEXTURES
bool SetDebugTexture() {
static const int highlightFrames = 30;

static int numTextures = 0;
static int lastFrames = 0;
static int mostTextures = 1;

if (lastFrames != gpuStats.numFlips) {
mostTextures = std::max(mostTextures, numTextures);
numTextures = 0;
lastFrames = gpuStats.numFlips;
}

static GLuint solidTexture = 0;

bool changed = false;
if (((gpuStats.numFlips / highlightFrames) % mostTextures) == numTextures) {
if (gpuStats.numFlips % highlightFrames == 0) {
NOTICE_LOG(G3D, "Highlighting texture # %d / %d", numTextures, mostTextures);
}
static const u32 solidTextureData[] = {0x99AA99FF};

if (solidTexture == 0) {
glGenTextures(1, &solidTexture);
glBindTexture(GL_TEXTURE_2D, solidTexture);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, solidTextureData);
} else {
glBindTexture(GL_TEXTURE_2D, solidTexture);
}
changed = true;
}

++numTextures;
return changed;
}
#endif

void TextureCacheGLES::BindTexture(TexCacheEntry *entry) {
if (entry->textureName != lastBoundTexture) {
render_->BindTexture(0, entry->textureName);
Expand Down

0 comments on commit 5d5e5fe

Please sign in to comment.