System: Allow GPU to have delayed loading.

This commit is contained in:
Unknown W. Brackets
2017-12-03 10:54:38 -08:00
parent f23c7cf93b
commit 60c4ac58f0
5 changed files with 15 additions and 4 deletions
+4 -4
View File
@@ -436,16 +436,16 @@ bool PSP_InitUpdate(std::string *error_string) {
bool success = coreParameter.fileToStart != "";
*error_string = coreParameter.errorString;
if (success) {
if (success && gpu == nullptr) {
success = GPU_Init(coreParameter.graphicsContext, coreParameter.thin3d);
if (!success) {
PSP_Shutdown();
*error_string = "Unable to initialize rendering engine.";
}
}
pspIsInited = success;
pspIsIniting = false;
return true;
pspIsInited = success && GPU_IsReady();
pspIsIniting = success && !pspIsInited;
return !success || pspIsInited;
}
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) {
+6
View File
@@ -55,6 +55,12 @@ static void SetGPU(T *obj) {
#undef new
#endif
bool GPU_IsReady() {
if (gpu)
return gpu->IsReady();
return false;
}
bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) {
#if PPSSPP_PLATFORM(UWP)
SetGPU(new GPU_D3D11(ctx, draw));
+1
View File
@@ -105,4 +105,5 @@ namespace Draw {
}
bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *thin3d);
bool GPU_IsReady();
void GPU_Shutdown();
+3
View File
@@ -70,6 +70,9 @@ public:
Draw::DrawContext *GetDrawContext() override {
return draw_;
}
bool IsReady() override {
return true;
}
void Reinitialize() override;
void BeginHostFrame() override;
+1
View File
@@ -168,6 +168,7 @@ public:
virtual Draw::DrawContext *GetDrawContext() = 0;
// Initialization
virtual bool IsReady() = 0;
virtual void InitClear() = 0;
virtual void Reinitialize() = 0;