From 252160b5e2b5d396a27443ca6296e72c5ac424bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= <hrydgard@gmail.com>
Date: Tue, 9 Feb 2021 09:53:03 +0100
Subject: [PATCH] GL: Call CreateDeviceObjects *after* updating render_.

Also remove a redundant call to fetch render_ in the constructor, it's
already passed in.
---
 GPU/GLES/FramebufferManagerGLES.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/GPU/GLES/FramebufferManagerGLES.cpp b/GPU/GLES/FramebufferManagerGLES.cpp
index ecd9ce5a53bd..8f9b79cf7e1e 100644
--- a/GPU/GLES/FramebufferManagerGLES.cpp
+++ b/GPU/GLES/FramebufferManagerGLES.cpp
@@ -103,9 +103,8 @@ FramebufferManagerGLES::FramebufferManagerGLES(Draw::DrawContext *draw, GLRender
 {
 	needBackBufferYSwap_ = true;
 	needGLESRebinds_ = true;
-	CreateDeviceObjects();
-	render_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
 	presentation_->SetLanguage(draw_->GetShaderLanguageDesc().shaderLanguage);
+	CreateDeviceObjects();
 }
 
 void FramebufferManagerGLES::Init() {
@@ -344,8 +343,8 @@ void FramebufferManagerGLES::DeviceLost() {
 
 void FramebufferManagerGLES::DeviceRestore(Draw::DrawContext *draw) {
 	FramebufferManagerCommon::DeviceRestore(draw);
-	CreateDeviceObjects();
 	render_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
+	CreateDeviceObjects();
 }
 
 void FramebufferManagerGLES::Resized() {