mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add a better signal for VRAM copies in the GPU.
This commit is contained in:
parent
3185594d3c
commit
f8d6bda678
6 changed files with 17 additions and 5 deletions
|
@ -34,11 +34,9 @@ u32 sceDmacMemcpy(u32 dst, u32 src, u32 size)
|
|||
Memory::Memcpy(dst, Memory::GetPointer(src), size);
|
||||
|
||||
src &= ~0x40000000;
|
||||
// TODO: If we do this it'll probably black out the framebuffer?
|
||||
if (src < PSP_GetVidMemBase() || src > PSP_GetVidMemEnd())
|
||||
gpu->InvalidateCache(dst, size, GPU_INVALIDATE_HINT);
|
||||
else
|
||||
WARN_LOG_REPORT(HLE, "sceDmacMemcpy(): FBO blit?");
|
||||
dst &= ~0x40000000;
|
||||
if ((src >= PSP_GetVidMemBase() && src < PSP_GetVidMemEnd()) || (dst >= PSP_GetVidMemBase() && dst < PSP_GetVidMemEnd()))
|
||||
gpu->UpdateMemory(dst, src, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1029,6 +1029,10 @@ void GLES_GPU::InvalidateCache(u32 addr, int size, GPUInvalidationType type) {
|
|||
framebufferManager_.UpdateFromMemory(addr, size);
|
||||
}
|
||||
|
||||
void GLES_GPU::UpdateMemory(u32 dest, u32 src, int size) {
|
||||
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
||||
}
|
||||
|
||||
void GLES_GPU::ClearCacheNextFrame() {
|
||||
textureCache_.ClearNextFrame();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public:
|
|||
virtual void BeginFrame();
|
||||
virtual void UpdateStats();
|
||||
virtual void InvalidateCache(u32 addr, int size, GPUInvalidationType type);
|
||||
virtual void UpdateMemory(u32 dest, u32 src, int size);
|
||||
virtual void ClearCacheNextFrame();
|
||||
virtual void DeviceLost(); // Only happens on Android. Drop all textures and shaders.
|
||||
|
||||
|
|
|
@ -181,6 +181,8 @@ public:
|
|||
// Invalidate any cached content sourced from the specified range.
|
||||
// If size = -1, invalidate everything.
|
||||
virtual void InvalidateCache(u32 addr, int size, GPUInvalidationType type) = 0;
|
||||
// Update either RAM from VRAM, or VRAM from RAM... or even VRAM from VRAM.
|
||||
virtual void UpdateMemory(u32 dest, u32 src, int size) = 0;
|
||||
|
||||
// Will cause the texture cache to be cleared at the start of the next frame.
|
||||
virtual void ClearCacheNextFrame() = 0;
|
||||
|
|
|
@ -678,3 +678,9 @@ void NullGPU::InvalidateCache(u32 addr, int size, GPUInvalidationType type)
|
|||
{
|
||||
// Nothing to invalidate.
|
||||
}
|
||||
|
||||
void NullGPU::UpdateMemory(u32 dest, u32 src, int size)
|
||||
{
|
||||
// Nothing to update.
|
||||
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
virtual void CopyDisplayToOutput() {}
|
||||
virtual void UpdateStats();
|
||||
virtual void InvalidateCache(u32 addr, int size, GPUInvalidationType type);
|
||||
virtual void UpdateMemory(u32 dest, u32 src, int size);
|
||||
virtual void ClearCacheNextFrame() {};
|
||||
virtual void Flush() {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue