Permalink
Browse files

System: Allow GPU to have delayed loading.

  • Loading branch information...
unknownbrackets committed Dec 3, 2017
1 parent f23c7cf commit 60c4ac58f0b475d1dfe359dd6047f1f6fcff2b85
Showing with 15 additions and 4 deletions.
  1. +4 −4 Core/System.cpp
  2. +6 −0 GPU/GPU.cpp
  3. +1 −0 GPU/GPU.h
  4. +3 −0 GPU/GPUCommon.h
  5. +1 −0 GPU/GPUInterface.h
View
@@ -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) {
View
@@ -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));
View
@@ -105,4 +105,5 @@ namespace Draw {
}
bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *thin3d);
bool GPU_IsReady();
void GPU_Shutdown();
View
@@ -70,6 +70,9 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
Draw::DrawContext *GetDrawContext() override {
return draw_;
}
bool IsReady() override {
return true;
}
void Reinitialize() override;
void BeginHostFrame() override;
View
@@ -168,6 +168,7 @@ class GPUInterface {
virtual Draw::DrawContext *GetDrawContext() = 0;
// Initialization
virtual bool IsReady() = 0;
virtual void InitClear() = 0;
virtual void Reinitialize() = 0;

0 comments on commit 60c4ac5

Please sign in to comment.