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->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()) {
QMessageBox::critical(this, tr("OpenGL 3.3 Unsupported"),
tr("Your GPU may not support OpenGL 3.3, or you do not "
"have the latest graphics driver."));
QMessageBox::critical(this, tr(below_gl33_title), tr(below_gl33_message));
return false;
}
@ -689,7 +691,18 @@ bool GMainWindow::LoadROM(const QString& filename) {
"the "
"log</a> for more details. "
"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;
default:

View File

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

View File

@ -46,12 +46,16 @@ public:
ErrorSystemMode, ///< Error determining the system mode
ErrorLoader, ///< Error loading the specified application
ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption
ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an
/// invalid format
ErrorSystemFiles, ///< Error in finding system files
ErrorSharedFont, ///< Error in finding shared font
ErrorVideoCore, ///< Error in the video core
ErrorUnknown ///< Any other error
ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an
/// invalid format
ErrorSystemFiles, ///< Error in finding system files
ErrorSharedFont, ///< Error in finding shared font
ErrorVideoCore, ///< Error in the video core
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 "common/common_types.h"
#include "core/core.h"
#include "video_core/rasterizer_interface.h"
class EmuWindow;
@ -27,7 +28,7 @@ public:
virtual void SetWindow(EmuWindow* window) = 0;
/// Initialize the renderer
virtual bool Init() = 0;
virtual Core::System::ResultStatus Init() = 0;
/// Shutdown the renderer
virtual void ShutDown() = 0;

View File

@ -505,7 +505,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
}
/// Initialize the renderer
bool RendererOpenGL::Init() {
Core::System::ResultStatus RendererOpenGL::Init() {
render_window->MakeCurrent();
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_OpenGL_Version", gl_version);
if (gpu_vendor == "GDI Generic") {
return Core::System::ResultStatus::ErrorVideoCore_ErrorGenericDrivers;
}
if (!GLAD_GL_VERSION_3_3) {
return false;
return Core::System::ResultStatus::ErrorVideoCore_ErrorBelowGL33;
}
InitOpenGLObjects();
RefreshRasterizerSetting();
return true;
return Core::System::ResultStatus::Success;
}
/// Shutdown the renderer

View File

@ -47,7 +47,7 @@ public:
void SetWindow(EmuWindow* window) override;
/// Initialize the renderer
bool Init() override;
Core::System::ResultStatus Init() override;
/// Shutdown the renderer
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;
/// Initialize the video core
bool Init(EmuWindow* emu_window) {
Core::System::ResultStatus Init(EmuWindow* emu_window) {
Pica::Init();
g_emu_window = emu_window;
g_renderer = std::make_unique<RendererOpenGL>();
g_renderer->SetWindow(g_emu_window);
if (g_renderer->Init()) {
LOG_DEBUG(Render, "initialized OK");
} else {
Core::System::ResultStatus result = g_renderer->Init();
if (result != Core::System::ResultStatus::Success) {
LOG_ERROR(Render, "initialization failed !");
return false;
} else {
LOG_DEBUG(Render, "initialized OK");
}
return true;
return result;
}
/// Shutdown the video core

View File

@ -6,6 +6,7 @@
#include <atomic>
#include <memory>
#include "core/core.h"
class EmuWindow;
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;
/// Initialize the video core
bool Init(EmuWindow* emu_window);
Core::System::ResultStatus Init(EmuWindow* emu_window);
/// Shutdown the video core
void Shutdown();