From 8ccf32af47d433ab4a65057bc55b474e12ec9486 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 14 Nov 2017 22:33:56 -0800 Subject: [PATCH 1/2] Headless: Fix crash with null GPU. --- GPU/Null/NullGpu.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/GPU/Null/NullGpu.cpp b/GPU/Null/NullGpu.cpp index 95a9b8c157..2772718ec9 100644 --- a/GPU/Null/NullGpu.cpp +++ b/GPU/Null/NullGpu.cpp @@ -15,7 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - +#include "GPU/Common/DrawEngineCommon.h" #include "GPU/Null/NullGpu.h" #include "GPU/GPUState.h" #include "GPU/ge_constants.h" @@ -25,7 +25,17 @@ #include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/sceGe.h" -NullGPU::NullGPU() : GPUCommon(nullptr, nullptr) { } +class NullDrawEngine : public DrawEngineCommon { +public: + void DispatchFlush() override { + } + void DispatchSubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead) override { + } +}; + +NullGPU::NullGPU() : GPUCommon(nullptr, nullptr) { + drawEngineCommon_ = new NullDrawEngine(); +} NullGPU::~NullGPU() { } void NullGPU::FastRunLoop(DisplayList &list) { From 9080f41642911b50c1feeb72bba4ce3cc9af1db6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 14 Nov 2017 22:34:18 -0800 Subject: [PATCH 2/2] Headless: Prevent segfaults with Vulkan. --- headless/Headless.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index a20e540a8f..db9645b39f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -161,6 +161,8 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, bool Core_UpdateDebugStats(g_Config.bShowDebugStats || g_Config.bLogFrameDrops); PSP_BeginHostFrame(); + if (coreParameter.thin3d) + coreParameter.thin3d->BeginFrame(); coreState = CORE_RUNNING; while (coreState == CORE_RUNNING) @@ -185,6 +187,8 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, bool } } + if (coreParameter.thin3d) + coreParameter.thin3d->EndFrame(); PSP_EndHostFrame(); PSP_Shutdown();