Merge pull request #3970 from FearlessTobi/more-popup-madness

citra_qt: Add more verbose popups for video_core errors
This commit is contained in:
Merry 2018-08-24 19:21:35 +01:00 committed by GitHub
commit 0a5621fafc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 23 deletions

View file

@ -626,10 +626,12 @@ bool GMainWindow::LoadROM(const QString& filename) {
render_window->InitRenderTarget(); render_window->InitRenderTarget();
render_window->MakeCurrent(); render_window->MakeCurrent();
const char* below_gl33_title = "OpenGL 3.3 Unsupported";
const char* below_gl33_message = "Your GPU may not support OpenGL 3.3, or you do not "
"have the latest graphics driver.";
if (!gladLoadGL()) { if (!gladLoadGL()) {
QMessageBox::critical(this, tr("OpenGL 3.3 Unsupported"), QMessageBox::critical(this, tr(below_gl33_title), tr(below_gl33_message));
tr("Your GPU may not support OpenGL 3.3, or you do not "
"have the latest graphics driver."));
return false; return false;
} }
@ -689,7 +691,18 @@ bool GMainWindow::LoadROM(const QString& filename) {
"the " "the "
"log</a> for more details. " "log</a> for more details. "
"Ensure that you have the latest graphics drivers for your GPU.")); "Ensure that you have the latest graphics drivers for your GPU."));
break;
case Core::System::ResultStatus::ErrorVideoCore_ErrorGenericDrivers:
QMessageBox::critical(
this, tr("Video Core Error"),
tr("You are running default Windows drivers "
"for your GPU. You need to install the "
"proper drivers for your graphics card from the manufacturer's website."));
break;
case Core::System::ResultStatus::ErrorVideoCore_ErrorBelowGL33:
QMessageBox::critical(this, tr(below_gl33_title), tr(below_gl33_message));
break; break;
default: default:

View file

@ -178,8 +178,9 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
GDBStub::Init(); GDBStub::Init();
Movie::GetInstance().Init(); Movie::GetInstance().Init();
if (!VideoCore::Init(emu_window)) { ResultStatus result = VideoCore::Init(emu_window);
return ResultStatus::ErrorVideoCore; if (result != ResultStatus::Success) {
return result;
} }
LOG_DEBUG(Core, "Initialized OK"); LOG_DEBUG(Core, "Initialized OK");

View file

@ -46,12 +46,16 @@ public:
ErrorSystemMode, ///< Error determining the system mode ErrorSystemMode, ///< Error determining the system mode
ErrorLoader, ///< Error loading the specified application ErrorLoader, ///< Error loading the specified application
ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption
ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an
/// invalid format /// invalid format
ErrorSystemFiles, ///< Error in finding system files ErrorSystemFiles, ///< Error in finding system files
ErrorSharedFont, ///< Error in finding shared font ErrorSharedFont, ///< Error in finding shared font
ErrorVideoCore, ///< Error in the video core ErrorVideoCore, ///< Error in the video core
ErrorUnknown ///< Any other error ErrorVideoCore_ErrorGenericDrivers, ///< Error in the video core due to the user having
/// generic drivers installed
ErrorVideoCore_ErrorBelowGL33, ///< Error in the video core due to the user not having
/// OpenGL 3.3 or higher
ErrorUnknown ///< Any other error
}; };
/** /**

View file

@ -6,6 +6,7 @@
#include <memory> #include <memory>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/core.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
class EmuWindow; class EmuWindow;
@ -27,7 +28,7 @@ public:
virtual void SetWindow(EmuWindow* window) = 0; virtual void SetWindow(EmuWindow* window) = 0;
/// Initialize the renderer /// Initialize the renderer
virtual bool Init() = 0; virtual Core::System::ResultStatus Init() = 0;
/// Shutdown the renderer /// Shutdown the renderer
virtual void ShutDown() = 0; virtual void ShutDown() = 0;

View file

@ -505,7 +505,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
} }
/// Initialize the renderer /// Initialize the renderer
bool RendererOpenGL::Init() { Core::System::ResultStatus RendererOpenGL::Init() {
render_window->MakeCurrent(); render_window->MakeCurrent();
if (GLAD_GL_KHR_debug) { if (GLAD_GL_KHR_debug) {
@ -525,15 +525,19 @@ bool RendererOpenGL::Init() {
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model);
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_OpenGL_Version", gl_version); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_OpenGL_Version", gl_version);
if (gpu_vendor == "GDI Generic") {
return Core::System::ResultStatus::ErrorVideoCore_ErrorGenericDrivers;
}
if (!GLAD_GL_VERSION_3_3) { if (!GLAD_GL_VERSION_3_3) {
return false; return Core::System::ResultStatus::ErrorVideoCore_ErrorBelowGL33;
} }
InitOpenGLObjects(); InitOpenGLObjects();
RefreshRasterizerSetting(); RefreshRasterizerSetting();
return true; return Core::System::ResultStatus::Success;
} }
/// Shutdown the renderer /// Shutdown the renderer

View file

@ -47,7 +47,7 @@ public:
void SetWindow(EmuWindow* window) override; void SetWindow(EmuWindow* window) override;
/// Initialize the renderer /// Initialize the renderer
bool Init() override; Core::System::ResultStatus Init() override;
/// Shutdown the renderer /// Shutdown the renderer
void ShutDown() override; void ShutDown() override;

View file

@ -25,19 +25,21 @@ std::atomic<bool> g_hw_shader_accurate_mul;
std::atomic<bool> g_renderer_bg_color_update_requested; std::atomic<bool> g_renderer_bg_color_update_requested;
/// Initialize the video core /// Initialize the video core
bool Init(EmuWindow* emu_window) { Core::System::ResultStatus Init(EmuWindow* emu_window) {
Pica::Init(); Pica::Init();
g_emu_window = emu_window; g_emu_window = emu_window;
g_renderer = std::make_unique<RendererOpenGL>(); g_renderer = std::make_unique<RendererOpenGL>();
g_renderer->SetWindow(g_emu_window); g_renderer->SetWindow(g_emu_window);
if (g_renderer->Init()) { Core::System::ResultStatus result = g_renderer->Init();
LOG_DEBUG(Render, "initialized OK");
} else { if (result != Core::System::ResultStatus::Success) {
LOG_ERROR(Render, "initialization failed !"); LOG_ERROR(Render, "initialization failed !");
return false; } else {
LOG_DEBUG(Render, "initialized OK");
} }
return true;
return result;
} }
/// Shutdown the video core /// Shutdown the video core

View file

@ -6,6 +6,7 @@
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include "core/core.h"
class EmuWindow; class EmuWindow;
class RendererBase; class RendererBase;
@ -28,7 +29,7 @@ extern std::atomic<bool> g_hw_shader_accurate_mul;
extern std::atomic<bool> g_renderer_bg_color_update_requested; extern std::atomic<bool> g_renderer_bg_color_update_requested;
/// Initialize the video core /// Initialize the video core
bool Init(EmuWindow* emu_window); Core::System::ResultStatus Init(EmuWindow* emu_window);
/// Shutdown the video core /// Shutdown the video core
void Shutdown(); void Shutdown();