mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
System: Allow GPU to have delayed loading.
This commit is contained in:
+4
-4
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -105,4 +105,5 @@ namespace Draw {
|
||||
}
|
||||
|
||||
bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *thin3d);
|
||||
bool GPU_IsReady();
|
||||
void GPU_Shutdown();
|
||||
|
||||
@@ -70,6 +70,9 @@ public:
|
||||
Draw::DrawContext *GetDrawContext() override {
|
||||
return draw_;
|
||||
}
|
||||
bool IsReady() override {
|
||||
return true;
|
||||
}
|
||||
void Reinitialize() override;
|
||||
|
||||
void BeginHostFrame() override;
|
||||
|
||||
@@ -168,6 +168,7 @@ public:
|
||||
virtual Draw::DrawContext *GetDrawContext() = 0;
|
||||
|
||||
// Initialization
|
||||
virtual bool IsReady() = 0;
|
||||
virtual void InitClear() = 0;
|
||||
virtual void Reinitialize() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user