Applied clang-format-18 to codebase

This commit is contained in:
OpenSauce04 2024-11-10 21:02:54 +00:00
parent 3e02c29225
commit fd55b4fd6c
148 changed files with 1028 additions and 1029 deletions

View File

@ -42,7 +42,9 @@ struct CaptureSession final {
#define MEMBER(type, name, func) \ #define MEMBER(type, name, func) \
struct type##Deleter { \ struct type##Deleter { \
void operator()(type* ptr) { type##_##func(ptr); } \ void operator()(type* ptr) { \
type##_##func(ptr); \
} \
}; \ }; \
std::unique_ptr<type, type##Deleter> name std::unique_ptr<type, type##Deleter> name

View File

@ -40,8 +40,8 @@ class SharedContext_Android : public Frontend::GraphicsContext {
public: public:
SharedContext_Android(EGLDisplay egl_display, EGLConfig egl_config, SharedContext_Android(EGLDisplay egl_display, EGLConfig egl_config,
EGLContext egl_share_context) EGLContext egl_share_context)
: egl_display{egl_display}, egl_surface{eglCreatePbufferSurface(egl_display, egl_config, : egl_display{egl_display},
egl_empty_attribs.data())}, egl_surface{eglCreatePbufferSurface(egl_display, egl_config, egl_empty_attribs.data())},
egl_context{eglCreateContext(egl_display, egl_config, egl_share_context, egl_context{eglCreateContext(egl_display, egl_config, egl_share_context,
egl_context_attribs.data())} { egl_context_attribs.data())} {
ASSERT_MSG(egl_surface, "eglCreatePbufferSurface() failed!"); ASSERT_MSG(egl_surface, "eglCreatePbufferSurface() failed!");

View File

@ -215,8 +215,8 @@ Joystick::~Joystick() {
} }
ButtonFactory::ButtonFactory() ButtonFactory::ButtonFactory()
: button_list{std::make_shared<ButtonList>()}, analog_button_list{ : button_list{std::make_shared<ButtonList>()},
std::make_shared<AnalogButtonList>()} {} analog_button_list{std::make_shared<AnalogButtonList>()} {}
std::unique_ptr<Input::ButtonDevice> ButtonFactory::Create(const Common::ParamPackage& params) { std::unique_ptr<Input::ButtonDevice> ButtonFactory::Create(const Common::ParamPackage& params) {
if (params.Has("axis")) { if (params.Has("axis")) {

View File

@ -342,8 +342,7 @@ void JNICALL Java_org_citra_citra_1emu_NativeLibrary_initializeGpuDriver(
GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir)); GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir));
} }
void JNICALL Java_org_citra_citra_1emu_NativeLibrary_enableAdrenoTurboMode(JNIEnv* env, void JNICALL Java_org_citra_citra_1emu_NativeLibrary_enableAdrenoTurboMode(JNIEnv* env, jobject obj,
jobject obj,
jboolean enable) { jboolean enable) {
EnableAdrenoTurboMode(enable); EnableAdrenoTurboMode(enable);
} }

View File

@ -41,6 +41,7 @@
#include "citra_qt/bootmanager.h" #include "citra_qt/bootmanager.h"
#include "citra_qt/camera/qt_multimedia_camera.h" #include "citra_qt/camera/qt_multimedia_camera.h"
#include "citra_qt/camera/still_image_camera.h" #include "citra_qt/camera/still_image_camera.h"
#include "citra_qt/citra_qt.h"
#include "citra_qt/compatibility_list.h" #include "citra_qt/compatibility_list.h"
#include "citra_qt/configuration/config.h" #include "citra_qt/configuration/config.h"
#include "citra_qt/configuration/configure_dialog.h" #include "citra_qt/configuration/configure_dialog.h"
@ -62,7 +63,6 @@
#include "citra_qt/game_list.h" #include "citra_qt/game_list.h"
#include "citra_qt/hotkeys.h" #include "citra_qt/hotkeys.h"
#include "citra_qt/loading_screen.h" #include "citra_qt/loading_screen.h"
#include "citra_qt/citra_qt.h"
#include "citra_qt/movie/movie_play_dialog.h" #include "citra_qt/movie/movie_play_dialog.h"
#include "citra_qt/movie/movie_record_dialog.h" #include "citra_qt/movie/movie_record_dialog.h"
#include "citra_qt/multiplayer/state.h" #include "citra_qt/multiplayer/state.h"
@ -766,7 +766,8 @@ void GMainWindow::InitializeHotkeys() {
// QShortcut Hotkeys // QShortcut Hotkeys
const auto connect_shortcut = [&](const QString& action_name, const auto& function) { const auto connect_shortcut = [&](const QString& action_name, const auto& function) {
const auto* hotkey = hotkey_registry.GetHotkey(main_window, action_name, this); const auto* hotkey = hotkey_registry.GetHotkey(main_window, action_name, this);
const auto* secondary_hotkey = hotkey_registry.GetHotkey(main_window, action_name, secondary_window); const auto* secondary_hotkey =
hotkey_registry.GetHotkey(main_window, action_name, secondary_window);
connect(hotkey, &QShortcut::activated, this, function); connect(hotkey, &QShortcut::activated, this, function);
connect(secondary_hotkey, &QShortcut::activated, this, function); connect(secondary_hotkey, &QShortcut::activated, this, function);
}; };

View File

@ -13,9 +13,8 @@
#include "ui_configure_cheats.h" #include "ui_configure_cheats.h"
ConfigureCheats::ConfigureCheats(Cheats::CheatEngine& cheat_engine_, u64 title_id_, QWidget* parent) ConfigureCheats::ConfigureCheats(Cheats::CheatEngine& cheat_engine_, u64 title_id_, QWidget* parent)
: QWidget(parent), : QWidget(parent), ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_},
ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_}, title_id{ title_id{title_id_} {
title_id_} {
// Setup gui control settings // Setup gui control settings
ui->setupUi(this); ui->setupUi(this);
ui->tableCheats->setColumnWidth(0, 30); ui->tableCheats->setColumnWidth(0, 30);

View File

@ -3,9 +3,9 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <QColorDialog> #include <QColorDialog>
#include "common/settings.h"
#include "citra_qt/configuration/configuration_shared.h" #include "citra_qt/configuration/configuration_shared.h"
#include "citra_qt/configuration/configure_layout.h" #include "citra_qt/configuration/configure_layout.h"
#include "common/settings.h"
#include "ui_configure_layout.h" #include "ui_configure_layout.h"
#ifdef ENABLE_OPENGL #ifdef ENABLE_OPENGL
#include "video_core/renderer_opengl/post_processing_opengl.h" #include "video_core/renderer_opengl/post_processing_opengl.h"

View File

@ -141,8 +141,8 @@ QString BreakPointModel::DebugContextEventToString(Pica::DebugContext::Event eve
GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent) std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent)
: QDockWidget(tr("Pica Breakpoints"), parent), Pica::DebugContext::BreakPointObserver( : QDockWidget(tr("Pica Breakpoints"), parent),
debug_context) { Pica::DebugContext::BreakPointObserver(debug_context) {
setObjectName(QStringLiteral("PicaBreakPointsWidget")); setObjectName(QStringLiteral("PicaBreakPointsWidget"));
status_text = new QLabel(tr("Emulation running")); status_text = new QLabel(tr("Emulation running"));

View File

@ -25,11 +25,11 @@
#include <QToolButton> #include <QToolButton>
#include <QTreeView> #include <QTreeView>
#include <fmt/format.h> #include <fmt/format.h>
#include "citra_qt/citra_qt.h"
#include "citra_qt/compatibility_list.h" #include "citra_qt/compatibility_list.h"
#include "citra_qt/game_list.h" #include "citra_qt/game_list.h"
#include "citra_qt/game_list_p.h" #include "citra_qt/game_list_p.h"
#include "citra_qt/game_list_worker.h" #include "citra_qt/game_list_worker.h"
#include "citra_qt/citra_qt.h"
#include "citra_qt/uisettings.h" #include "citra_qt/uisettings.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/settings.h" #include "common/settings.h"

View File

@ -16,8 +16,8 @@
#include "ui_movie_play_dialog.h" #include "ui_movie_play_dialog.h"
MoviePlayDialog::MoviePlayDialog(QWidget* parent, GameList* game_list_, const Core::System& system_) MoviePlayDialog::MoviePlayDialog(QWidget* parent, GameList* game_list_, const Core::System& system_)
: QDialog(parent), : QDialog(parent), ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_},
ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_}, system{system_} { system{system_} {
ui->setupUi(this); ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);

View File

@ -5,8 +5,8 @@
#include <QInputDialog> #include <QInputDialog>
#include <QList> #include <QList>
#include <QtConcurrent/QtConcurrentRun> #include <QtConcurrent/QtConcurrentRun>
#include "citra_qt/game_list_p.h"
#include "citra_qt/citra_qt.h" #include "citra_qt/citra_qt.h"
#include "citra_qt/game_list_p.h"
#include "citra_qt/multiplayer/lobby.h" #include "citra_qt/multiplayer/lobby.h"
#include "citra_qt/multiplayer/lobby_p.h" #include "citra_qt/multiplayer/lobby_p.h"
#include "citra_qt/multiplayer/message.h" #include "citra_qt/multiplayer/message.h"

View File

@ -23,6 +23,7 @@
#include "citra_sdl/emu_window/emu_window_sdl2_vk.h" #include "citra_sdl/emu_window/emu_window_sdl2_vk.h"
#endif #endif
#include "SDL_messagebox.h" #include "SDL_messagebox.h"
#include "citra_meta/common_strings.h"
#include "common/common_paths.h" #include "common/common_paths.h"
#include "common/detached_tasks.h" #include "common/detached_tasks.h"
#include "common/file_util.h" #include "common/file_util.h"
@ -41,7 +42,6 @@
#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg.h"
#include "core/movie.h" #include "core/movie.h"
#include "input_common/main.h" #include "input_common/main.h"
#include "citra_meta/common_strings.h"
#include "network/network.h" #include "network/network.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
@ -391,8 +391,8 @@ void LaunchSdlFrontend(int argc, char** argv) {
const auto scope = emu_window->Acquire(); const auto scope = emu_window->Acquire();
LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch,
Common::g_scm_branch, Common::g_scm_desc); Common::g_scm_desc);
Settings::LogSettings(); Settings::LogSettings();
const Core::System::ResultStatus load_result{ const Core::System::ResultStatus load_result{

View File

@ -599,14 +599,14 @@ public:
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr, template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr> std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>) constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{ : impl_base{unexpect_t{}, std::move(e.value())},
detail::default_constructor_tag{}} {} ctor_base{detail::default_constructor_tag{}} {}
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr, template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr> std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>) constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{ : impl_base{unexpect_t{}, std::move(e.value())},
detail::default_constructor_tag{}} {} ctor_base{detail::default_constructor_tag{}} {}
template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr> template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
constexpr explicit Expected(unexpect_t, Args&&... args) constexpr explicit Expected(unexpect_t, Args&&... args)

View File

@ -221,8 +221,8 @@ public:
explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val, explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val,
const std::string& name) const std::string& name)
requires(ranged) requires(ranged)
: value{default_val}, : value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val},
default_value{default_val}, maximum{max_val}, minimum{min_val}, label{name} {} label{name} {}
/** /**
* Returns a reference to the setting's value. * Returns a reference to the setting's value.
@ -479,8 +479,7 @@ struct Values {
// TODO: Add a null renderer backend for this, perhaps. // TODO: Add a null renderer backend for this, perhaps.
#error "At least one renderer must be enabled." #error "At least one renderer must be enabled."
#endif #endif
GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api" GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api"};
};
SwitchableSetting<u32> physical_device{0, "physical_device"}; SwitchableSetting<u32> physical_device{0, "physical_device"};
Setting<bool> use_gles{false, "use_gles"}; Setting<bool> use_gles{false, "use_gles"};
Setting<bool> renderer_debug{false, "renderer_debug"}; Setting<bool> renderer_debug{false, "renderer_debug"};

View File

@ -396,7 +396,9 @@ public:
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all // _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
// component names (x<->r) and permutations (xy<->yx) // component names (x<->r) and permutations (xy<->yx)
#define _DEFINE_SWIZZLER2(a, b, name) \ #define _DEFINE_SWIZZLER2(a, b, name) \
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); } [[nodiscard]] constexpr Vec2<T> name() const { \
return Vec2<T>(a, b); \
}
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \ #define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
_DEFINE_SWIZZLER2(a, b, a##b); \ _DEFINE_SWIZZLER2(a, b, a##b); \
_DEFINE_SWIZZLER2(a, b, a2##b2); \ _DEFINE_SWIZZLER2(a, b, a2##b2); \
@ -596,7 +598,9 @@ public:
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
// permutations (xy<->yx) // permutations (xy<->yx)
#define _DEFINE_SWIZZLER2(a, b, name) \ #define _DEFINE_SWIZZLER2(a, b, name) \
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); } [[nodiscard]] constexpr Vec2<T> name() const { \
return Vec2<T>(a, b); \
}
#define DEFINE_SWIZZLER2_COMP1(a, a2) \ #define DEFINE_SWIZZLER2_COMP1(a, a2) \
_DEFINE_SWIZZLER2(a, a, a##a); \ _DEFINE_SWIZZLER2(a, a, a##a); \
_DEFINE_SWIZZLER2(a, a, a2##a2) _DEFINE_SWIZZLER2(a, a, a2##a2)
@ -621,7 +625,9 @@ public:
#undef _DEFINE_SWIZZLER2 #undef _DEFINE_SWIZZLER2
#define _DEFINE_SWIZZLER3(a, b, c, name) \ #define _DEFINE_SWIZZLER3(a, b, c, name) \
[[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); } [[nodiscard]] constexpr Vec3<T> name() const { \
return Vec3<T>(a, b, c); \
}
#define DEFINE_SWIZZLER3_COMP1(a, a2) \ #define DEFINE_SWIZZLER3_COMP1(a, a2) \
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \ _DEFINE_SWIZZLER3(a, a, a, a##a##a); \
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2) _DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)

View File

@ -43,8 +43,8 @@ struct GPU::Impl {
: timing{system.CoreTiming()}, system{system}, memory{system.Memory()}, : timing{system.CoreTiming()}, system{system}, memory{system.Memory()},
debug_context{Pica::g_debug_context}, pica{memory, debug_context}, debug_context{Pica::g_debug_context}, pica{memory, debug_context},
renderer{VideoCore::CreateRenderer(emu_window, secondary_window, pica, system)}, renderer{VideoCore::CreateRenderer(emu_window, secondary_window, pica, system)},
rasterizer{renderer->Rasterizer()}, sw_blitter{std::make_unique<SwRenderer::SwBlitter>( rasterizer{renderer->Rasterizer()},
memory, rasterizer)} {} sw_blitter{std::make_unique<SwRenderer::SwBlitter>(memory, rasterizer)} {}
~Impl() = default; ~Impl() = default;
}; };

View File

@ -31,9 +31,8 @@ union CommandHeader {
static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!"); static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext> debug_context_) PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext> debug_context_)
: memory{memory_}, debug_context{std::move(debug_context_)}, geometry_pipeline{regs.internal, : memory{memory_}, debug_context{std::move(debug_context_)},
gs_unit, geometry_pipeline{regs.internal, gs_unit, gs_setup},
gs_setup},
shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} { shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} {
InitializeRegs(); InitializeRegs();

View File

@ -55,12 +55,12 @@ OGLProgram CreateProgram(std::string_view frag) {
BlitHelper::BlitHelper(const Driver& driver_) BlitHelper::BlitHelper(const Driver& driver_)
: driver{driver_}, linear_sampler{CreateSampler(GL_LINEAR)}, : driver{driver_}, linear_sampler{CreateSampler(GL_LINEAR)},
nearest_sampler{CreateSampler(GL_NEAREST)}, bicubic_program{CreateProgram( nearest_sampler{CreateSampler(GL_NEAREST)},
HostShaders::BICUBIC_FRAG)}, bicubic_program{CreateProgram(HostShaders::BICUBIC_FRAG)},
scale_force_program{CreateProgram(HostShaders::SCALE_FORCE_FRAG)}, scale_force_program{CreateProgram(HostShaders::SCALE_FORCE_FRAG)},
xbrz_program{CreateProgram(HostShaders::XBRZ_FREESCALE_FRAG)}, xbrz_program{CreateProgram(HostShaders::XBRZ_FREESCALE_FRAG)},
mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)}, gradient_x_program{CreateProgram( mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)},
HostShaders::X_GRADIENT_FRAG)}, gradient_x_program{CreateProgram(HostShaders::X_GRADIENT_FRAG)},
gradient_y_program{CreateProgram(HostShaders::Y_GRADIENT_FRAG)}, gradient_y_program{CreateProgram(HostShaders::Y_GRADIENT_FRAG)},
refine_program{CreateProgram(HostShaders::REFINE_FRAG)}, refine_program{CreateProgram(HostShaders::REFINE_FRAG)},
d24s8_to_rgba8{CreateProgram(HostShaders::D24S8_TO_RGBA8_FRAG)}, d24s8_to_rgba8{CreateProgram(HostShaders::D24S8_TO_RGBA8_FRAG)},

View File

@ -970,10 +970,9 @@ void RasterizerOpenGL::SyncAndUploadLUTsLF() {
if (fs_uniform_block_data.fog_lut_dirty || invalidate) { if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
std::array<Common::Vec2f, 128> new_data; std::array<Common::Vec2f, 128> new_data;
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(), std::transform(
[](const auto& entry) { pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; [](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
});
if (new_data != fog_lut_data || invalidate) { if (new_data != fog_lut_data || invalidate) {
fog_lut_data = new_data; fog_lut_data = new_data;

View File

@ -331,8 +331,8 @@ public:
ShaderProgramManager::ShaderProgramManager(Frontend::EmuWindow& emu_window_, const Driver& driver_, ShaderProgramManager::ShaderProgramManager(Frontend::EmuWindow& emu_window_, const Driver& driver_,
bool separable) bool separable)
: emu_window{emu_window_}, driver{driver_}, : emu_window{emu_window_}, driver{driver_},
strict_context_required{emu_window.StrictContextRequired()}, impl{std::make_unique<Impl>( strict_context_required{emu_window.StrictContextRequired()},
driver_, separable)} {} impl{std::make_unique<Impl>(driver_, separable)} {}
ShaderProgramManager::~ShaderProgramManager() = default; ShaderProgramManager::~ShaderProgramManager() = default;

View File

@ -602,8 +602,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params, Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
const Surface* color, const Surface* depth) const Surface* color, const Surface* depth)
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale : VideoCore::FramebufferParams{params},
: (depth ? depth->res_scale : 1u)} { res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
if (shadow_rendering && !color) { if (shadow_rendering && !color) {
return; return;

View File

@ -75,9 +75,8 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons
RendererOpenGL::RendererOpenGL(Core::System& system, Pica::PicaCore& pica_, RendererOpenGL::RendererOpenGL(Core::System& system, Pica::PicaCore& pica_,
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window) Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
: VideoCore::RendererBase{system, window, secondary_window}, pica{pica_}, : VideoCore::RendererBase{system, window, secondary_window}, pica{pica_},
rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver}, frame_dumper{ rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver},
system, frame_dumper{system, window} {
window} {
const bool has_debug_tool = driver.HasDebugTool(); const bool has_debug_tool = driver.HasDebugTool();
window.mailbox = std::make_unique<OGLTextureMailbox>(has_debug_tool); window.mailbox = std::make_unique<OGLTextureMailbox>(has_debug_tool);
if (secondary_window) { if (secondary_window) {

View File

@ -132,14 +132,14 @@ std::string GetReadableVersion(u32 version) {
} // Anonymous namespace } // Anonymous namespace
Instance::Instance(bool enable_validation, bool dump_command_buffers) Instance::Instance(bool enable_validation, bool dump_command_buffers)
: library{OpenLibrary()}, instance{CreateInstance(*library, : library{OpenLibrary()},
Frontend::WindowSystemType::Headless, instance{CreateInstance(*library, Frontend::WindowSystemType::Headless, enable_validation,
enable_validation, dump_command_buffers)}, dump_command_buffers)},
physical_devices{instance->enumeratePhysicalDevices()} {} physical_devices{instance->enumeratePhysicalDevices()} {}
Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index) Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
: library{OpenLibrary(&window)}, instance{CreateInstance( : library{OpenLibrary(&window)},
*library, window.GetWindowInfo().type, instance{CreateInstance(*library, window.GetWindowInfo().type,
Settings::values.renderer_debug.GetValue(), Settings::values.renderer_debug.GetValue(),
Settings::values.dump_command_buffers.GetValue())}, Settings::values.dump_command_buffers.GetValue())},
debug_callback{CreateDebugCallback(*instance, debug_utils_supported)}, debug_callback{CreateDebugCallback(*instance, debug_utils_supported)},

View File

@ -100,8 +100,8 @@ bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, vk::Format fo
PresentWindow::PresentWindow(Frontend::EmuWindow& emu_window_, const Instance& instance_, PresentWindow::PresentWindow(Frontend::EmuWindow& emu_window_, const Instance& instance_,
Scheduler& scheduler_) Scheduler& scheduler_)
: emu_window{emu_window_}, instance{instance_}, scheduler{scheduler_}, : emu_window{emu_window_}, instance{instance_}, scheduler{scheduler_},
surface{CreateSurface(instance.GetInstance(), emu_window)}, surface{CreateSurface(instance.GetInstance(), emu_window)}, next_surface{surface},
next_surface{surface}, swapchain{instance, emu_window.GetFramebufferLayout().width, swapchain{instance, emu_window.GetFramebufferLayout().width,
emu_window.GetFramebufferLayout().height, surface}, emu_window.GetFramebufferLayout().height, surface},
graphics_queue{instance.GetGraphicsQueue()}, present_renderpass{CreateRenderpass()}, graphics_queue{instance.GetGraphicsQueue()}, present_renderpass{CreateRenderpass()},
vsync_enabled{Settings::values.use_vsync_new.GetValue()}, vsync_enabled{Settings::values.use_vsync_new.GetValue()},

View File

@ -62,11 +62,8 @@ RasterizerVulkan::RasterizerVulkan(Memory::MemorySystem& memory, Pica::PicaCore&
DescriptorUpdateQueue& update_queue_, u32 image_count) DescriptorUpdateQueue& update_queue_, u32 image_count)
: RasterizerAccelerated{memory, pica}, instance{instance}, scheduler{scheduler}, : RasterizerAccelerated{memory, pica}, instance{instance}, scheduler{scheduler},
renderpass_cache{renderpass_cache}, update_queue{update_queue_}, renderpass_cache{renderpass_cache}, update_queue{update_queue_},
pipeline_cache{instance, scheduler, renderpass_cache, update_queue}, runtime{instance, pipeline_cache{instance, scheduler, renderpass_cache, update_queue},
scheduler, runtime{instance, scheduler, renderpass_cache, update_queue, image_count},
renderpass_cache,
update_queue,
image_count},
res_cache{memory, custom_tex_manager, runtime, regs, renderer}, res_cache{memory, custom_tex_manager, runtime, regs, renderer},
stream_buffer{instance, scheduler, BUFFER_USAGE, STREAM_BUFFER_SIZE}, stream_buffer{instance, scheduler, BUFFER_USAGE, STREAM_BUFFER_SIZE},
uniform_buffer{instance, scheduler, vk::BufferUsageFlagBits::eUniformBuffer, uniform_buffer{instance, scheduler, vk::BufferUsageFlagBits::eUniformBuffer,
@ -966,10 +963,9 @@ void RasterizerVulkan::SyncAndUploadLUTsLF() {
if (fs_uniform_block_data.fog_lut_dirty || invalidate) { if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
std::array<Common::Vec2f, 128> new_data; std::array<Common::Vec2f, 128> new_data;
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(), std::transform(
[](const auto& entry) { pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; [](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
});
if (new_data != fog_lut_data || invalidate) { if (new_data != fog_lut_data || invalidate) {
fog_lut_data = new_data; fog_lut_data = new_data;

View File

@ -1450,8 +1450,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params, Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
Surface* color, Surface* depth) Surface* color, Surface* depth)
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale : VideoCore::FramebufferParams{params},
: (depth ? depth->res_scale : 1u)} { res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
auto& renderpass_cache = runtime.GetRenderpassCache(); auto& renderpass_cache = runtime.GetRenderpassCache();
if (shadow_rendering && !color) { if (shadow_rendering && !color) {
return; return;
@ -1544,8 +1544,8 @@ Sampler::Sampler(TextureRuntime& runtime, const VideoCore::SamplerParams& params
Sampler::~Sampler() = default; Sampler::~Sampler() = default;
DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string_view label) DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string_view label)
: scheduler{runtime.GetScheduler()}, has_debug_tool{ : scheduler{runtime.GetScheduler()},
runtime.GetInstance().HasDebuggingToolAttached()} { has_debug_tool{runtime.GetInstance().HasDebuggingToolAttached()} {
if (!has_debug_tool) { if (!has_debug_tool) {
return; return;
} }