Show an error on screen if a shader fails to compile.

Part of #1 investigation of #13541
This commit is contained in:
Henrik Rydgård 2020-11-05 00:48:35 +01:00
parent 28da9958e2
commit 207b76da6e
12 changed files with 62 additions and 10 deletions

View file

@ -82,6 +82,7 @@ struct JNIEnv {};
#include "Core/System.h"
#include "Core/HLE/sceUsbCam.h"
#include "Core/HLE/sceUsbGps.h"
#include "Core/Host.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "UI/GameInfoCache.h"
@ -777,6 +778,10 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env,
return false;
}
graphicsContext->GetDrawContext()->SetErrorCallback([](const char *shortDesc, const char *details, void *userdata) {
host->NotifyUserMessage(details, 5.0, 0xFFFFFFFF, "error_callback");
}, nullptr);
if (useCPUThread) {
EmuThreadStart();
} else {
@ -795,6 +800,11 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env,
SystemToast("Graphics initialization failed. Quitting.");
return false;
}
graphicsContext->GetDrawContext()->SetErrorCallback([](const char *shortDesc, const char *details, void *userdata) {
host->NotifyUserMessage(details, 5.0, 0xFFFFFFFF, "error_callback");
}, nullptr);
graphicsContext->ThreadStart();
renderer_inited = true;
}