Qt: Remove old texture debug API.

No one's testing it and it's not the best way.  We have a better
implemented API and should use it instead.
This commit is contained in:
Unknown W. Brackets 2018-02-19 09:09:35 -08:00
parent ecd1a04e44
commit 4b8d8c875d
13 changed files with 1 additions and 126 deletions

View File

@ -50,9 +50,6 @@ public:
void DoState(PointerWrap &p) override;
void ClearShaderCache() override;
bool DecodeTexture(u8 *dest, const GPUgstate &state) override {
return false;
}
bool FramebufferDirty() override;
bool FramebufferReallyDirty() override;

View File

@ -769,11 +769,6 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &
FreeAlignedMemory(mapData);
}
bool TextureCacheD3D11::DecodeTexture(u8 *output, const GPUgstate &state) {
OutputDebugStringA("TextureCache::DecodeTexture : FixMe\r\n");
return true;
}
bool TextureCacheD3D11::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
SetTexture(false);
if (!nextTexture_)

View File

@ -57,9 +57,6 @@ public:
shaderManager_ = sm;
}
// Only used by Qt UI?
bool DecodeTexture(u8 *output, const GPUgstate &state);
void ForgetLastTexture() override;
void InvalidateLastTexture(TexCacheEntry *entry = nullptr) override;

View File

@ -51,9 +51,6 @@ public:
void DoState(PointerWrap &p) override;
void ClearShaderCache() override;
bool DecodeTexture(u8 *dest, const GPUgstate &state) override {
return textureCacheDX9_->DecodeTexture(dest, state);
}
bool FramebufferDirty() override;
bool FramebufferReallyDirty() override;

View File

@ -780,12 +780,6 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &re
texture->UnlockRect(level);
}
bool TextureCacheDX9::DecodeTexture(u8 *output, const GPUgstate &state)
{
OutputDebugStringA("TextureCache::DecodeTexture : FixMe\r\n");
return true;
}
bool TextureCacheDX9::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
SetTexture(true);
ApplyTexture();

View File

@ -49,9 +49,6 @@ public:
shaderManager_ = sm;
}
// Only used by Qt UI?
bool DecodeTexture(u8 *output, const GPUgstate &state);
void ForgetLastTexture() override;
void InvalidateLastTexture(TexCacheEntry *entry = nullptr) override;

View File

@ -55,9 +55,6 @@ public:
void ClearShaderCache() override;
void CleanupBeforeUI() override;
bool DecodeTexture(u8 *dest, const GPUgstate &state) override {
return textureCacheGL_->DecodeTexture(dest, state);
}
bool FramebufferDirty() override;
bool FramebufferReallyDirty() override;

View File

@ -804,85 +804,6 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
}
}
// Only used by Qt UI?
bool TextureCacheGLES::DecodeTexture(u8* output, const GPUgstate &state) {
GPUgstate oldState = gstate;
gstate = state;
u32 texaddr = gstate.getTextureAddress(0);
if (!Memory::IsValidAddress(texaddr)) {
return false;
}
GLenum dstFmt = 0;
GETextureFormat format = gstate.getTextureFormat();
GEPaletteFormat clutformat = gstate.getClutPaletteFormat();
u8 level = 0;
int bufw = GetTextureBufw(level, texaddr, format);
int w = gstate.getTextureWidth(level);
int h = gstate.getTextureHeight(level);
int pixelSize = dstFmt == GL_UNSIGNED_BYTE ? 4 : 2;
int decPitch = w * pixelSize;
void *finalBuf = AllocateAlignedMemory(decPitch * h * pixelSize, 16);
DecodeTextureLevel((uint8_t *)finalBuf, decPitch, format, clutformat, texaddr, level, bufw, true, false, false);
switch (dstFmt) {
case GL_UNSIGNED_SHORT_4_4_4_4:
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++) {
u32 val = ((u16*)finalBuf)[y*w + x];
u32 r = ((val>>12) & 0xF) * 17;
u32 g = ((val>> 8) & 0xF) * 17;
u32 b = ((val>> 4) & 0xF) * 17;
u32 a = ((val>> 0) & 0xF) * 17;
((u32*)output)[y*w + x] = (a << 24) | (r << 16) | (g << 8) | b;
}
break;
case GL_UNSIGNED_SHORT_5_5_5_1:
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++) {
u32 val = ((u16*)finalBuf)[y*w + x];
u32 r = Convert5To8((val>>11) & 0x1F);
u32 g = Convert5To8((val>> 6) & 0x1F);
u32 b = Convert5To8((val>> 1) & 0x1F);
u32 a = (val & 0x1) * 255;
((u32*)output)[y*w + x] = (a << 24) | (r << 16) | (g << 8) | b;
}
break;
case GL_UNSIGNED_SHORT_5_6_5:
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++) {
u32 val = ((u16*)finalBuf)[y*w + x];
u32 a = 0xFF;
u32 r = Convert5To8((val>>11) & 0x1F);
u32 g = Convert6To8((val>> 5) & 0x3F);
u32 b = Convert5To8((val ) & 0x1F);
((u32*)output)[y*w + x] = (a << 24) | (r << 16) | (g << 8) | b;
}
break;
default:
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++) {
u32 val = ((u32*)finalBuf)[y*w + x];
((u32*)output)[y*w + x] = ((val & 0xFF000000)) | ((val & 0x00FF0000)>>16) | ((val & 0x0000FF00)) | ((val & 0x000000FF)<<16);
}
break;
}
FreeAlignedMemory(finalBuf);
gstate = oldState;
return true;
}
bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
#ifndef USING_GLES2
GPUgstate saved;

View File

@ -63,9 +63,6 @@ public:
}
}
// Only used by Qt UI?
bool DecodeTexture(u8 *output, const GPUgstate &state);
void SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight);
bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) override;

View File

@ -227,9 +227,6 @@ public:
const std::list<int>& GetDisplayLists() override {
return dlQueue;
}
bool DecodeTexture(u8* dest, const GPUgstate &state) override {
return false;
}
std::vector<FramebufferInfo> GetFramebufferList() override;
void ClearShaderCache() override {}
void CleanupBeforeUI() override {}

View File

@ -241,7 +241,6 @@ public:
virtual void DumpNextFrame() = 0;
virtual void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) = 0;
virtual const std::list<int>& GetDisplayLists() = 0;
virtual bool DecodeTexture(u8* dest, const GPUgstate &state) = 0;
virtual std::vector<FramebufferInfo> GetFramebufferList() = 0;
virtual s64 GetListTicks(int listid) = 0;

View File

@ -54,9 +54,6 @@ public:
void DoState(PointerWrap &p) override;
void ClearShaderCache() override;
bool DecodeTexture(u8 *dest, const GPUgstate &state) override {
return false;
}
bool FramebufferDirty() override;
bool FramebufferReallyDirty() override;

View File

@ -54,17 +54,7 @@ void Debugger_MemoryTex::on_readBtn_clicked()
w = std::max(bufW,w);
uchar* newData = new uchar[w*h*4];
if(gpu->DecodeTexture(newData, state))
{
QImage img = QImage(newData, w, h, w*4, QImage::Format_ARGB32); // EmuThread_GrabBackBuffer();
QPixmap pixmap = QPixmap::fromImage(img);
ui->textureImg->setPixmap(pixmap);
ui->textureImg->setMinimumWidth(pixmap.width());
ui->textureImg->setMinimumHeight(pixmap.height());
ui->textureImg->setMaximumWidth(pixmap.width());
ui->textureImg->setMaximumHeight(pixmap.height());
}
// TODO: Use GPU_GetCurrentTexture(). Warning: blocks.
delete[] newData;
}