2015-12-07 08:36:12 +05:30
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-04-30 21:04:51 +05:30
|
|
|
#include <atomic>
|
2015-12-07 08:36:12 +05:30
|
|
|
#include <memory>
|
2016-09-21 12:22:38 +05:30
|
|
|
#include "video_core/renderer_base.h"
|
2015-12-07 08:36:12 +05:30
|
|
|
#include "video_core/renderer_opengl/gl_rasterizer.h"
|
2016-09-18 06:08:01 +05:30
|
|
|
#include "video_core/swrasterizer.h"
|
|
|
|
#include "video_core/video_core.h"
|
2015-12-07 08:36:12 +05:30
|
|
|
|
|
|
|
void RendererBase::RefreshRasterizerSetting() {
|
|
|
|
bool hw_renderer_enabled = VideoCore::g_hw_renderer_enabled;
|
|
|
|
if (rasterizer == nullptr || opengl_rasterizer_active != hw_renderer_enabled) {
|
|
|
|
opengl_rasterizer_active = hw_renderer_enabled;
|
|
|
|
|
|
|
|
if (hw_renderer_enabled) {
|
2016-04-05 17:59:55 +05:30
|
|
|
rasterizer = std::make_unique<RasterizerOpenGL>();
|
2015-12-07 08:36:12 +05:30
|
|
|
} else {
|
2016-04-05 17:59:55 +05:30
|
|
|
rasterizer = std::make_unique<VideoCore::SWRasterizer>();
|
2015-12-07 08:36:12 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|