mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Avoid calling FindReplacement unnecessarily.
This commit is contained in:
parent
97c9b9e4f7
commit
9a228b1f23
@ -531,11 +531,11 @@ TexCacheEntry *TextureCacheCommon::SetTexture() {
|
||||
int w0 = gstate.getTextureWidth(0);
|
||||
int h0 = gstate.getTextureHeight(0);
|
||||
int d0 = 1;
|
||||
ReplacedTexture *replaced = FindReplacement(entry, &w0, &h0, &d0);
|
||||
if (replaced) {
|
||||
if (entry->replacedTexture) {
|
||||
PollReplacement(entry, &w0, &h0, &d0);
|
||||
// This texture is pending a replacement load.
|
||||
// So check the replacer if it's reached a conclusion.
|
||||
switch (replaced->State()) {
|
||||
switch (entry->replacedTexture->State()) {
|
||||
case ReplacementState::NOT_FOUND:
|
||||
// Didn't find a replacement, so stop looking.
|
||||
// DEBUG_LOG(G3D, "No replacement for texture %dx%d", w0, h0);
|
||||
|
@ -389,7 +389,8 @@ protected:
|
||||
CheckAlphaResult DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, TexDecodeFlags flags);
|
||||
void UnswizzleFromMem(u32 *dest, u32 destPitch, const u8 *texptr, u32 bufw, u32 height, u32 bytesPerPixel);
|
||||
CheckAlphaResult ReadIndexedTex(u8 *out, int outPitch, int level, const u8 *texptr, int bytesPerIndex, int bufw, bool reverseColors, bool expandTo32Bit);
|
||||
ReplacedTexture *FindReplacement(TexCacheEntry *entry, int &w, int &h, int &d);
|
||||
ReplacedTexture *FindReplacement(TexCacheEntry *entry, int *w, int *h, int *d);
|
||||
void PollReplacement(TexCacheEntry *entry, int *w, int *h, int *d);
|
||||
|
||||
// Return value is mapData normally, but could be another buffer allocated with AllocateAlignedMemory.
|
||||
void LoadTextureLevel(TexCacheEntry &entry, uint8_t *mapData, size_t dataSize, int mapRowPitch, BuildTexturePlan &plan, int srcLevel, Draw::DataFormat dstFmt, TexDecodeFlags texDecFlags);
|
||||
|
Loading…
Reference in New Issue
Block a user