Add more verbose popups for video_core errors

This commit is contained in:
fearlessTobi 2018-07-20 17:20:57 +02:00
parent 96c025e4c2
commit d1c5f01afe
8 changed files with 45 additions and 20 deletions

View file

@ -681,7 +681,19 @@ 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("An error occured in the video core."),
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("Error while initializing OpenGL 3.3 Core!"),
tr("Your GPU may not support OpenGL 3.3, or you do not "
"have the latest graphics driver."));
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

@ -51,6 +51,10 @@ public:
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
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 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;
@ -31,7 +32,7 @@ extern std::atomic<bool> g_renderer_bg_color_update_requested;
void Start(); void Start();
/// 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();