mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
GPU: Centralize SetDisplayFramebuffer().
This commit is contained in:
parent
86085335ca
commit
c581a83896
@ -41,6 +41,7 @@
|
||||
#include "GPU/Common/PresentationCommon.h"
|
||||
#include "GPU/Common/TextureCacheCommon.h"
|
||||
#include "GPU/Common/ReinterpretFramebuffer.h"
|
||||
#include "GPU/Debugger/Debugger.h"
|
||||
#include "GPU/Debugger/Record.h"
|
||||
#include "GPU/Debugger/Stepping.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
@ -105,6 +106,9 @@ void FramebufferManagerCommon::SetDisplayFramebuffer(u32 framebuf, u32 stride, G
|
||||
displayFramebufPtr_ = framebuf;
|
||||
displayStride_ = stride;
|
||||
displayFormat_ = format;
|
||||
// TODO: Some games like Spongebob - Yellow Avenger, never change framebuffer, they blit to it.
|
||||
// So breaking on frames doesn't work. Might want to move this to sceDisplay vsync.
|
||||
GPUDebug::NotifyDisplay(framebuf, stride, format);
|
||||
GPURecord::NotifyDisplay(framebuf, stride, format);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "GPU/GeDisasm.h"
|
||||
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "GPU/Debugger/Debugger.h"
|
||||
#include "GPU/D3D11/ShaderManagerD3D11.h"
|
||||
#include "GPU/D3D11/GPU_D3D11.h"
|
||||
#include "GPU/D3D11/FramebufferManagerD3D11.h"
|
||||
@ -239,13 +238,6 @@ void GPU_D3D11::BeginFrame() {
|
||||
gstate_c.Dirty(DIRTY_PROJTHROUGHMATRIX);
|
||||
}
|
||||
|
||||
void GPU_D3D11::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||
// TODO: Some games like Spongebob - Yellow Avenger, never change framebuffer, they blit to it.
|
||||
// So breaking on frames doesn't work. Might want to move this to sceDisplay vsync.
|
||||
GPUDebug::NotifyDisplay(framebuf, stride, format);
|
||||
framebufferManagerD3D11_->SetDisplayFramebuffer(framebuf, stride, format);
|
||||
}
|
||||
|
||||
void GPU_D3D11::CopyDisplayToOutput(bool reallyDirty) {
|
||||
// Flush anything left over.
|
||||
drawEngine_.Flush();
|
||||
|
@ -41,7 +41,6 @@ public:
|
||||
void ExecuteOp(u32 op, u32 diff) override;
|
||||
|
||||
void ReapplyGfxState() override;
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void GetStats(char *buffer, size_t bufsize) override;
|
||||
void ClearCacheNextFrame() override;
|
||||
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "GPU/GeDisasm.h"
|
||||
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "GPU/Debugger/Debugger.h"
|
||||
#include "GPU/Directx9/ShaderManagerDX9.h"
|
||||
#include "GPU/Directx9/GPU_DX9.h"
|
||||
#include "GPU/Directx9/FramebufferManagerDX9.h"
|
||||
@ -286,11 +285,6 @@ void GPU_DX9::BeginFrame() {
|
||||
framebufferManager_->BeginFrame();
|
||||
}
|
||||
|
||||
void GPU_DX9::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||
GPUDebug::NotifyDisplay(framebuf, stride, format);
|
||||
framebufferManagerDX9_->SetDisplayFramebuffer(framebuf, stride, format);
|
||||
}
|
||||
|
||||
void GPU_DX9::CopyDisplayToOutput(bool reallyDirty) {
|
||||
dxstate.depthWrite.set(true);
|
||||
dxstate.colorMask.set(0xF);
|
||||
|
@ -40,7 +40,6 @@ public:
|
||||
void ExecuteOp(u32 op, u32 diff) override;
|
||||
|
||||
void ReapplyGfxState() override;
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void GetStats(char *buffer, size_t bufsize) override;
|
||||
void ClearCacheNextFrame() override;
|
||||
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "GPU/ge_constants.h"
|
||||
#include "GPU/GeDisasm.h"
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "GPU/Debugger/Debugger.h"
|
||||
#include "GPU/GLES/ShaderManagerGLES.h"
|
||||
#include "GPU/GLES/GPU_GLES.h"
|
||||
#include "GPU/GLES/FramebufferManagerGLES.h"
|
||||
@ -360,11 +359,6 @@ void GPU_GLES::BeginFrame() {
|
||||
framebufferManagerGL_->BeginFrame();
|
||||
}
|
||||
|
||||
void GPU_GLES::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||
GPUDebug::NotifyDisplay(framebuf, stride, format);
|
||||
framebufferManagerGL_->SetDisplayFramebuffer(framebuf, stride, format);
|
||||
}
|
||||
|
||||
void GPU_GLES::CopyDisplayToOutput(bool reallyDirty) {
|
||||
// Flush anything left over.
|
||||
framebufferManagerGL_->RebindFramebuffer("RebindFramebuffer - CopyDisplayToOutput");
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
void ExecuteOp(u32 op, u32 diff) override;
|
||||
|
||||
void ReapplyGfxState() override;
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void GetStats(char *buffer, size_t bufsize) override;
|
||||
|
||||
void ClearCacheNextFrame() override;
|
||||
|
@ -2765,6 +2765,10 @@ void GPUCommon::SetCmdValue(u32 op) {
|
||||
downcount = 0;
|
||||
}
|
||||
|
||||
void GPUCommon::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||
framebufferManager_->SetDisplayFramebuffer(framebuf, stride, format);
|
||||
}
|
||||
|
||||
void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
|
||||
// TODO: This is used a lot to copy data around between render targets and textures,
|
||||
// and also to quickly load textures from RAM to VRAM. So we should do checks like the following:
|
||||
|
@ -117,6 +117,7 @@ public:
|
||||
u32 Break(int mode) override;
|
||||
void ReapplyGfxState() override;
|
||||
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void CopyDisplayToOutput(bool reallyDirty) override = 0;
|
||||
void InitClear() override = 0;
|
||||
bool PerformMemoryCopy(u32 dest, u32 src, int size) override;
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "GPU/ge_constants.h"
|
||||
#include "GPU/GeDisasm.h"
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "GPU/Debugger/Debugger.h"
|
||||
#include "GPU/Vulkan/ShaderManagerVulkan.h"
|
||||
#include "GPU/Vulkan/GPU_Vulkan.h"
|
||||
#include "GPU/Vulkan/FramebufferManagerVulkan.h"
|
||||
@ -432,7 +431,6 @@ void GPU_Vulkan::InitClear() {
|
||||
}
|
||||
|
||||
void GPU_Vulkan::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||
GPUDebug::NotifyDisplay(framebuf, stride, format);
|
||||
framebufferManager_->SetDisplayFramebuffer(framebuf, stride, format);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,6 @@ public:
|
||||
void PreExecuteOp(u32 op, u32 diff) override;
|
||||
void ExecuteOp(u32 op, u32 diff) override;
|
||||
|
||||
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
|
||||
void GetStats(char *buffer, size_t bufsize) override;
|
||||
void ClearCacheNextFrame() override;
|
||||
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
|
||||
|
Loading…
Reference in New Issue
Block a user