mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Begin/End frame fixes
This commit is contained in:
parent
01e3fbae95
commit
668830365d
2 changed files with 40 additions and 33 deletions
|
@ -475,6 +475,42 @@ void GPU_Vulkan::CheckGPUFeatures() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPU_Vulkan::BeginHostFrame() {
|
||||||
|
if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
|
||||||
|
// Draw everything directly to the backbuffer.
|
||||||
|
drawEngine_.SetCmdBuffer(vulkan_->GetSurfaceCommandBuffer());
|
||||||
|
}
|
||||||
|
drawEngine_.BeginFrame();
|
||||||
|
|
||||||
|
if (resized_) {
|
||||||
|
CheckGPUFeatures();
|
||||||
|
UpdateCmdInfo();
|
||||||
|
drawEngine_.Resized();
|
||||||
|
}
|
||||||
|
resized_ = false;
|
||||||
|
|
||||||
|
textureCache_.StartFrame();
|
||||||
|
depalShaderCache_.Decimate();
|
||||||
|
|
||||||
|
if (dumpNextFrame_) {
|
||||||
|
NOTICE_LOG(G3D, "DUMPING THIS FRAME");
|
||||||
|
dumpThisFrame_ = true;
|
||||||
|
dumpNextFrame_ = false;
|
||||||
|
} else if (dumpThisFrame_) {
|
||||||
|
dumpThisFrame_ = false;
|
||||||
|
}
|
||||||
|
shaderManager_->DirtyShader();
|
||||||
|
|
||||||
|
// Not sure if this is really needed.
|
||||||
|
shaderManager_->DirtyUniform(DIRTY_ALL);
|
||||||
|
|
||||||
|
framebufferManager_.BeginFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GPU_Vulkan::EndHostFrame() {
|
||||||
|
drawEngine_.EndFrame();
|
||||||
|
framebufferManager_.EndFrame();
|
||||||
|
}
|
||||||
|
|
||||||
// Needs to be called on GPU thread, not reporting thread.
|
// Needs to be called on GPU thread, not reporting thread.
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -554,36 +590,6 @@ void GPU_Vulkan::ReapplyGfxStateInternal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_Vulkan::BeginFrameInternal() {
|
void GPU_Vulkan::BeginFrameInternal() {
|
||||||
if (resized_) {
|
|
||||||
CheckGPUFeatures();
|
|
||||||
UpdateCmdInfo();
|
|
||||||
drawEngine_.Resized();
|
|
||||||
}
|
|
||||||
UpdateVsyncInterval(resized_);
|
|
||||||
resized_ = false;
|
|
||||||
|
|
||||||
textureCache_.StartFrame();
|
|
||||||
depalShaderCache_.Decimate();
|
|
||||||
|
|
||||||
if (dumpNextFrame_) {
|
|
||||||
NOTICE_LOG(G3D, "DUMPING THIS FRAME");
|
|
||||||
dumpThisFrame_ = true;
|
|
||||||
dumpNextFrame_ = false;
|
|
||||||
} else if (dumpThisFrame_) {
|
|
||||||
dumpThisFrame_ = false;
|
|
||||||
}
|
|
||||||
shaderManager_->DirtyShader();
|
|
||||||
|
|
||||||
// Not sure if this is really needed.
|
|
||||||
shaderManager_->DirtyUniform(DIRTY_ALL);
|
|
||||||
|
|
||||||
framebufferManager_.BeginFrame();
|
|
||||||
drawEngine_.BeginFrame();
|
|
||||||
|
|
||||||
if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
|
|
||||||
// Draw everything directly to the backbuffer.
|
|
||||||
drawEngine_.SetCmdBuffer(vulkan_->GetSurfaceCommandBuffer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_Vulkan::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
void GPU_Vulkan::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
|
||||||
|
@ -628,13 +634,10 @@ void GPU_Vulkan::CopyDisplayToOutput() {
|
||||||
void GPU_Vulkan::CopyDisplayToOutputInternal() {
|
void GPU_Vulkan::CopyDisplayToOutputInternal() {
|
||||||
// Flush anything left over.
|
// Flush anything left over.
|
||||||
drawEngine_.Flush(curCmd_);
|
drawEngine_.Flush(curCmd_);
|
||||||
drawEngine_.EndFrame();
|
|
||||||
|
|
||||||
shaderManager_->DirtyLastShader();
|
shaderManager_->DirtyLastShader();
|
||||||
|
|
||||||
framebufferManager_.CopyDisplayToOutput();
|
framebufferManager_.CopyDisplayToOutput();
|
||||||
framebufferManager_.EndFrame();
|
|
||||||
|
|
||||||
|
|
||||||
gstate_c.textureChanged = TEXCHANGE_UPDATED;
|
gstate_c.textureChanged = TEXCHANGE_UPDATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,10 @@ public:
|
||||||
// This gets called on startup and when we get back from settings.
|
// This gets called on startup and when we get back from settings.
|
||||||
void CheckGPUFeatures();
|
void CheckGPUFeatures();
|
||||||
|
|
||||||
|
// These are where we can reset command buffers etc.
|
||||||
|
void BeginHostFrame();
|
||||||
|
void EndHostFrame();
|
||||||
|
|
||||||
void InitClear() override;
|
void InitClear() override;
|
||||||
void Reinitialize() override;
|
void Reinitialize() override;
|
||||||
void PreExecuteOp(u32 op, u32 diff) override;
|
void PreExecuteOp(u32 op, u32 diff) override;
|
||||||
|
|
Loading…
Add table
Reference in a new issue