OpenGL ES: Crash as early as possible if things are bad

There's a huge variety of crash report in the Play Console of various
opengl failures. Try to concentrate them to early points in
initialization
This commit is contained in:
Henrik Rydgård
2022-11-08 10:43:38 +01:00
parent 094666ef4b
commit dd0409d68c
4 changed files with 33 additions and 7 deletions
+6 -1
View File
@@ -13,13 +13,18 @@ AndroidJavaEGLGraphicsContext::AndroidJavaEGLGraphicsContext() {
bool AndroidJavaEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) {
INFO_LOG(G3D, "AndroidJavaEGLGraphicsContext::InitFromRenderThread");
CheckGLExtensions();
// OpenGL handles rotated rendering in the driver.
g_display_rotation = DisplayRotation::ROTATE_0;
g_display_rot_matrix.setIdentity();
draw_ = Draw::T3DCreateGLContext(); // Can't fail
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
draw_->CreatePresets();
if (!draw_->CreatePresets()) {
_assert_msg_(false, "Failed to compile preset shaders");
return false;
}
return true;
}