Handle disabled display cleanly.

Otherwise we might accidentally match a vfb at 0.

Fixes #6317.
This commit is contained in:
Unknown W. Brackets 2015-12-30 17:44:32 -08:00
parent abede77059
commit 5806df07b4
2 changed files with 18 additions and 3 deletions

View File

@ -678,12 +678,20 @@ namespace DX9 {
void FramebufferManagerDX9::CopyDisplayToOutput() {
fbo_unbind();
currentRenderVfb_ = 0;
if (displayFramebufPtr_ == 0) {
DEBUG_LOG(SCEGE, "Display disabled, displaying only black");
// No framebuffer to display! Clear to black.
ClearBuffer();
return;
}
if (useBufferedRendering_) {
// In buffered, we no longer clear the backbuffer before we start rendering.
ClearBuffer();
DXSetViewport(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
}
currentRenderVfb_ = 0;
u32 offsetX = 0;
u32 offsetY = 0;

View File

@ -989,6 +989,15 @@ void FramebufferManager::CopyDisplayToOutput() {
fbo_unbind();
glstate.viewport.set(0, 0, pixelWidth_, pixelHeight_);
currentRenderVfb_ = 0;
if (displayFramebufPtr_ == 0) {
DEBUG_LOG(SCEGE, "Display disabled, displaying only black");
// No framebuffer to display! Clear to black.
ClearBuffer();
return;
}
if (useBufferedRendering_) {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
#ifdef USING_GLES2
@ -1001,8 +1010,6 @@ void FramebufferManager::CopyDisplayToOutput() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
currentRenderVfb_ = 0;
u32 offsetX = 0;
u32 offsetY = 0;