This commit is contained in:
Joshua Vandaële 2025-04-24 07:21:01 +02:00 committed by GitHub
commit d88e0660ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 170 additions and 220 deletions

View file

@ -39,7 +39,7 @@ This guide is for developers who wish to contribute to the Dolphin codebase. It
Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the code itself has no mistakes). Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the code itself has no mistakes).
This project uses clang-format 13.0 to check for common style issues. In case of conflicts between this guide and clang-format rules, the latter should be followed instead of this guide. This project uses clang-format 19.1 to check for common style issues. In case of conflicts between this guide and clang-format rules, the latter should be followed instead of this guide.
## <a name="intro-formatting-issues"></a>Checking and fixing formatting issues ## <a name="intro-formatting-issues"></a>Checking and fixing formatting issues

View file

@ -54,6 +54,7 @@ IncludeCategories:
IndentCaseLabels: false IndentCaseLabels: false
IndentWidth: 2 IndentWidth: 2
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
@ -67,6 +68,8 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60 PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left PointerAlignment: Left
ReflowComments: true ReflowComments: true
RemoveSemicolon: true
RequiresClausePosition: WithPreceding
SortIncludes: true SortIncludes: true
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
@ -79,6 +82,8 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
Standard: Latest Standard: Latest
StatementAttributeLikeMacros:
- emit
TabWidth: 2 TabWidth: 2
UseTab: Never UseTab: Never
--- ---
@ -93,4 +98,3 @@ ObjCSpaceBeforeProtocolList: true
BraceWrapping: BraceWrapping:
AfterObjCDeclaration: true AfterObjCDeclaration: true
... ...

View file

@ -429,7 +429,10 @@ extern const CaseInsensitiveDict<ParseInfo, '.', '_'> mnemonic_tokens = {
#define PSEUDO(mnemonic, base, variant_bits, alg) \ #define PSEUDO(mnemonic, base, variant_bits, alg) \
{ \ { \
mnemonic, { static_cast<size_t>(base) * VARIANT_PERMUTATIONS + (variant_bits), alg } \ mnemonic, \
{ \
static_cast<size_t>(base) * VARIANT_PERMUTATIONS + (variant_bits), alg \
} \
} }
#define PLAIN_PSEUDO(mnemonic, base, alg) PSEUDO(mnemonic, base, PLAIN_MNEMONIC, alg) #define PLAIN_PSEUDO(mnemonic, base, alg) PSEUDO(mnemonic, base, PLAIN_MNEMONIC, alg)
#define RC_PSEUDO(mnemonic, base, alg) \ #define RC_PSEUDO(mnemonic, base, alg) \
@ -1048,7 +1051,10 @@ void FillMfsprBatAndBitswap(OperandList& operands)
} // namespace } // namespace
#define PSEUDO(base, variant_bits, cb) \ #define PSEUDO(base, variant_bits, cb) \
ExtendedMnemonicDesc { static_cast<size_t>(base) * VARIANT_PERMUTATIONS + variant_bits, cb } ExtendedMnemonicDesc \
{ \
static_cast<size_t>(base) * VARIANT_PERMUTATIONS + variant_bits, cb \
}
#define PLAIN_PSEUDO(base, cb) \ #define PLAIN_PSEUDO(base, cb) \
PSEUDO(base, PLAIN_MNEMONIC, cb), INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC PSEUDO(base, PLAIN_MNEMONIC, cb), INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC
#define RC_PSEUDO(base, cb) \ #define RC_PSEUDO(base, cb) \

View file

@ -155,6 +155,6 @@ int __cdecl EnableCompatPatches()
// referencing it doesn't require ugly decorated names. // referencing it doesn't require ugly decorated names.
// Use /include:enableCompatPatches linker flag to enable this. // Use /include:enableCompatPatches linker flag to enable this.
extern "C" { extern "C" {
__declspec(allocate(".CRT$XCZ")) decltype(&EnableCompatPatches) __declspec(allocate(".CRT$XCZ")) decltype(&EnableCompatPatches) enableCompatPatches =
enableCompatPatches = EnableCompatPatches; EnableCompatPatches;
} }

View file

@ -18,7 +18,7 @@ namespace Config
// Setting a key to an object of this type will delete the key. // Setting a key to an object of this type will delete the key.
struct DefaultState struct DefaultState
{ {
friend constexpr bool operator==(DefaultState, DefaultState) { return true; }; friend constexpr bool operator==(DefaultState, DefaultState) { return true; }
}; };
namespace detail namespace detail

View file

@ -11,16 +11,16 @@ namespace Common
struct ContainsFn struct ContainsFn
{ {
template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity> template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity>
requires std::indirect_binary_predicate < std::ranges::equal_to, std::projected<I, Proj>, requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T*>
const T* > constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const
{ {
return std::ranges::find(std::move(first), last, value, std::move(proj)) != last; return std::ranges::find(std::move(first), last, value, std::move(proj)) != last;
} }
template <std::ranges::input_range R, class T, class Proj = std::identity> template <std::ranges::input_range R, class T, class Proj = std::identity>
requires std::indirect_binary_predicate < std::ranges::equal_to, requires std::indirect_binary_predicate<
std::projected<std::ranges::iterator_t<R>, Proj>, std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T*>
const T* > constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const
{ {
return (*this)(std::ranges::begin(r), std::ranges::end(r), value, std::move(proj)); return (*this)(std::ranges::begin(r), std::ranges::end(r), value, std::move(proj));
} }

View file

@ -996,41 +996,23 @@ PFNDOLDISPATCHCOMPUTEPROC dolDispatchCompute;
PFNDOLDISPATCHCOMPUTEINDIRECTPROC dolDispatchComputeIndirect; PFNDOLDISPATCHCOMPUTEINDIRECTPROC dolDispatchComputeIndirect;
// Creates a GLFunc object that requires a feature // Creates a GLFunc object that requires a feature
#define GLFUNC_REQUIRES(x, y) \ #define GLFUNC_REQUIRES(x, y) {(void**)&x, #x, y}
{ \
(void**)&x, #x, y \
}
// Creates a GLFunc object with a different function suffix // Creates a GLFunc object with a different function suffix
// For when we want to use the same function pointer, but different function name // For when we want to use the same function pointer, but different function name
#define GLFUNC_SUFFIX(x, y, z) \ #define GLFUNC_SUFFIX(x, y, z) {(void**)&x, #x #y, z}
{ \
(void**)&x, #x #y, z \
}
// Creates a GLFunc object that should always be able to get grabbed // Creates a GLFunc object that should always be able to get grabbed
// Used for Desktop OpenGL functions that should /always/ be provided. // Used for Desktop OpenGL functions that should /always/ be provided.
// aka GL 1.1/1.2/1.3/1.4 // aka GL 1.1/1.2/1.3/1.4
#define GLFUNC_ALWAYS_REQUIRED(x) \ #define GLFUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL"}
{ \
(void**)&x, #x, "VERSION_GL" \
}
// Creates a GLFunc object that should be able to get grabbed // Creates a GLFunc object that should be able to get grabbed
// on both GL and ES // on both GL and ES
#define GL_ES_FUNC_ALWAYS_REQUIRED(x) \ #define GL_ES_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_2"}
{ \
(void**)&x, #x, "VERSION_GL |VERSION_GLES_2" \
}
// Creates a GLFunc object that should be able to get grabbed // Creates a GLFunc object that should be able to get grabbed
// on both GL and ES 3.0 // on both GL and ES 3.0
#define GL_ES3_FUNC_ALWAYS_REQUIRED(x) \ #define GL_ES3_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_3"}
{ \
(void**)&x, #x, "VERSION_GL |VERSION_GLES_3" \
}
// Creates a GLFunc object that should be able to get grabbed // Creates a GLFunc object that should be able to get grabbed
// on both GL and ES 3.2 // on both GL and ES 3.2
#define GL_ES32_FUNC_ALWAYS_REQUIRED(x) \ #define GL_ES32_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_3_2"}
{ \
(void**)&x, #x, "VERSION_GL |VERSION_GLES_3_2" \
}
struct GLFunc struct GLFunc
{ {

View file

@ -73,9 +73,8 @@ void TruncateToCString(std::string* s);
bool TryParse(const std::string& str, bool* output); bool TryParse(const std::string& str, bool* output);
template <typename T> template <typename T>
requires(std::is_integral_v<T> || requires(std::is_integral_v<T> || (std::is_enum_v<T> && !detail::IsBooleanEnum<T>()))
(std::is_enum_v<T> && !detail::IsBooleanEnum<T>())) bool TryParse(const std::string& str, bool TryParse(const std::string& str, T* output, int base = 0)
T* output, int base = 0)
{ {
char* end_ptr = nullptr; char* end_ptr = nullptr;
@ -113,7 +112,8 @@ requires(std::is_integral_v<T> ||
} }
template <typename T> template <typename T>
requires(detail::IsBooleanEnum<T>()) bool TryParse(const std::string& str, T* output) requires(detail::IsBooleanEnum<T>())
bool TryParse(const std::string& str, T* output)
{ {
bool value; bool value;
if (!TryParse(str, &value)) if (!TryParse(str, &value))

View file

@ -171,8 +171,8 @@ public:
void SetDevMenuUpdateCallback(std::function<void(void)> callback) void SetDevMenuUpdateCallback(std::function<void(void)> callback)
{ {
m_dev_menu_callback = callback; m_dev_menu_callback = callback;
}; }
bool CheckForModifications() { return rc_client_raintegration_has_modifications(m_client); }; bool CheckForModifications() { return rc_client_raintegration_has_modifications(m_client); }
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION #endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
void DoState(PointerWrap& p); void DoState(PointerWrap& p);
@ -339,13 +339,13 @@ public:
u16 revision) u16 revision)
{ {
return true; return true;
}; }
constexpr bool CheckApprovedARCode(const ActionReplay::ARCode& code, const std::string& game_id, constexpr bool CheckApprovedARCode(const ActionReplay::ARCode& code, const std::string& game_id,
u16 revision) u16 revision)
{ {
return true; return true;
}; }
constexpr void LoadGame(const std::string&, const DiscIO::Volume*) {} constexpr void LoadGame(const std::string&, const DiscIO::Volume*) {}

View file

@ -672,7 +672,10 @@ void ZeldaUCode::RenderAudio()
// Utility to define 32 bit accessors/modifiers methods based on two 16 bit // Utility to define 32 bit accessors/modifiers methods based on two 16 bit
// fields named _l and _h. // fields named _l and _h.
#define DEFINE_32BIT_ACCESSOR(field_name, name) \ #define DEFINE_32BIT_ACCESSOR(field_name, name) \
u32 Get##name() const { return (field_name##_h << 16) | field_name##_l; } \ u32 Get##name() const \
{ \
return (field_name##_h << 16) | field_name##_l; \
} \
void Set##name(u32 v) \ void Set##name(u32 v) \
{ \ { \
field_name##_h = v >> 16; \ field_name##_h = v >> 16; \

View file

@ -23,7 +23,7 @@ protected:
bool ConnectInternal() override; bool ConnectInternal() override;
void DisconnectInternal() override; void DisconnectInternal() override;
bool IsConnected() const override; bool IsConnected() const override;
void IOWakeup() override{}; void IOWakeup() override {}
int IORead(u8* buf) override; int IORead(u8* buf) override;
int IOWrite(u8 const* buf, size_t len) override; int IOWrite(u8 const* buf, size_t len) override;

View file

@ -177,8 +177,8 @@ constexpr std::array<u8, 256> s_key_codes_azerty{};
} // Anonymous namespace } // Anonymous namespace
USB_KBD::MessageData::MessageData(MessageType type, u8 modifiers_, PressedKeyData pressed_keys_) USB_KBD::MessageData::MessageData(MessageType type, u8 modifiers_, PressedKeyData pressed_keys_)
: msg_type{Common::swap32(static_cast<u32>(type))}, modifiers{modifiers_}, pressed_keys{ : msg_type{Common::swap32(static_cast<u32>(type))}, modifiers{modifiers_},
pressed_keys_} pressed_keys{pressed_keys_}
{ {
} }

View file

@ -230,8 +230,7 @@ Expression::Expression(std::string_view text, ExprPointer ex, ExprVarListPointer
: m_text(text), m_expr(std::move(ex)), m_vars(std::move(vars)) : m_text(text), m_expr(std::move(ex)), m_vars(std::move(vars))
{ {
using LookupKV = std::pair<std::string_view, Expression::VarBinding>; using LookupKV = std::pair<std::string_view, Expression::VarBinding>;
static constexpr auto sorted_lookup = []() consteval static constexpr auto sorted_lookup = []() consteval {
{
using enum Expression::VarBindingType; using enum Expression::VarBindingType;
auto unsorted_lookup = std::to_array<LookupKV>({ auto unsorted_lookup = std::to_array<LookupKV>({
{"r0", {GPR, 0}}, {"r0", {GPR, 0}},
@ -385,8 +384,7 @@ Expression::Expression(std::string_view text, ExprPointer ex, ExprVarListPointer
}); });
std::ranges::sort(unsorted_lookup, {}, &LookupKV::first); std::ranges::sort(unsorted_lookup, {}, &LookupKV::first);
return unsorted_lookup; return unsorted_lookup;
} }();
();
static_assert(std::ranges::adjacent_find(sorted_lookup, {}, &LookupKV::first) == static_assert(std::ranges::adjacent_find(sorted_lookup, {}, &LookupKV::first) ==
sorted_lookup.end(), sorted_lookup.end(),
"Expression: Sorted lookup should not contain duplicate keys."); "Expression: Sorted lookup should not contain duplicate keys.");

View file

@ -337,8 +337,7 @@ constexpr std::array<InterpreterOpTemplate, 10> s_table63_2{{
{31, Interpreter::fnmaddx}, // fnmaddx {31, Interpreter::fnmaddx}, // fnmaddx
}}; }};
constexpr std::array<Interpreter::Instruction, 64> s_interpreter_op_table = []() consteval constexpr std::array<Interpreter::Instruction, 64> s_interpreter_op_table = []() consteval {
{
std::array<Interpreter::Instruction, 64> table{}; std::array<Interpreter::Instruction, 64> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
for (auto& tpl : s_primary_table) for (auto& tpl : s_primary_table)
@ -347,10 +346,8 @@ constexpr std::array<Interpreter::Instruction, 64> s_interpreter_op_table = []()
table[tpl.opcode] = tpl.fn; table[tpl.opcode] = tpl.fn;
}; };
return table; return table;
} }();
(); constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table4 = []() consteval {
constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table4 = []() consteval
{
std::array<Interpreter::Instruction, 1024> table{}; std::array<Interpreter::Instruction, 1024> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
@ -384,10 +381,8 @@ constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table4 = [
} }
return table; return table;
} }();
(); constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table19 = []() consteval {
constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table19 = []() consteval
{
std::array<Interpreter::Instruction, 1024> table{}; std::array<Interpreter::Instruction, 1024> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
for (auto& tpl : s_table19) for (auto& tpl : s_table19)
@ -396,10 +391,8 @@ constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table19 =
table[tpl.opcode] = tpl.fn; table[tpl.opcode] = tpl.fn;
}; };
return table; return table;
} }();
(); constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table31 = []() consteval {
constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table31 = []() consteval
{
std::array<Interpreter::Instruction, 1024> table{}; std::array<Interpreter::Instruction, 1024> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
for (auto& tpl : s_table31) for (auto& tpl : s_table31)
@ -408,10 +401,8 @@ constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table31 =
table[tpl.opcode] = tpl.fn; table[tpl.opcode] = tpl.fn;
}; };
return table; return table;
} }();
(); constexpr std::array<Interpreter::Instruction, 32> s_interpreter_op_table59 = []() consteval {
constexpr std::array<Interpreter::Instruction, 32> s_interpreter_op_table59 = []() consteval
{
std::array<Interpreter::Instruction, 32> table{}; std::array<Interpreter::Instruction, 32> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
for (auto& tpl : s_table59) for (auto& tpl : s_table59)
@ -420,10 +411,8 @@ constexpr std::array<Interpreter::Instruction, 32> s_interpreter_op_table59 = []
table[tpl.opcode] = tpl.fn; table[tpl.opcode] = tpl.fn;
}; };
return table; return table;
} }();
(); constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table63 = []() consteval {
constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table63 = []() consteval
{
std::array<Interpreter::Instruction, 1024> table{}; std::array<Interpreter::Instruction, 1024> table{};
table.fill(Interpreter::unknown_instruction); table.fill(Interpreter::unknown_instruction);
for (auto& tpl : s_table63) for (auto& tpl : s_table63)
@ -444,8 +433,7 @@ constexpr std::array<Interpreter::Instruction, 1024> s_interpreter_op_table63 =
} }
return table; return table;
} }();
();
Interpreter::Instruction Interpreter::GetInterpreterOp(UGeckoInstruction inst) Interpreter::Instruction Interpreter::GetInterpreterOp(UGeckoInstruction inst)
{ {

View file

@ -335,8 +335,7 @@ constexpr std::array<Jit64OpTemplate, 10> s_table63_2{{
{31, &Jit64::fmaddXX}, // fnmaddx {31, &Jit64::fmaddXX}, // fnmaddx
}}; }};
constexpr std::array<Jit64::Instruction, 64> s_dyna_op_table = []() consteval constexpr std::array<Jit64::Instruction, 64> s_dyna_op_table = []() consteval {
{
std::array<Jit64::Instruction, 64> table{}; std::array<Jit64::Instruction, 64> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -347,11 +346,9 @@ constexpr std::array<Jit64::Instruction, 64> s_dyna_op_table = []() consteval
} }
return table; return table;
} }();
();
constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table4 = []() consteval constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table4 = []() consteval {
{
std::array<Jit64::Instruction, 1024> table{}; std::array<Jit64::Instruction, 1024> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -385,11 +382,9 @@ constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table4 = []() consteval
} }
return table; return table;
} }();
();
constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table19 = []() consteval constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table19 = []() consteval {
{
std::array<Jit64::Instruction, 1024> table{}; std::array<Jit64::Instruction, 1024> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -400,11 +395,9 @@ constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table19 = []() consteva
} }
return table; return table;
} }();
();
constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table31 = []() consteval constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table31 = []() consteval {
{
std::array<Jit64::Instruction, 1024> table{}; std::array<Jit64::Instruction, 1024> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -415,11 +408,9 @@ constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table31 = []() consteva
} }
return table; return table;
} }();
();
constexpr std::array<Jit64::Instruction, 32> s_dyna_op_table59 = []() consteval constexpr std::array<Jit64::Instruction, 32> s_dyna_op_table59 = []() consteval {
{
std::array<Jit64::Instruction, 32> table{}; std::array<Jit64::Instruction, 32> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -430,11 +421,9 @@ constexpr std::array<Jit64::Instruction, 32> s_dyna_op_table59 = []() consteval
} }
return table; return table;
} }();
();
constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table63 = []() consteval constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table63 = []() consteval {
{
std::array<Jit64::Instruction, 1024> table{}; std::array<Jit64::Instruction, 1024> table{};
table.fill(&Jit64::FallBackToInterpreter); table.fill(&Jit64::FallBackToInterpreter);
@ -456,8 +445,7 @@ constexpr std::array<Jit64::Instruction, 1024> s_dyna_op_table63 = []() consteva
} }
return table; return table;
} }();
();
} // Anonymous namespace } // Anonymous namespace

View file

@ -335,8 +335,7 @@ constexpr std::array<JitArm64OpTemplate, 10> s_table63_2{{
{31, &JitArm64::fp_arith}, // fnmaddx {31, &JitArm64::fp_arith}, // fnmaddx
}}; }};
constexpr std::array<JitArm64::Instruction, 64> s_dyna_op_table = []() consteval constexpr std::array<JitArm64::Instruction, 64> s_dyna_op_table = []() consteval {
{
std::array<JitArm64::Instruction, 64> table{}; std::array<JitArm64::Instruction, 64> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -347,11 +346,9 @@ constexpr std::array<JitArm64::Instruction, 64> s_dyna_op_table = []() consteval
} }
return table; return table;
} }();
();
constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table4 = []() consteval constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table4 = []() consteval {
{
std::array<JitArm64::Instruction, 1024> table{}; std::array<JitArm64::Instruction, 1024> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -385,11 +382,9 @@ constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table4 = []() conste
} }
return table; return table;
} }();
();
constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table19 = []() consteval constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table19 = []() consteval {
{
std::array<JitArm64::Instruction, 1024> table{}; std::array<JitArm64::Instruction, 1024> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -400,11 +395,9 @@ constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table19 = []() const
} }
return table; return table;
} }();
();
constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table31 = []() consteval constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table31 = []() consteval {
{
std::array<JitArm64::Instruction, 1024> table{}; std::array<JitArm64::Instruction, 1024> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -415,11 +408,9 @@ constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table31 = []() const
} }
return table; return table;
} }();
();
constexpr std::array<JitArm64::Instruction, 32> s_dyna_op_table59 = []() consteval constexpr std::array<JitArm64::Instruction, 32> s_dyna_op_table59 = []() consteval {
{
std::array<JitArm64::Instruction, 32> table{}; std::array<JitArm64::Instruction, 32> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -430,11 +421,9 @@ constexpr std::array<JitArm64::Instruction, 32> s_dyna_op_table59 = []() constev
} }
return table; return table;
} }();
();
constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table63 = []() consteval constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table63 = []() consteval {
{
std::array<JitArm64::Instruction, 1024> table{}; std::array<JitArm64::Instruction, 1024> table{};
table.fill(&JitArm64::FallBackToInterpreter); table.fill(&JitArm64::FallBackToInterpreter);
@ -456,8 +445,7 @@ constexpr std::array<JitArm64::Instruction, 1024> s_dyna_op_table63 = []() const
} }
return table; return table;
} }();
();
} // Anonymous namespace } // Anonymous namespace

View file

@ -507,13 +507,11 @@ struct Tables
static std::array<GekkoOPStats, TOTAL_INSTRUCTION_COUNT> s_all_instructions_stats; static std::array<GekkoOPStats, TOTAL_INSTRUCTION_COUNT> s_all_instructions_stats;
constexpr Tables s_tables = []() consteval constexpr Tables s_tables = []() consteval {
{
Tables tables{}; Tables tables{};
u32 counter = 0; u32 counter = 0;
auto make_info = [&](const GekkoOPTemplate& inst) consteval->u32 auto make_info = [&](const GekkoOPTemplate& inst) consteval -> u32 {
{
ASSERT(counter < TOTAL_INSTRUCTION_COUNT); ASSERT(counter < TOTAL_INSTRUCTION_COUNT);
GekkoOPInfo* info = &tables.all_instructions[counter]; GekkoOPInfo* info = &tables.all_instructions[counter];
info->opname = inst.opname; info->opname = inst.opname;
@ -609,8 +607,7 @@ constexpr Tables s_tables = []() consteval
ASSERT(counter == TOTAL_INSTRUCTION_COUNT); ASSERT(counter == TOTAL_INSTRUCTION_COUNT);
return tables; return tables;
} }();
();
const GekkoOPInfo* GetOpInfo(UGeckoInstruction inst, u32 pc) const GekkoOPInfo* GetOpInfo(UGeckoInstruction inst, u32 pc)
{ {

View file

@ -209,8 +209,7 @@ int main(int argc, char* argv[])
parser->add_option("-p", "--platform") parser->add_option("-p", "--platform")
.action("store") .action("store")
.help("Window platform to use [%choices]") .help("Window platform to use [%choices]")
.choices({ .choices({"headless"
"headless"
#ifdef __linux__ #ifdef __linux__
, ,
"fbdev" "fbdev"

View file

@ -190,4 +190,4 @@ void ConfigComplexChoice::mousePressEvent(QMouseEvent* event)
{ {
QComboBox::mousePressEvent(event); QComboBox::mousePressEvent(event);
} }
}; }

View file

@ -90,7 +90,7 @@ protected:
return Config::Get(setting); return Config::Get(setting);
} }
virtual void OnConfigChanged(){}; virtual void OnConfigChanged() {}
private: private:
bool IsConfigLocal() const bool IsConfigLocal() const

View file

@ -51,9 +51,8 @@ GameTracker::GameTracker(QObject* parent) : QFileSystemWatcher(parent)
} }
}); });
connect(&Settings::Instance(), &Settings::MetadataRefreshRequested, this, [this] { connect(&Settings::Instance(), &Settings::MetadataRefreshRequested, this,
m_load_thread.EmplaceItem(Command{CommandType::UpdateMetadata, {}}); [this] { m_load_thread.EmplaceItem(Command{CommandType::UpdateMetadata, {}}); });
});
m_load_thread.Reset("GameList Tracker", [this](Command command) { m_load_thread.Reset("GameList Tracker", [this](Command command) {
switch (command.type) switch (command.type)

View file

@ -57,7 +57,7 @@ public:
explicit StateTracker(); explicit StateTracker();
~StateTracker(); ~StateTracker();
Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; }; Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; }
void SetCurrentFramebuffer(Framebuffer* framebuffer); void SetCurrentFramebuffer(Framebuffer* framebuffer);
void BeginClearRenderPass(MTLClearColor color, float depth); void BeginClearRenderPass(MTLClearColor color, float depth);
void BeginRenderPass(MTLLoadAction load_action); void BeginRenderPass(MTLLoadAction load_action);

View file

@ -906,7 +906,10 @@ static void EncodeRGB8(u8* dst, const u8* src, EFBCopyFormat format, bool yuv)
case EFBCopyFormat::A8: case EFBCopyFormat::A8:
SetBlockDimensions(3, 2, &sBlkCount, &tBlkCount, &sBlkSize, &tBlkSize); SetBlockDimensions(3, 2, &sBlkCount, &tBlkCount, &sBlkSize, &tBlkSize);
SetSpans(sBlkSize, tBlkSize, &tSpan, &sBlkSpan, &tBlkSpan, &writeStride); SetSpans(sBlkSize, tBlkSize, &tSpan, &sBlkSpan, &tBlkSpan, &writeStride);
ENCODE_LOOP_BLOCKS { *dst++ = 0xff; } ENCODE_LOOP_BLOCKS
{
*dst++ = 0xff;
}
ENCODE_LOOP_SPANS ENCODE_LOOP_SPANS
break; break;
@ -1135,7 +1138,10 @@ static void EncodeRGB8halfscale(u8* dst, const u8* src, EFBCopyFormat format, bo
case EFBCopyFormat::A8: case EFBCopyFormat::A8:
SetBlockDimensions(3, 2, &sBlkCount, &tBlkCount, &sBlkSize, &tBlkSize); SetBlockDimensions(3, 2, &sBlkCount, &tBlkCount, &sBlkSize, &tBlkSize);
SetSpans(sBlkSize, tBlkSize, &tSpan, &sBlkSpan, &tBlkSpan, &writeStride); SetSpans(sBlkSize, tBlkSize, &tSpan, &sBlkSpan, &tBlkSpan, &writeStride);
ENCODE_LOOP_BLOCKS { *dst++ = 0xff; } ENCODE_LOOP_BLOCKS
{
*dst++ = 0xff;
}
ENCODE_LOOP_SPANS ENCODE_LOOP_SPANS
break; break;

View file

@ -73,9 +73,9 @@ public:
protected: protected:
VertexLoaderBase(const TVtxDesc& vtx_desc, const VAT& vtx_attr) VertexLoaderBase(const TVtxDesc& vtx_desc, const VAT& vtx_attr)
: m_vertex_size{GetVertexSize(vtx_desc, vtx_attr)}, m_native_components{GetVertexComponents( : m_vertex_size{GetVertexSize(vtx_desc, vtx_attr)},
vtx_desc, vtx_attr)}, m_native_components{GetVertexComponents(vtx_desc, vtx_attr)}, m_VtxAttr{vtx_attr},
m_VtxAttr{vtx_attr}, m_VtxDesc{vtx_desc} m_VtxDesc{vtx_desc}
{ {
} }

View file

@ -34,8 +34,7 @@ private:
using SizeTable = EnumMap<EnumMap<u32, ColorFormat::RGBA8888>, VertexComponentFormat::Index16>; using SizeTable = EnumMap<EnumMap<u32, ColorFormat::RGBA8888>, VertexComponentFormat::Index16>;
static constexpr SizeTable s_table_size = []() consteval static constexpr SizeTable s_table_size = []() consteval {
{
SizeTable table{}; SizeTable table{};
using VCF = VertexComponentFormat; using VCF = VertexComponentFormat;
@ -45,6 +44,5 @@ private:
table[VCF::Index16] = {2u, 2u, 2u, 2u, 2u, 2u}; table[VCF::Index16] = {2u, 2u, 2u, 2u, 2u, 2u};
return table; return table;
} }();
();
}; };

View file

@ -31,8 +31,7 @@ private:
2>, 2>,
VertexComponentFormat::Index16>; VertexComponentFormat::Index16>;
static constexpr SizeTable s_table_size = []() consteval static constexpr SizeTable s_table_size = []() consteval {
{
SizeTable table{}; SizeTable table{};
using VCF = VertexComponentFormat; using VCF = VertexComponentFormat;
@ -145,6 +144,5 @@ private:
table[VCF::Index16][true][NCC::NTB][FMT::InvalidFloat7] = 6; table[VCF::Index16][true][NCC::NTB][FMT::InvalidFloat7] = 6;
return table; return table;
} }();
();
}; };

View file

@ -30,8 +30,7 @@ private:
EnumMap<EnumMap<EnumMap<u32, CoordComponentCount::XYZ>, ComponentFormat::InvalidFloat7>, EnumMap<EnumMap<EnumMap<u32, CoordComponentCount::XYZ>, ComponentFormat::InvalidFloat7>,
VertexComponentFormat::Index16>; VertexComponentFormat::Index16>;
static constexpr SizeTable s_table_size = []() consteval static constexpr SizeTable s_table_size = []() consteval {
{
SizeTable table{}; SizeTable table{};
using VCF = VertexComponentFormat; using VCF = VertexComponentFormat;
@ -65,6 +64,5 @@ private:
table[VCF::Index16][FMT::InvalidFloat7] = {2, 2}; table[VCF::Index16][FMT::InvalidFloat7] = {2, 2};
return table; return table;
} }();
();
}; };

View file

@ -33,8 +33,7 @@ private:
EnumMap<EnumMap<EnumMap<u32, TexComponentCount::ST>, ComponentFormat::InvalidFloat7>, EnumMap<EnumMap<EnumMap<u32, TexComponentCount::ST>, ComponentFormat::InvalidFloat7>,
VertexComponentFormat::Index16>; VertexComponentFormat::Index16>;
static constexpr SizeTable s_table_size = []() consteval static constexpr SizeTable s_table_size = []() consteval {
{
SizeTable table{}; SizeTable table{};
using VCF = VertexComponentFormat; using VCF = VertexComponentFormat;
@ -68,6 +67,5 @@ private:
table[VCF::Index16][FMT::InvalidFloat7] = {2, 2}; table[VCF::Index16][FMT::InvalidFloat7] = {2, 2};
return table; return table;
} }();
();
}; };

View file

@ -18,8 +18,8 @@ if ! [ -x "$(command -v $GIT)" ]; then
exit 1 exit 1
fi fi
REQUIRED_CLANG_FORMAT_MAJOR=13 REQUIRED_CLANG_FORMAT_MAJOR=19
REQUIRED_CLANG_FORMAT_MINOR=0 REQUIRED_CLANG_FORMAT_MINOR=1
CLANG_FORMAT=clang-format CLANG_FORMAT=clang-format
CLANG_FORMAT_MAJOR=clang-format-${REQUIRED_CLANG_FORMAT_MAJOR} CLANG_FORMAT_MAJOR=clang-format-${REQUIRED_CLANG_FORMAT_MAJOR}
CLANG_FORMAT_MAJOR_MINOR=${CLANG_FORMAT_MAJOR}.${REQUIRED_CLANG_FORMAT_MINOR} CLANG_FORMAT_MAJOR_MINOR=${CLANG_FORMAT_MAJOR}.${REQUIRED_CLANG_FORMAT_MINOR}