mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 15:30:35 +00:00
Merge pull request #15882 from unknownbrackets/mip-clut
GPU: Share CLUTs if no extended CLUT
This commit is contained in:
commit
64baff080a
@ -1670,7 +1670,7 @@ CheckAlphaResult TextureCacheCommon::ReadIndexedTex(u8 *out, int outPitch, int l
|
||||
|
||||
// Misshitsu no Sacrifice has separate CLUT data, this is a hack to allow it.
|
||||
// Normally separate CLUTs are not allowed for 8-bit or higher indices.
|
||||
const bool mipmapShareClut = gstate.isClutSharedForMipmaps() && gstate.getClutLoadBlocks() == 0x40;
|
||||
const bool mipmapShareClut = gstate.isClutSharedForMipmaps() || gstate.getClutLoadBlocks() != 0x40;
|
||||
const int clutSharingOffset = mipmapShareClut ? 0 : (level & 1) * 256;
|
||||
|
||||
GEPaletteFormat palFormat = (GEPaletteFormat)gstate.getClutPaletteFormat();
|
||||
|
@ -465,6 +465,8 @@ bool TextureCacheD3D11::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level
|
||||
gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE);
|
||||
// We may have blitted to a temp FBO.
|
||||
framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug");
|
||||
if (!retval)
|
||||
ERROR_LOG(G3D, "Failed to get debug texture: copy to memory failed");
|
||||
return retval;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -382,19 +382,8 @@ Draw::DataFormat TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPalet
|
||||
}
|
||||
|
||||
bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
|
||||
GPUgstate saved;
|
||||
if (level != 0) {
|
||||
saved = gstate;
|
||||
|
||||
// The way we set textures is a bit complex. Let's just override level 0.
|
||||
gstate.texsize[0] = gstate.texsize[level];
|
||||
gstate.texaddr[0] = gstate.texaddr[level];
|
||||
gstate.texbufwidth[0] = gstate.texbufwidth[level];
|
||||
}
|
||||
|
||||
InvalidateLastTexture();
|
||||
SetTexture();
|
||||
|
||||
if (!nextTexture_) {
|
||||
if (nextFramebufferTexture_) {
|
||||
VirtualFramebuffer *vfb = nextFramebufferTexture_;
|
||||
@ -427,10 +416,6 @@ bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level)
|
||||
int w = gstate.getTextureWidth(level);
|
||||
int h = gstate.getTextureHeight(level);
|
||||
|
||||
if (level != 0) {
|
||||
gstate = saved;
|
||||
}
|
||||
|
||||
bool result = entry->textureName != nullptr;
|
||||
if (result) {
|
||||
buffer.Allocate(w, h, GE_FORMAT_8888, false);
|
||||
|
@ -777,6 +777,8 @@ bool TextureCacheVulkan::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int leve
|
||||
gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE);
|
||||
// We may have blitted to a temp FBO.
|
||||
framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug");
|
||||
if (!retval)
|
||||
ERROR_LOG(G3D, "Failed to get debug texture: copy to memory failed");
|
||||
return retval;
|
||||
} else {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user