Skip to content

Commit

Permalink
Partially revert "Clarify some logic, improve framebuffer names"
Browse files Browse the repository at this point in the history
I screwed up a couple things.

Fixes #13619

This reverts commit 32eb882.
  • Loading branch information
hrydgard committed Nov 3, 2020
1 parent 627be60 commit 3e6d121
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
14 changes: 3 additions & 11 deletions GPU/Common/TextureCacheCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,11 @@ TexCacheEntry *TextureCacheCommon::SetTexture() {
// No texture found, or changed (depending on entry).
// Check for framebuffers.

TextureDefinition def;
TextureDefinition def{};
def.addr = texaddr;
def.dim = dim;
def.format = format;
def.bufw = bufw;
def.swizzled = gstate.isTextureSwizzled();

if (texaddr == 0x40cc000) {
texaddr = texaddr;
}

std::vector<AttachCandidate> candidates = GetFramebufferCandidates(def, 0);
if (candidates.size() > 0) {
Expand Down Expand Up @@ -856,11 +851,9 @@ FramebufferMatchInfo TextureCacheCommon::MatchFramebuffer(
// NOTE: This check is okay because the first texture formats are the same as the buffer formats.
if (entry.format != (GETextureFormat)framebuffer->format) {
WARN_LOG_ONCE(diffFormat1, G3D, "Texturing from framebuffer with different formats %s != %s", GeTextureFormatToString(entry.format), GeBufferFormatToString(framebuffer->format));
return FramebufferMatchInfo{ FramebufferMatch::VALID };
} else {
// TODO: Here we should either change the format of the framebuffer, reinterpreting it,
// or read from it while reinterpreting it. Not sure which is generally best.
return FramebufferMatchInfo{ FramebufferMatch::NO_MATCH };
} else {
return FramebufferMatchInfo{ FramebufferMatch::VALID };
}
} else {
// Apply to buffered mode only.
Expand Down Expand Up @@ -1014,7 +1007,6 @@ bool TextureCacheCommon::SetOffsetTexture(u32 yOffset) {
def.format = fmt;
def.bufw = GetTextureBufw(0, texaddr, fmt);
def.dim = gstate.getTextureDimension(0);
def.swizzled = gstate.isTextureSwizzled();

std::vector<AttachCandidate> candidates = GetFramebufferCandidates(def, texaddrOffset);
if (candidates.size() > 0) {
Expand Down
1 change: 0 additions & 1 deletion GPU/Common/TextureCacheCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ struct TextureDefinition {
GETextureFormat format;
u32 dim;
u32 bufw;
bool swizzled;
};


Expand Down
1 change: 0 additions & 1 deletion GPU/D3D11/TextureCacheD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ void TextureCacheD3D11::BuildTexture(TexCacheEntry *const entry) {
// Don't scale the PPGe texture.
if (entry->addr > 0x05000000 && entry->addr < PSP_GetKernelMemoryEnd())
scaleFactor = 1;

if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) != 0 && scaleFactor != 1) {
// Remember for later that we /wanted/ to scale this texture.
entry->status |= TexCacheEntry::STATUS_TO_SCALE;
Expand Down
8 changes: 4 additions & 4 deletions GPU/GLES/TextureCacheGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) {
}
}

// If GLES3 is available, we can preallocate the storage, which makes texture loading more efficient.
Draw::DataFormat dstFmt = GetDestFormat(GETextureFormat(entry->format), gstate.getClutPaletteFormat());

int scaleFactor = standardScaleFactor_;

// Rachet down scale factor in low-memory mode.
Expand Down Expand Up @@ -532,10 +535,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) {
texelsScaledThisFrame_ += w * h;
}
}

// If GLES3 is available, we can preallocate the storage, which makes texture loading more efficient.
Draw::DataFormat dstFmt = GetDestFormat(GETextureFormat(entry->format), gstate.getClutPaletteFormat());


// GLES2 doesn't have support for a "Max lod" which is critical as PSP games often
// don't specify mips all the way down. As a result, we either need to manually generate
// the bottom few levels or rely on OpenGL's autogen mipmaps instead, which might not
Expand Down

0 comments on commit 3e6d121

Please sign in to comment.