Add basic GetCurrentTexture() to softgpu.

This commit is contained in:
Unknown W. Brackets 2013-10-05 11:37:14 -07:00
parent 90e94a6cc8
commit 2eb10c3b3f
3 changed files with 25 additions and 4 deletions

View file

@ -51,6 +51,10 @@ struct GPUDebugBuffer {
: alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(GPUDebugBufferFormat(fmt)), flipped_(false) { : alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(GPUDebugBufferFormat(fmt)), flipped_(false) {
} }
GPUDebugBuffer(void *data, u32 stride, u32 height, GETextureFormat fmt)
: alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(GPUDebugBufferFormat(fmt)), flipped_(false) {
}
GPUDebugBuffer(void *data, u32 stride, u32 height, GPUDebugBufferFormat fmt) GPUDebugBuffer(void *data, u32 stride, u32 height, GPUDebugBufferFormat fmt)
: alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(fmt), flipped_(false) { : alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(fmt), flipped_(false) {
} }

View file

@ -18,6 +18,7 @@
#include "GPU/GPUState.h" #include "GPU/GPUState.h"
#include "GPU/ge_constants.h" #include "GPU/ge_constants.h"
#include "GPU/Common/TextureDecoder.h"
#include "Core/MemMap.h" #include "Core/MemMap.h"
#include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/sceKernelInterrupt.h"
#include "Core/HLE/sceGe.h" #include "Core/HLE/sceGe.h"
@ -767,3 +768,22 @@ bool SoftGPU::GetCurrentStencilbuffer(GPUDebugBuffer &buffer)
// TODO: Just need the alpha value from the framebuffer... // TODO: Just need the alpha value from the framebuffer...
return false; return false;
} }
bool SoftGPU::GetCurrentTexture(GPUDebugBuffer &buffer)
{
static const int level = 0;
u32 bufw = GetTextureBufw(level, gstate.getTextureAddress(level), gstate.getTextureFormat());
switch (gstate.getTextureFormat())
{
case GE_TFMT_5650:
case GE_TFMT_5551:
case GE_TFMT_4444:
case GE_TFMT_8888:
buffer = GPUDebugBuffer(Memory::GetPointer(gstate.getTextureAddress(level)), bufw, gstate.getTextureHeight(level), gstate.getTextureFormat());
return true;
default:
// TODO: Support these...
return false;
}
}

View file

@ -76,10 +76,7 @@ public:
virtual bool GetCurrentFramebuffer(GPUDebugBuffer &buffer); virtual bool GetCurrentFramebuffer(GPUDebugBuffer &buffer);
virtual bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); virtual bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer);
virtual bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); virtual bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer);
virtual bool GetCurrentTexture(GPUDebugBuffer &buffer) { virtual bool GetCurrentTexture(GPUDebugBuffer &buffer);
// TODO
return false;
}
protected: protected:
virtual void FastRunLoop(DisplayList &list); virtual void FastRunLoop(DisplayList &list);