mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
add null-checks on software render path
This commit is contained in:
@@ -76,9 +76,11 @@ public:
|
||||
GPUDebugBuffer buf;
|
||||
u16 w = NATIVEWIDTH;
|
||||
u16 h = NATIVEHEIGHT;
|
||||
gpuDebug->GetOutputFramebuffer(buf);
|
||||
const std::vector<u32> pixels = TranslateDebugBufferToCompare(&buf, w, h);
|
||||
memcpy(soft_bmp, pixels.data(), SOFT_BMP_SIZE);
|
||||
if (gpuDebug) {
|
||||
gpuDebug->GetOutputFramebuffer(buf);
|
||||
const std::vector<u32> pixels = TranslateDebugBufferToCompare(&buf, w, h);
|
||||
memcpy(soft_bmp, pixels.data(), SOFT_BMP_SIZE);
|
||||
}
|
||||
u32 offset = g_Config.bDisplayCropTo16x9 ? w << 1 : 0;
|
||||
h -= g_Config.bDisplayCropTo16x9 ? 2 : 0;
|
||||
video_cb(soft_bmp + offset, w, h, w << 2);
|
||||
|
||||
+18
-10
@@ -1356,8 +1356,9 @@ namespace Libretro
|
||||
static void EmuFrame()
|
||||
{
|
||||
ctx->SetRenderTarget();
|
||||
if (ctx->GetDrawContext()) {
|
||||
ctx->GetDrawContext()->BeginFrame(Draw::DebugFlags::NONE);
|
||||
Draw::DrawContext *draw = ctx->GetDrawContext();
|
||||
if (draw) {
|
||||
draw->BeginFrame(Draw::DebugFlags::NONE);
|
||||
}
|
||||
|
||||
const DisplayLayoutConfig &displayLayoutConfig = g_Config.GetDisplayLayoutConfig(g_display.GetDeviceOrientation());
|
||||
@@ -1379,21 +1380,24 @@ namespace Libretro
|
||||
|
||||
if (gpu) {
|
||||
gpu->EndHostFrame();
|
||||
|
||||
gpu->PrepareCopyDisplayToOutput(displayLayoutConfig);
|
||||
if (draw) {
|
||||
gpu->PrepareCopyDisplayToOutput(displayLayoutConfig);
|
||||
}
|
||||
}
|
||||
|
||||
// gotta do the backbuffer bind somewhere.
|
||||
using namespace Draw;
|
||||
ctx->GetDrawContext()->BindFramebufferAsRenderTarget(nullptr, {RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR}, "BackBuffer");
|
||||
if (draw) {
|
||||
draw->BindFramebufferAsRenderTarget(nullptr, {RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR}, "BackBuffer");
|
||||
}
|
||||
|
||||
if (gpu) {
|
||||
if (gpu && draw) {
|
||||
gpu->CopyDisplayToOutput(displayLayoutConfig);
|
||||
}
|
||||
|
||||
if (ctx->GetDrawContext()) {
|
||||
ctx->GetDrawContext()->EndFrame();
|
||||
ctx->GetDrawContext()->Present(Draw::PresentMode::FIFO);
|
||||
if (draw) {
|
||||
draw->EndFrame();
|
||||
draw->Present(Draw::PresentMode::FIFO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1427,7 +1431,11 @@ namespace Libretro
|
||||
|
||||
void EmuThreadStart()
|
||||
{
|
||||
bool wasPaused = emuThreadState == EmuThreadState::PAUSED;
|
||||
EmuThreadState state = emuThreadState;
|
||||
if (state == EmuThreadState::RUNNING || state == EmuThreadState::START_REQUESTED || emuThread.joinable())
|
||||
return;
|
||||
|
||||
bool wasPaused = state == EmuThreadState::PAUSED;
|
||||
emuThreadState = EmuThreadState::START_REQUESTED;
|
||||
|
||||
if (!wasPaused)
|
||||
|
||||
Reference in New Issue
Block a user