mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add basic GetCurrentTexture() to softgpu.
This commit is contained in:
parent
90e94a6cc8
commit
2eb10c3b3f
3 changed files with 25 additions and 4 deletions
|
@ -51,6 +51,10 @@ struct GPUDebugBuffer {
|
|||
: 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)
|
||||
: alloc_(false), data_((u8 *)data), stride_(stride), height_(height), fmt_(fmt), flipped_(false) {
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/ge_constants.h"
|
||||
#include "GPU/Common/TextureDecoder.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/HLE/sceKernelInterrupt.h"
|
||||
#include "Core/HLE/sceGe.h"
|
||||
|
@ -767,3 +768,22 @@ bool SoftGPU::GetCurrentStencilbuffer(GPUDebugBuffer &buffer)
|
|||
// TODO: Just need the alpha value from the framebuffer...
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,10 +76,7 @@ public:
|
|||
virtual bool GetCurrentFramebuffer(GPUDebugBuffer &buffer);
|
||||
virtual bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer);
|
||||
virtual bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer);
|
||||
virtual bool GetCurrentTexture(GPUDebugBuffer &buffer) {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
virtual bool GetCurrentTexture(GPUDebugBuffer &buffer);
|
||||
|
||||
protected:
|
||||
virtual void FastRunLoop(DisplayList &list);
|
||||
|
|
Loading…
Add table
Reference in a new issue