Compare commits

...

29 Commits

Author SHA1 Message Date
comex
437cd1dd0f tests: Fix warning about comparison between signed and unsigned 2020-11-23 19:08:55 -05:00
comex
207240414d CMakeLists: Use -Wno-sign-conversion instead of -Wno-error=sign-conversion
The preceding -Werror=conversion implicitly enables -Wsign-conversion,
but only on Clang, not GCC.  So on GCC, -Wno-error=sign-conversion would
do nothing (absent custom flags supplied on the command line) because
-Wsign-conversion wasn't enabled in the first place.  On Clang, it would
prevent the build from erroring out, but you're still left with a ton of
warnings.

Perhaps the codebase ought to be -Wsign-conversion clean, but it's
currently very far from it, and as long as more-typical GCC users aren't
seeing the warning, Clang users shouldn't either.
2020-11-23 19:08:55 -05:00
comex
0be8ce5c54 CMakeLists: disable -Winvalid-offsetof
This Clang warning complains when offsetof is used on a
non-standard-layout type (i.e. any class using various C++ features),
even though it works fine (and is not undefined behavior as of C++17).
2020-11-23 19:08:55 -05:00
comex
5f0a916af4 renderer_vulkan: initialize DeviceDispatch function pointers to nullptr
This avoids a Clang warning about uninitialized fields when VKDevice
instantiates a DeviceDispatch with an InstanceDispatch (the superclass).

The fields are in fact filled in later, but there's no harm in
initializing them to nullptr; aside from satisfying the compiler, it
would help diagnose the situation if they somehow fail to get filled in.
2020-11-23 19:08:55 -05:00
comex
5d7c0d5e70 bootmanager: In 'Unknown Qt platform' error, print the platform name 2020-11-23 19:08:55 -05:00
comex
d75d845c6c yuzu_cmd: Remove 'users_size'
Specifically:

    const auto size = sdl2_config->GetInteger("System", "users_size", 0);

The variable is never used, producing a warning.  I wondered if this
ought to be assigning something to in `Settings`, but nothing else in
the codebase ever mentions a settings called "users_size", so I guess
it's safe to remove...
2020-11-23 19:08:55 -05:00
comex
14dee96cb0 renderer_vulkan: Add missing override specifier 2020-11-23 19:08:55 -05:00
comex
a90a608261 input_common: Account for GCC diagnostics not present in Clang 2020-11-23 19:08:55 -05:00
comex
57b00fcb29 video_core: Adjust NUM macro to avoid Clang warning
The previous definition was:

    #define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))

In cases where `field_name` happens to refer to an array, Clang thinks
`sizeof(an array value) / sizeof(a type)` is an instance of the idiom
where `sizeof` is used to compute an array length.  So it thinks the
type in the denominator ought to be the array element type, and warns if
it isn't, assuming this is a mistake.

In reality, `NUM` is not used to get array lengths at all, so there is no
mistake.  Silence the warning by applying Clang's suggested workaround
of parenthesizing the denominator.
2020-11-23 19:08:55 -05:00
comex
b1ca59f95d CMakeLists: Always use zstd::zstd, not just on Windows
This seems to be required in order to actually use the flags for the
copy of zstd found by the top-level CMakeLists.  Without it, it seems to
blindly add -lzstd, which breaks the build for me since my copy of zstd
is not in the default library path.

Originally this used `zstd`, not `zstd::zstd`, on all platforms.  Commit
2cbce77 ("CMakeLists: use system zstd on Linux") made it
platform-dependent: despite its title, it changed the behavior on
Windows to use `zstd::zstd`, while leaving the behavior on Linux
unchanged.

I'm pretty sure `zstd::zstd` is the right choice on all platforms, but
by accident `zstd` also works on Linux because the library happens to
(usually) be installed in /usr/lib.
2020-11-23 19:08:55 -05:00
comex
5a84eb5836 codec: Fix pragma GCC diagnostic pop missing corresponding push 2020-11-23 19:08:55 -05:00
comex
cc1cf02779 nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclass 2020-11-23 19:08:55 -05:00
comex
7c21395a95 nfp: fix warning about variable used within its own initialization
In the initializer for a struct-typed variable, one field's initializer
accesses a field that was previously initialized.  I've been having a
fun Twitter discussion with C++ experts about whether this is undefined
behavior; regardless, Clang warns about it, so just avoid the pattern.
2020-11-23 19:08:55 -05:00
comex
6a88ae713a Deal with various unused fields
In cases where the field is initialized by a constructor argument, mark
them `[[maybe_unused]]` in case they're needed in the future.  In cases
where the field is completely unmentioned, just remove the field.
2020-11-23 19:08:55 -05:00
comex
9671bfb8e1 renderer_vulkan: Cast function return to void to avoid 'unused' warning
This matches the similar call under #else.

Ignoring failure is actually the right behavior here, because the caller
goes on to call DynamicLibrary::IsOpen.
2020-11-23 19:08:55 -05:00
comex
ddea13570f map_interval: Change field order to uninitialized field warning
Clang complains about `new_chunk`'s constructor using the
then-uninitialized `first_chunk`.
2020-11-23 19:08:55 -05:00
comex
9c850124b7 configure_input_player: Mark unused function
I could remove it, but it seems potentially useful in the future...
2020-11-23 19:08:55 -05:00
comex
9de9ad3023 core: Mark unused fields as [[maybe_unused]] 2020-11-23 19:08:55 -05:00
comex
ae534e0585 Remove useless lambda captures 2020-11-23 19:08:55 -05:00
comex
20f1de42bc common: Change UNIMPLEMENTED{,_MSG} to not depend on if (!false)
Clang 11 warns about an unreachable `[[fallthrough]]` in
src/core/hle/service/am/applets/controller.cpp after an
`UNIMPLEMENTED_MSG` call, because it realizes that the `if (!false)` in
the expansion of UNIMPLEMENTED_MSG is always taken.  But since that
`[[fallthrough]]` is useless, I'm guessing it was added because some other
compiler (or maybe an older version of Clang) warns if it *wasn't*
present, presumably because it doesn't realize the `if` is always taken.

To appease both, change `UNIMPLEMENTED` and `UNIMPLEMENTED_MSG` to expand
directly to a call to `assert_noinline_call` without an `if` statement.
This mirrors the behavior of `UNREACHABLE` and `UNREACHABLE_MSG`.

Also, remove the aforementioned `[[fallthrough]]`.
2020-11-23 19:08:55 -05:00
comex
0f52cc13f7 boxcat: Avoid unnecessary object copy 2020-11-23 19:08:55 -05:00
comex
4bc31ea849 vfs_real: When moving files or directories, don't assume file opening will succeed
Found this via a warning, but it's a substantive fix.

Since this is only for a cache, it should be safe to silently drop the
file if opening fails.  I think.
2020-11-23 19:08:55 -05:00
comex
27a0000e2f Restructure switch statements to avoid 'enumeration values not handled in switch' 2020-11-23 19:08:55 -05:00
comex
40cfdc424e dynarmic: Remove useless switch statement
This was complaining about not having cases for all the enum variants.
2020-11-23 19:08:55 -05:00
comex
c6a9039e94 Fix "explicitly defaulted but implicitly deleted" warnings
In two cases, move constructors or assignment operators defined as
`= default` were being implicitly deleted because one of the class's
fields did not have suitable constructors/assignment operators.

Switch to explicitly deleting them; this does not affect behavior.

Note that in the case of PhysicalCore, only the move assignment operator
is implicitly deleted (because there's a field of reference type);
the move *constructor* is valid, and is required to be valid in order to
have a std::vector<PhysicalCore>.
2020-11-23 19:08:55 -05:00
comex
12d78ed65b hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp
- Add a type check so that calling Push with an invalid type produces a
  compile error rather than a linker error.

- vi.cpp was calling Push with a variable of type `std::size_t`.
  There's no explicit overload for `size_t`, but there is one for `u64`,
  which on most platforms is the same type as `size_t`.  On macOS,
  however, it isn't: both types are 64 bits, but `size_t` is `unsigned
  long` and `u64` is `unsigned long long`.  Regardless, it makes more
  sense to explicitly use `u64` here instaed of `size_t`.
2020-11-23 19:08:52 -05:00
comex
e8174032d9 maxwell_dma: Rename RenderEnable::Mode::FALSE and TRUE to avoid name conflict
On Apple platforms, FALSE and TRUE are defined as macros by
<mach/boolean.h>, which is included by various system headers.

Note that there appear to be no actual users of the names to fix up.
2020-11-23 18:11:39 -05:00
comex
b634f554fc network, sockets: Replace POLL_IN, POLL_OUT, etc. constants with an enum class PollEvents
Actually, two enum classes, since for some reason there are two separate
yet identical `PollFD` types used in the codebase.  I get one is
ABI-compatible with the Switch while the other is an abstract type used
for the host, but why not use `WSAPOLLFD` directly for the latter?

Anyway, why make this change?  Because on Apple platforms, `POLL_IN`,
`POLL_OUT`, etc. (with the underscore) are defined as macros in
<sys/signal.h>.  (This is inherited from FreeBSD.)  So defining
a variable with the same name causes a compile error.

I could just rename the variables, but while I was at it I thought I may
as well switch to an enum for stronger typing.

Also, change the type used for values copied directly to/from the
`events` and `revents` fields of the host *native*
`pollfd`/`WSASPOLLFD`, from `u32` to `short`, as `short` is the correct
canonical type on both Unix and Windows.
2020-11-23 18:11:35 -05:00
comex
0ab76cacb5 CMakeLists,network: Create YUZU_UNIX macro to replace __unix__
__unix__ is not predefined on Apple platforms even though they are Unix.
2020-11-23 17:57:14 -05:00
58 changed files with 301 additions and 326 deletions

View File

@@ -113,6 +113,9 @@ if (NOT DEFINED ARCHITECTURE)
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
if (UNIX)
add_definitions(-DYUZU_UNIX=1)
endif()
# Configure C++ standard
# ===========================

View File

@@ -67,6 +67,7 @@ else()
-Wmissing-declarations
-Wno-attributes
-Wno-unused-parameter
-Wno-invalid-offsetof
)
# TODO: Remove when we update to a GCC compiler that enables this

View File

@@ -136,7 +136,7 @@ public:
const std::array<float, AudioCommon::MAX_MIX_BUFFERS>& GetLastMixVolume() const;
private:
s32 id{};
[[maybe_unused]] s32 id{};
std::array<float, AudioCommon::MAX_MIX_BUFFERS> mix_volume{};
std::array<float, AudioCommon::MAX_MIX_BUFFERS> last_mix_volume{};
bool in_use{};

View File

@@ -211,9 +211,4 @@ create_target_directory_groups(common)
find_package(Boost 1.71 COMPONENTS context headers REQUIRED)
target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile)
target_link_libraries(common PRIVATE lz4::lz4 xbyak)
if (MSVC)
target_link_libraries(common PRIVATE zstd::zstd)
else()
target_link_libraries(common PRIVATE zstd)
endif()
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd xbyak)

View File

@@ -54,8 +54,9 @@ assert_noinline_call(const Fn& fn) {
#define DEBUG_ASSERT_MSG(_a_, _desc_, ...)
#endif
#define UNIMPLEMENTED() ASSERT_MSG(false, "Unimplemented code!")
#define UNIMPLEMENTED_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
#define UNIMPLEMENTED() assert_noinline_call([] { LOG_CRITICAL(Debug, "Unimplemented code!"); })
#define UNIMPLEMENTED_MSG(...) \
assert_noinline_call([&] { LOG_CRITICAL(Debug, "Unimplemented code!\n" __VA_ARGS__); })
#define UNIMPLEMENTED_IF(cond) ASSERT_MSG(!(cond), "Unimplemented code!")
#define UNIMPLEMENTED_IF_MSG(cond, ...) ASSERT_MSG(!(cond), __VA_ARGS__)

View File

@@ -38,8 +38,8 @@ public:
Fiber(const Fiber&) = delete;
Fiber& operator=(const Fiber&) = delete;
Fiber(Fiber&&) = default;
Fiber& operator=(Fiber&&) = default;
Fiber(Fiber&&) = delete;
Fiber& operator=(Fiber&&) = delete;
/// Yields control from Fiber 'from' to Fiber 'to'
/// Fiber 'from' must be the currently running fiber.

View File

@@ -71,13 +71,6 @@ public:
}
void ExceptionRaised(u32 pc, Dynarmic::A32::Exception exception) override {
switch (exception) {
case Dynarmic::A32::Exception::UndefinedInstruction:
case Dynarmic::A32::Exception::UnpredictableInstruction:
break;
case Dynarmic::A32::Exception::Breakpoint:
break;
}
LOG_CRITICAL(Core_ARM, "ExceptionRaised(exception = {}, pc = {:08X}, code = {:08X})",
static_cast<std::size_t>(exception), pc, MemoryReadCode(pc));
UNIMPLEMENTED();

View File

@@ -133,8 +133,9 @@ VirtualFile RealVfsFilesystem::MoveFile(std::string_view old_path_, std::string_
}
cache.erase(old_path);
file->Open(new_path, "r+b");
cache.insert_or_assign(new_path, std::move(file));
if (file->Open(new_path, "r+b")) {
cache.insert_or_assign(new_path, std::move(file));
}
} else {
UNREACHABLE();
return nullptr;
@@ -214,9 +215,10 @@ VirtualDir RealVfsFilesystem::MoveDirectory(std::string_view old_path_,
}
auto file = cached.lock();
file->Open(file_new_path, "r+b");
cache.erase(file_old_path);
cache.insert_or_assign(std::move(file_new_path), std::move(file));
if (file->Open(file_new_path, "r+b")) {
cache.insert_or_assign(std::move(file_new_path), std::move(file));
}
}
return OpenDirectory(new_path, Mode::ReadWrite);

View File

@@ -166,8 +166,23 @@ public:
ValidateHeader();
}
void PushImpl(s8 value);
void PushImpl(s16 value);
void PushImpl(s32 value);
void PushImpl(s64 value);
void PushImpl(u8 value);
void PushImpl(u16 value);
void PushImpl(u32 value);
void PushImpl(u64 value);
void PushImpl(float value);
void PushImpl(double value);
void PushImpl(bool value);
void PushImpl(ResultCode value);
template <typename T>
void Push(T value);
void Push(T value) {
return PushImpl(value);
}
template <typename First, typename... Other>
void Push(const First& first_value, const Other&... other_values);
@@ -215,13 +230,11 @@ private:
/// Push ///
template <>
inline void ResponseBuilder::Push(s32 value) {
inline void ResponseBuilder::PushImpl(s32 value) {
cmdbuf[index++] = static_cast<u32>(value);
}
template <>
inline void ResponseBuilder::Push(u32 value) {
inline void ResponseBuilder::PushImpl(u32 value) {
cmdbuf[index++] = value;
}
@@ -233,62 +246,52 @@ void ResponseBuilder::PushRaw(const T& value) {
index += (sizeof(T) + 3) / 4; // round up to word length
}
template <>
inline void ResponseBuilder::Push(ResultCode value) {
inline void ResponseBuilder::PushImpl(ResultCode value) {
// Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded.
Push(value.raw);
Push<u32>(0);
}
template <>
inline void ResponseBuilder::Push(s8 value) {
inline void ResponseBuilder::PushImpl(s8 value) {
PushRaw(value);
}
template <>
inline void ResponseBuilder::Push(s16 value) {
inline void ResponseBuilder::PushImpl(s16 value) {
PushRaw(value);
}
template <>
inline void ResponseBuilder::Push(s64 value) {
Push(static_cast<u32>(value));
Push(static_cast<u32>(value >> 32));
inline void ResponseBuilder::PushImpl(s64 value) {
PushImpl(static_cast<u32>(value));
PushImpl(static_cast<u32>(value >> 32));
}
template <>
inline void ResponseBuilder::Push(u8 value) {
inline void ResponseBuilder::PushImpl(u8 value) {
PushRaw(value);
}
template <>
inline void ResponseBuilder::Push(u16 value) {
inline void ResponseBuilder::PushImpl(u16 value) {
PushRaw(value);
}
template <>
inline void ResponseBuilder::Push(u64 value) {
Push(static_cast<u32>(value));
Push(static_cast<u32>(value >> 32));
inline void ResponseBuilder::PushImpl(u64 value) {
PushImpl(static_cast<u32>(value));
PushImpl(static_cast<u32>(value >> 32));
}
template <>
inline void ResponseBuilder::Push(float value) {
inline void ResponseBuilder::PushImpl(float value) {
u32 integral;
std::memcpy(&integral, &value, sizeof(u32));
Push(integral);
PushImpl(integral);
}
template <>
inline void ResponseBuilder::Push(double value) {
inline void ResponseBuilder::PushImpl(double value) {
u64 integral;
std::memcpy(&integral, &value, sizeof(u64));
Push(integral);
PushImpl(integral);
}
template <>
inline void ResponseBuilder::Push(bool value) {
Push(static_cast<u8>(value));
inline void ResponseBuilder::PushImpl(bool value) {
PushImpl(static_cast<u8>(value));
}
template <typename First, typename... Other>

View File

@@ -57,8 +57,8 @@ public:
private:
void MergeAdjacent(iterator it, iterator& next_it);
const VAddr start_addr;
const VAddr end_addr;
[[maybe_unused]] const VAddr start_addr;
[[maybe_unused]] const VAddr end_addr;
MemoryBlockTree memory_block_tree;
};

View File

@@ -34,7 +34,7 @@ public:
PhysicalCore& operator=(const PhysicalCore&) = delete;
PhysicalCore(PhysicalCore&&) = default;
PhysicalCore& operator=(PhysicalCore&&) = default;
PhysicalCore& operator=(PhysicalCore&&) = delete;
void Idle();
/// Interrupt this physical core.

View File

@@ -41,11 +41,10 @@ std::pair<ResultCode, Handle> Synchronization::WaitFor(
Handle event_handle = InvalidHandle;
{
SchedulerLockAndSleep lock(kernel, event_handle, thread, nano_seconds);
const auto itr =
std::find_if(sync_objects.begin(), sync_objects.end(),
[thread](const std::shared_ptr<SynchronizationObject>& object) {
return object->IsSignaled();
});
const auto itr = std::find_if(sync_objects.begin(), sync_objects.end(),
[](const std::shared_ptr<SynchronizationObject>& object) {
return object->IsSignaled();
});
if (itr != sync_objects.end()) {
// We found a ready object, acquire it and set the result value

View File

@@ -310,7 +310,7 @@ private:
void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx);
Kernel::EventPair pop_from_general_channel_event;
Kernel::KernelCore& kernel;
[[maybe_unused]] Kernel::KernelCore& kernel;
};
class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {

View File

@@ -211,7 +211,6 @@ void Controller::Execute() {
case ControllerSupportMode::ShowControllerFirmwareUpdate:
UNIMPLEMENTED_MSG("ControllerSupportMode={} is not implemented",
controller_private_arg.mode);
[[fallthrough]];
default: {
ConfigurationComplete();
break;

View File

@@ -483,7 +483,7 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
global = json["global"].get<std::string>();
if (json["games"].is_array()) {
for (const auto object : json["games"]) {
for (const auto& object : json["games"]) {
if (object.is_object() && object.find("name") != object.end()) {
EventStatus detail{};
if (object["header"].is_string()) {

View File

@@ -45,7 +45,7 @@ public:
}
private:
FileSys::StorageId storage;
[[maybe_unused]] FileSys::StorageId storage;
};
class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> {

View File

@@ -217,7 +217,7 @@ private:
const auto& amiibo = nfp_interface.GetAmiiboBuffer();
const TagInfo tag_info{
.uuid = amiibo.uuid,
.uuid_length = static_cast<u8>(tag_info.uuid.size()),
.uuid_length = static_cast<u8>(amiibo.uuid.size()),
.padding_1 = {},
.protocol = 1, // TODO(ogniK): Figure out actual values
.tag_type = 2,

View File

@@ -18,38 +18,6 @@ public:
explicit nvhost_nvdec_common(Core::System& system, std::shared_ptr<nvmap> nvmap_dev);
~nvhost_nvdec_common() override;
/**
* Handles an ioctl1 request.
* @param command The ioctl command id.
* @param input A buffer containing the input data for the ioctl.
* @param output A buffer where the output data will be written to.
* @returns The result code of the ioctl.
*/
virtual NvResult Ioctl1(Ioctl command, const std::vector<u8>& input,
std::vector<u8>& output) = 0;
/**
* Handles an ioctl2 request.
* @param command The ioctl command id.
* @param input A buffer containing the input data for the ioctl.
* @param inline_input A buffer containing the input data for the ioctl which has been inlined.
* @param output A buffer where the output data will be written to.
* @returns The result code of the ioctl.
*/
virtual NvResult Ioctl2(Ioctl command, const std::vector<u8>& input,
const std::vector<u8>& inline_input, std::vector<u8>& output) = 0;
/**
* Handles an ioctl3 request.
* @param command The ioctl command id.
* @param input A buffer containing the input data for the ioctl.
* @param output A buffer where the output data will be written to.
* @param inline_output A buffer where the inlined output data will be written to.
* @returns The result code of the ioctl.
*/
virtual NvResult Ioctl3(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output,
std::vector<u8>& inline_output) = 0;
protected:
class BufferMap final {
public:

View File

@@ -158,9 +158,10 @@ u32 BufferQueue::Query(QueryType type) {
switch (type) {
case QueryType::NativeWindowFormat:
return static_cast<u32>(PixelFormat::RGBA8888);
default:
UNIMPLEMENTED();
}
UNIMPLEMENTED();
return 0;
}

View File

@@ -489,18 +489,18 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u
}
for (PollFD& pollfd : fds) {
ASSERT(pollfd.revents == 0);
ASSERT(False(pollfd.revents));
if (pollfd.fd > static_cast<s32>(MAX_FD) || pollfd.fd < 0) {
LOG_ERROR(Service, "File descriptor handle={} is invalid", pollfd.fd);
pollfd.revents = 0;
pollfd.revents = PollEvents{};
return {0, Errno::SUCCESS};
}
const std::optional<FileDescriptor>& descriptor = file_descriptors[pollfd.fd];
if (!descriptor) {
LOG_ERROR(Service, "File descriptor handle={} is not allocated", pollfd.fd);
pollfd.revents = POLL_NVAL;
pollfd.revents = PollEvents::NVAL;
return {0, Errno::SUCCESS};
}
}
@@ -510,7 +510,7 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u
Network::PollFD result;
result.socket = file_descriptors[pollfd.fd]->socket.get();
result.events = TranslatePollEventsToHost(pollfd.events);
result.revents = 0;
result.revents = Network::PollEvents{};
return result;
});

View File

@@ -69,10 +69,21 @@ struct SockAddrIn {
std::array<u8, 8> zeroes;
};
enum class PollEvents : u16 {
IN = 1 << 0,
PRI = 1 << 1,
OUT = 1 << 2,
ERR = 1 << 3,
HUP = 1 << 4,
NVAL = 1 << 5,
};
DECLARE_ENUM_FLAG_OPERATORS(PollEvents);
struct PollFD {
s32 fd;
u16 events;
u16 revents;
PollEvents events;
PollEvents revents;
};
struct Linger {
@@ -80,13 +91,6 @@ struct Linger {
u32 linger;
};
constexpr u16 POLL_IN = 0x01;
constexpr u16 POLL_PRI = 0x02;
constexpr u16 POLL_OUT = 0x04;
constexpr u16 POLL_ERR = 0x08;
constexpr u16 POLL_HUP = 0x10;
constexpr u16 POLL_NVAL = 0x20;
constexpr u32 FLAG_MSG_DONTWAIT = 0x80;
constexpr u32 FLAG_O_NONBLOCK = 0x800;

View File

@@ -89,43 +89,43 @@ Network::Protocol Translate(Type type, Protocol protocol) {
}
}
u16 TranslatePollEventsToHost(u32 flags) {
u32 result = 0;
const auto translate = [&result, &flags](u32 from, u32 to) {
if ((flags & from) != 0) {
Network::PollEvents TranslatePollEventsToHost(PollEvents flags) {
Network::PollEvents result{};
const auto translate = [&result, &flags](PollEvents from, Network::PollEvents to) {
if (True(flags & from)) {
flags &= ~from;
result |= to;
}
};
translate(POLL_IN, Network::POLL_IN);
translate(POLL_PRI, Network::POLL_PRI);
translate(POLL_OUT, Network::POLL_OUT);
translate(POLL_ERR, Network::POLL_ERR);
translate(POLL_HUP, Network::POLL_HUP);
translate(POLL_NVAL, Network::POLL_NVAL);
translate(PollEvents::IN, Network::PollEvents::IN);
translate(PollEvents::PRI, Network::PollEvents::PRI);
translate(PollEvents::OUT, Network::PollEvents::OUT);
translate(PollEvents::ERR, Network::PollEvents::ERR);
translate(PollEvents::HUP, Network::PollEvents::HUP);
translate(PollEvents::NVAL, Network::PollEvents::NVAL);
UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
return static_cast<u16>(result);
UNIMPLEMENTED_IF_MSG((u16)flags != 0, "Unimplemented flags={}", (u16)flags);
return result;
}
u16 TranslatePollEventsToGuest(u32 flags) {
u32 result = 0;
const auto translate = [&result, &flags](u32 from, u32 to) {
if ((flags & from) != 0) {
PollEvents TranslatePollEventsToGuest(Network::PollEvents flags) {
PollEvents result{};
const auto translate = [&result, &flags](Network::PollEvents from, PollEvents to) {
if (True(flags & from)) {
flags &= ~from;
result |= to;
}
};
translate(Network::POLL_IN, POLL_IN);
translate(Network::POLL_PRI, POLL_PRI);
translate(Network::POLL_OUT, POLL_OUT);
translate(Network::POLL_ERR, POLL_ERR);
translate(Network::POLL_HUP, POLL_HUP);
translate(Network::POLL_NVAL, POLL_NVAL);
translate(Network::PollEvents::IN, PollEvents::IN);
translate(Network::PollEvents::PRI, PollEvents::PRI);
translate(Network::PollEvents::OUT, PollEvents::OUT);
translate(Network::PollEvents::ERR, PollEvents::ERR);
translate(Network::PollEvents::HUP, PollEvents::HUP);
translate(Network::PollEvents::NVAL, PollEvents::NVAL);
UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
return static_cast<u16>(result);
UNIMPLEMENTED_IF_MSG((u16)flags != 0, "Unimplemented flags={}", (u16)flags);
return result;
}
Network::SockAddrIn Translate(SockAddrIn value) {

View File

@@ -31,10 +31,10 @@ Network::Type Translate(Type type);
Network::Protocol Translate(Type type, Protocol protocol);
/// Translate abstract poll event flags to guest poll event flags
u16 TranslatePollEventsToHost(u32 flags);
Network::PollEvents TranslatePollEventsToHost(PollEvents flags);
/// Translate guest poll event flags to abstract poll event flags
u16 TranslatePollEventsToGuest(u32 flags);
PollEvents TranslatePollEventsToGuest(Network::PollEvents flags);
/// Translate guest socket address structure to abstract socket address structure
Network::SockAddrIn Translate(SockAddrIn value);

View File

@@ -64,7 +64,7 @@ public:
private:
std::shared_ptr<Kernel::SharedMemory> shared_memory_holder;
Core::System& system;
[[maybe_unused]] Core::System& system;
Format shared_memory_format{};
};

View File

@@ -1229,8 +1229,8 @@ private:
const auto height = rp.Pop<u64>();
LOG_DEBUG(Service_VI, "called width={}, height={}", width, height);
constexpr std::size_t base_size = 0x20000;
constexpr std::size_t alignment = 0x1000;
constexpr u64 base_size = 0x20000;
constexpr u64 alignment = 0x1000;
const auto texture_size = width * height * 4;
const auto out_size = (texture_size + base_size - 1) / base_size * base_size;

View File

@@ -11,7 +11,7 @@
#ifdef _WIN32
#define _WINSOCK_DEPRECATED_NO_WARNINGS // gethostname
#include <winsock2.h>
#elif __unix__
#elif YUZU_UNIX
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
@@ -54,7 +54,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) {
sockaddr TranslateFromSockAddrIn(SockAddrIn input) {
sockaddr_in result;
#ifdef __unix__
#if YUZU_UNIX
result.sin_len = sizeof(result);
#endif
@@ -99,7 +99,7 @@ bool EnableNonBlock(SOCKET fd, bool enable) {
return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR;
}
#elif __unix__ // ^ _WIN32 v __unix__
#elif YUZU_UNIX // ^ _WIN32 v YUZU_UNIX
using SOCKET = int;
using WSAPOLLFD = pollfd;
@@ -238,49 +238,49 @@ SockAddrIn TranslateToSockAddrIn(sockaddr input_) {
return result;
}
u16 TranslatePollEvents(u32 events) {
u32 result = 0;
short TranslatePollEvents(PollEvents events) {
short result = 0;
if ((events & POLL_IN) != 0) {
events &= ~POLL_IN;
if (True(events & PollEvents::IN)) {
events &= ~PollEvents::IN;
result |= POLLIN;
}
if ((events & POLL_PRI) != 0) {
events &= ~POLL_PRI;
if (True(events & PollEvents::PRI)) {
events &= ~PollEvents::PRI;
#ifdef _WIN32
LOG_WARNING(Service, "Winsock doesn't support POLLPRI");
#else
result |= POLL_PRI;
#endif
}
if ((events & POLL_OUT) != 0) {
events &= ~POLL_OUT;
if (True(events & PollEvents::OUT)) {
events &= ~PollEvents::OUT;
result |= POLLOUT;
}
UNIMPLEMENTED_IF_MSG(events != 0, "Unhandled guest events=0x{:x}", events);
UNIMPLEMENTED_IF_MSG((u16)events != 0, "Unhandled guest events=0x{:x}", (u16)events);
return static_cast<u16>(result);
return result;
}
u16 TranslatePollRevents(u32 revents) {
u32 result = 0;
const auto translate = [&result, &revents](u32 host, u32 guest) {
PollEvents TranslatePollRevents(short revents) {
PollEvents result{};
const auto translate = [&result, &revents](u32 host, PollEvents guest) {
if ((revents & host) != 0) {
revents &= ~host;
result |= guest;
}
};
translate(POLLIN, POLL_IN);
translate(POLLPRI, POLL_PRI);
translate(POLLOUT, POLL_OUT);
translate(POLLERR, POLL_ERR);
translate(POLLHUP, POLL_HUP);
translate(POLLIN, PollEvents::IN);
translate(POLLPRI, PollEvents::PRI);
translate(POLLOUT, PollEvents::OUT);
translate(POLLERR, PollEvents::ERR);
translate(POLLHUP, PollEvents::HUP);
UNIMPLEMENTED_IF_MSG(revents != 0, "Unhandled host revents=0x{:x}", revents);
return static_cast<u16>(result);
return result;
}
template <typename T>
@@ -350,7 +350,7 @@ std::pair<s32, Errno> Poll(std::vector<PollFD>& pollfds, s32 timeout) {
}
for (size_t i = 0; i < num; ++i) {
pollfds[i].revents = TranslatePollRevents(static_cast<u32>(host_pollfds[i].revents));
pollfds[i].revents = TranslatePollRevents(host_pollfds[i].revents);
}
if (result > 0) {

View File

@@ -61,18 +61,23 @@ struct SockAddrIn {
};
/// Cross-platform poll fd structure
struct PollFD {
Socket* socket;
u16 events;
u16 revents;
enum class PollEvents : u16 {
IN = 1 << 0,
PRI = 1 << 1,
OUT = 1 << 2,
ERR = 1 << 3,
HUP = 1 << 4,
NVAL = 1 << 5,
};
constexpr u16 POLL_IN = 1 << 0;
constexpr u16 POLL_PRI = 1 << 1;
constexpr u16 POLL_OUT = 1 << 2;
constexpr u16 POLL_ERR = 1 << 3;
constexpr u16 POLL_HUP = 1 << 4;
constexpr u16 POLL_NVAL = 1 << 5;
DECLARE_ENUM_FLAG_OPERATORS(PollEvents);
struct PollFD {
Socket* socket;
PollEvents events;
PollEvents revents;
};
class NetworkInstance {
public:

View File

@@ -9,7 +9,7 @@
#if defined(_WIN32)
#include <winsock.h>
#elif !defined(__unix__)
#elif !YUZU_UNIX
#error "Platform not implemented"
#endif
@@ -84,7 +84,7 @@ public:
#if defined(_WIN32)
SOCKET fd = INVALID_SOCKET;
#elif defined(__unix__)
#elif YUZU_UNIX
int fd = -1;
#endif
};

View File

@@ -52,9 +52,9 @@ else()
-Werror=reorder
-Werror=shadow
-Werror=sign-compare
-Werror=unused-but-set-parameter
-Werror=unused-but-set-variable
-Werror=unused-variable
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
)
endif()

View File

@@ -871,8 +871,9 @@ Common::ParamPackage BuildParamPackageForBinding(int port, const std::string& gu
case SDL_CONTROLLER_BINDTYPE_HAT:
return BuildHatParamPackageForButton(port, guid, binding.value.hat.hat,
binding.value.hat.hat_mask);
default:
return {};
}
return {};
}
Common::ParamPackage BuildParamPackageForAnalog(int port, const std::string& guid, int axis_x,

View File

@@ -22,7 +22,7 @@ public:
private:
const std::string ip;
const int port;
[[maybe_unused]] const int port;
const u32 pad;
CemuhookUDP::Client* client;
mutable std::mutex mutex;
@@ -86,7 +86,7 @@ public:
private:
const std::string ip;
const int port;
[[maybe_unused]] const int port;
const u32 pad;
CemuhookUDP::Client* client;
mutable std::mutex mutex;

View File

@@ -68,7 +68,7 @@ TEST_CASE("BitField", "[common]") {
}});
// bit fields: 01101100111101'10101110'1011'101100
REQUIRE(be_bitfield.raw == 0b01101100'11110110'10111010'11101100);
REQUIRE(be_bitfield.raw == 0b01101100'11110110'10111010'11101100u);
REQUIRE(be_bitfield.a == 0b101100);
REQUIRE(be_bitfield.b == -5); // 1011 as two's complement
REQUIRE(be_bitfield.c == TestEnum::B);
@@ -80,7 +80,7 @@ TEST_CASE("BitField", "[common]") {
be_bitfield.d.Assign(0b01010101010101);
std::memcpy(&raw, &be_bitfield, sizeof(raw));
// bit fields: 01010101010101'00001111'1111'000111
REQUIRE(be_bitfield.raw == 0b01010101'01010100'00111111'11000111);
REQUIRE(be_bitfield.raw == 0b01010101'01010100'00111111'11000111u);
REQUIRE(raw == std::array<u8, 4>{{
0b01010101,
0b01010100,

View File

@@ -301,7 +301,7 @@ if (MSVC)
else()
target_compile_options(video_core PRIVATE
-Werror=conversion
-Wno-error=sign-conversion
-Wno-sign-conversion
-Werror=pessimizing-move
-Werror=redundant-move
-Werror=switch

View File

@@ -84,9 +84,10 @@ private:
void FillFreeList(Chunk& chunk);
std::vector<MapInterval*> free_list;
std::unique_ptr<Chunk>* new_chunk = &first_chunk.next;
Chunk first_chunk;
std::unique_ptr<Chunk>* new_chunk = &first_chunk.next;
};
} // namespace VideoCommon

View File

@@ -115,7 +115,7 @@ private:
/// Write arguments value to the ThiRegisters member at the specified offset
void ThiStateWrite(ThiRegisters& state, u32 offset, const std::vector<u32>& arguments);
GPU& gpu;
[[maybe_unused]] GPU& gpu;
std::shared_ptr<Tegra::Nvdec> nvdec_processor;
std::unique_ptr<Tegra::Vic> vic_processor;

View File

@@ -10,6 +10,7 @@
extern "C" {
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
#include <libavcodec/avcodec.h>

View File

@@ -72,7 +72,7 @@ private:
u32 syncpoint_value{};
Host1xClassRegisters state{};
GPU& gpu;
[[maybe_unused]] GPU& gpu;
};
} // namespace Tegra

View File

@@ -9,7 +9,7 @@
#include "video_core/dirty_flags.h"
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / sizeof(u32))
#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / (sizeof(u32)))
namespace VideoCommon::Dirty {

View File

@@ -1500,8 +1500,6 @@ private:
bool execute_on{true};
std::array<u8, Regs::NUM_REGS> dirty_pointers{};
/// Retrieves information about a specific TIC entry from the TIC buffer.
Texture::TICEntry GetTICEntry(u32 tic_index) const;

View File

@@ -72,8 +72,8 @@ public:
struct RenderEnable {
enum class Mode : u32 {
FALSE = 0,
TRUE = 1,
_FALSE = 0,
_TRUE = 1,
CONDITIONAL = 2,
RENDER_IF_EQUAL = 3,
RENDER_IF_NOT_EQUAL = 4,

View File

@@ -266,8 +266,6 @@ private:
static constexpr std::size_t STREAM_BUFFER_SIZE = 128 * 1024 * 1024;
GLint vertex_binding = 0;
std::array<OGLBuffer, Tegra::Engines::Maxwell3D::Regs::NumTransformFeedbackBuffers>
transform_feedback_buffers;
std::bitset<Tegra::Engines::Maxwell3D::Regs::NumTransformFeedbackBuffers>

View File

@@ -13,7 +13,7 @@
#include "video_core/renderer_opengl/gl_state_tracker.h"
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
namespace OpenGL {

View File

@@ -79,7 +79,7 @@ Common::DynamicLibrary OpenVulkanLibrary() {
// Use the libvulkan.dylib from the application bundle.
const std::string filename =
Common::FS::GetBundleDirectory() + "/Contents/Frameworks/libvulkan.dylib";
library.Open(filename.c_str());
(void)library.Open(filename.c_str());
}
#else
std::string filename = Common::DynamicLibrary::GetVersionedFilename("vulkan", 1);

View File

@@ -49,7 +49,7 @@ private:
vk::Pipeline CreatePipeline() const;
const VKDevice& device;
VKScheduler& scheduler;
[[maybe_unused]] VKScheduler& scheduler;
ShaderEntries entries;
vk::DescriptorSetLayout descriptor_set_layout;

View File

@@ -93,7 +93,7 @@ private:
const SPIRVProgram& program) const;
const VKDevice& device;
VKScheduler& scheduler;
[[maybe_unused]] VKScheduler& scheduler;
const GraphicsPipelineCacheKey cache_key;
const u64 hash;

View File

@@ -84,10 +84,10 @@ private:
/// Unmaps memory.
void Unmap() const;
const VKDevice& device; ///< Vulkan device.
const vk::DeviceMemory& memory; ///< Vulkan device memory handler.
std::pair<u64, u64> interval{}; ///< Interval where the commit exists.
VKMemoryAllocation* allocation{}; ///< Pointer to the large memory allocation.
[[maybe_unused]] const VKDevice& device; ///< Vulkan device.
const vk::DeviceMemory& memory; ///< Vulkan device memory handler.
std::pair<u64, u64> interval{}; ///< Interval where the commit exists.
VKMemoryAllocation* allocation{}; ///< Pointer to the large memory allocation.
};
/// Holds ownership of a memory map.

View File

@@ -14,7 +14,7 @@
#include "video_core/renderer_vulkan/vk_state_tracker.h"
#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))
#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
namespace Vulkan {

View File

@@ -82,7 +82,7 @@ public:
}
protected:
void DecorateSurfaceName();
void DecorateSurfaceName() override;
View CreateView(const ViewParams& params) override;
@@ -96,7 +96,7 @@ private:
VkImageSubresourceRange GetImageSubresourceRange() const;
const VKDevice& device;
VKMemoryManager& memory_manager;
[[maybe_unused]] VKMemoryManager& memory_manager;
VKScheduler& scheduler;
VKStagingBufferPool& staging_pool;

View File

@@ -167,116 +167,116 @@ struct InstanceDispatch {
/// Table holding Vulkan device function pointers.
struct DeviceDispatch : public InstanceDispatch {
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
PFN_vkAllocateMemory vkAllocateMemory;
PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
PFN_vkBindBufferMemory vkBindBufferMemory;
PFN_vkBindImageMemory vkBindImageMemory;
PFN_vkCmdBeginQuery vkCmdBeginQuery;
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT;
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
PFN_vkCmdBindPipeline vkCmdBindPipeline;
PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT;
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
PFN_vkCmdBlitImage vkCmdBlitImage;
PFN_vkCmdClearAttachments vkCmdClearAttachments;
PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
PFN_vkCmdCopyImage vkCmdCopyImage;
PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer;
PFN_vkCmdDispatch vkCmdDispatch;
PFN_vkCmdDraw vkCmdDraw;
PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
PFN_vkCmdEndQuery vkCmdEndQuery;
PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT;
PFN_vkCmdFillBuffer vkCmdFillBuffer;
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
PFN_vkCmdPushConstants vkCmdPushConstants;
PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants;
PFN_vkCmdSetDepthBias vkCmdSetDepthBias;
PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds;
PFN_vkCmdSetEvent vkCmdSetEvent;
PFN_vkCmdSetScissor vkCmdSetScissor;
PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask;
PFN_vkCmdSetStencilReference vkCmdSetStencilReference;
PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask;
PFN_vkCmdSetViewport vkCmdSetViewport;
PFN_vkCmdWaitEvents vkCmdWaitEvents;
PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT;
PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT;
PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT;
PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT;
PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT;
PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT;
PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT;
PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT;
PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT;
PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT;
PFN_vkCreateBuffer vkCreateBuffer;
PFN_vkCreateBufferView vkCreateBufferView;
PFN_vkCreateCommandPool vkCreateCommandPool;
PFN_vkCreateComputePipelines vkCreateComputePipelines;
PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR;
PFN_vkCreateEvent vkCreateEvent;
PFN_vkCreateFence vkCreateFence;
PFN_vkCreateFramebuffer vkCreateFramebuffer;
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
PFN_vkCreateImage vkCreateImage;
PFN_vkCreateImageView vkCreateImageView;
PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
PFN_vkCreateQueryPool vkCreateQueryPool;
PFN_vkCreateRenderPass vkCreateRenderPass;
PFN_vkCreateSampler vkCreateSampler;
PFN_vkCreateSemaphore vkCreateSemaphore;
PFN_vkCreateShaderModule vkCreateShaderModule;
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
PFN_vkDestroyBuffer vkDestroyBuffer;
PFN_vkDestroyBufferView vkDestroyBufferView;
PFN_vkDestroyCommandPool vkDestroyCommandPool;
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR;
PFN_vkDestroyEvent vkDestroyEvent;
PFN_vkDestroyFence vkDestroyFence;
PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
PFN_vkDestroyImage vkDestroyImage;
PFN_vkDestroyImageView vkDestroyImageView;
PFN_vkDestroyPipeline vkDestroyPipeline;
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
PFN_vkDestroyQueryPool vkDestroyQueryPool;
PFN_vkDestroyRenderPass vkDestroyRenderPass;
PFN_vkDestroySampler vkDestroySampler;
PFN_vkDestroySemaphore vkDestroySemaphore;
PFN_vkDestroyShaderModule vkDestroyShaderModule;
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
PFN_vkEndCommandBuffer vkEndCommandBuffer;
PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
PFN_vkFreeMemory vkFreeMemory;
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
PFN_vkGetDeviceQueue vkGetDeviceQueue;
PFN_vkGetEventStatus vkGetEventStatus;
PFN_vkGetFenceStatus vkGetFenceStatus;
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR;
PFN_vkMapMemory vkMapMemory;
PFN_vkQueueSubmit vkQueueSubmit;
PFN_vkResetFences vkResetFences;
PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT;
PFN_vkUnmapMemory vkUnmapMemory;
PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR;
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
PFN_vkWaitForFences vkWaitForFences;
PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR;
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR = nullptr;
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers = nullptr;
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets = nullptr;
PFN_vkAllocateMemory vkAllocateMemory = nullptr;
PFN_vkBeginCommandBuffer vkBeginCommandBuffer = nullptr;
PFN_vkBindBufferMemory vkBindBufferMemory = nullptr;
PFN_vkBindImageMemory vkBindImageMemory = nullptr;
PFN_vkCmdBeginQuery vkCmdBeginQuery = nullptr;
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass = nullptr;
PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT = nullptr;
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets = nullptr;
PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer = nullptr;
PFN_vkCmdBindPipeline vkCmdBindPipeline = nullptr;
PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT = nullptr;
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers = nullptr;
PFN_vkCmdBlitImage vkCmdBlitImage = nullptr;
PFN_vkCmdClearAttachments vkCmdClearAttachments = nullptr;
PFN_vkCmdCopyBuffer vkCmdCopyBuffer = nullptr;
PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage = nullptr;
PFN_vkCmdCopyImage vkCmdCopyImage = nullptr;
PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer = nullptr;
PFN_vkCmdDispatch vkCmdDispatch = nullptr;
PFN_vkCmdDraw vkCmdDraw = nullptr;
PFN_vkCmdDrawIndexed vkCmdDrawIndexed = nullptr;
PFN_vkCmdEndQuery vkCmdEndQuery = nullptr;
PFN_vkCmdEndRenderPass vkCmdEndRenderPass = nullptr;
PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT = nullptr;
PFN_vkCmdFillBuffer vkCmdFillBuffer = nullptr;
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier = nullptr;
PFN_vkCmdPushConstants vkCmdPushConstants = nullptr;
PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants = nullptr;
PFN_vkCmdSetDepthBias vkCmdSetDepthBias = nullptr;
PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds = nullptr;
PFN_vkCmdSetEvent vkCmdSetEvent = nullptr;
PFN_vkCmdSetScissor vkCmdSetScissor = nullptr;
PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask = nullptr;
PFN_vkCmdSetStencilReference vkCmdSetStencilReference = nullptr;
PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask = nullptr;
PFN_vkCmdSetViewport vkCmdSetViewport = nullptr;
PFN_vkCmdWaitEvents vkCmdWaitEvents = nullptr;
PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT = nullptr;
PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT = nullptr;
PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT = nullptr;
PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT = nullptr;
PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT = nullptr;
PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT = nullptr;
PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT = nullptr;
PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT = nullptr;
PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT = nullptr;
PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT = nullptr;
PFN_vkCreateBuffer vkCreateBuffer = nullptr;
PFN_vkCreateBufferView vkCreateBufferView = nullptr;
PFN_vkCreateCommandPool vkCreateCommandPool = nullptr;
PFN_vkCreateComputePipelines vkCreateComputePipelines = nullptr;
PFN_vkCreateDescriptorPool vkCreateDescriptorPool = nullptr;
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout = nullptr;
PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR = nullptr;
PFN_vkCreateEvent vkCreateEvent = nullptr;
PFN_vkCreateFence vkCreateFence = nullptr;
PFN_vkCreateFramebuffer vkCreateFramebuffer = nullptr;
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines = nullptr;
PFN_vkCreateImage vkCreateImage = nullptr;
PFN_vkCreateImageView vkCreateImageView = nullptr;
PFN_vkCreatePipelineLayout vkCreatePipelineLayout = nullptr;
PFN_vkCreateQueryPool vkCreateQueryPool = nullptr;
PFN_vkCreateRenderPass vkCreateRenderPass = nullptr;
PFN_vkCreateSampler vkCreateSampler = nullptr;
PFN_vkCreateSemaphore vkCreateSemaphore = nullptr;
PFN_vkCreateShaderModule vkCreateShaderModule = nullptr;
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr;
PFN_vkDestroyBuffer vkDestroyBuffer = nullptr;
PFN_vkDestroyBufferView vkDestroyBufferView = nullptr;
PFN_vkDestroyCommandPool vkDestroyCommandPool = nullptr;
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool = nullptr;
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout = nullptr;
PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR = nullptr;
PFN_vkDestroyEvent vkDestroyEvent = nullptr;
PFN_vkDestroyFence vkDestroyFence = nullptr;
PFN_vkDestroyFramebuffer vkDestroyFramebuffer = nullptr;
PFN_vkDestroyImage vkDestroyImage = nullptr;
PFN_vkDestroyImageView vkDestroyImageView = nullptr;
PFN_vkDestroyPipeline vkDestroyPipeline = nullptr;
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout = nullptr;
PFN_vkDestroyQueryPool vkDestroyQueryPool = nullptr;
PFN_vkDestroyRenderPass vkDestroyRenderPass = nullptr;
PFN_vkDestroySampler vkDestroySampler = nullptr;
PFN_vkDestroySemaphore vkDestroySemaphore = nullptr;
PFN_vkDestroyShaderModule vkDestroyShaderModule = nullptr;
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR = nullptr;
PFN_vkDeviceWaitIdle vkDeviceWaitIdle = nullptr;
PFN_vkEndCommandBuffer vkEndCommandBuffer = nullptr;
PFN_vkFreeCommandBuffers vkFreeCommandBuffers = nullptr;
PFN_vkFreeDescriptorSets vkFreeDescriptorSets = nullptr;
PFN_vkFreeMemory vkFreeMemory = nullptr;
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements = nullptr;
PFN_vkGetDeviceQueue vkGetDeviceQueue = nullptr;
PFN_vkGetEventStatus vkGetEventStatus = nullptr;
PFN_vkGetFenceStatus vkGetFenceStatus = nullptr;
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements = nullptr;
PFN_vkGetQueryPoolResults vkGetQueryPoolResults = nullptr;
PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR = nullptr;
PFN_vkMapMemory vkMapMemory = nullptr;
PFN_vkQueueSubmit vkQueueSubmit = nullptr;
PFN_vkResetFences vkResetFences = nullptr;
PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT = nullptr;
PFN_vkUnmapMemory vkUnmapMemory = nullptr;
PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR = nullptr;
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets = nullptr;
PFN_vkWaitForFences vkWaitForFences = nullptr;
PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR = nullptr;
};
/// Loads instance agnostic function pointers.

View File

@@ -77,7 +77,7 @@ u32 ShaderIR::DecodeArithmeticHalf(NodeBlock& bb, u32 pc) {
op_b = UnpackHalfFloat(op_b, type_b);
op_b = GetOperandAbsNegHalf(op_b, absolute_b, negate_b);
Node value = [this, opcode, op_a, op_b = op_b] {
Node value = [opcode, op_a, op_b = op_b] {
switch (opcode->get().GetId()) {
case OpCode::Id::HADD2_C:
case OpCode::Id::HADD2_R:

View File

@@ -25,7 +25,7 @@ u32 ShaderIR::DecodeRegisterSetPredicate(NodeBlock& bb, u32 pc) {
const Instruction instr = {program_code[pc]};
const auto opcode = OpCode::Decode(instr);
Node apply_mask = [this, opcode, instr] {
Node apply_mask = [opcode, instr] {
switch (opcode->get().GetId()) {
case OpCode::Id::R2P_IMM:
case OpCode::Id::P2R_IMM:

View File

@@ -178,7 +178,7 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
: GetSampler(instr.sampler, info);
Node4 values;
if (!sampler) {
std::generate(values.begin(), values.end(), [this] { return Immediate(0); });
std::generate(values.begin(), values.end(), [] { return Immediate(0); });
WriteTexInstructionFloat(bb, instr, values);
break;
}

View File

@@ -316,7 +316,7 @@ bool QtControllerSelectorDialog::CheckIfParametersMet() {
// Here, we check and validate the current configuration against all applicable parameters.
const auto num_connected_players = static_cast<int>(
std::count_if(player_groupboxes.begin(), player_groupboxes.end(),
[this](const QGroupBox* player) { return player->isChecked(); }));
[](const QGroupBox* player) { return player->isChecked(); }));
const auto min_supported_players = parameters.enable_single_mode ? 1 : parameters.min_players;
const auto max_supported_players = parameters.enable_single_mode ? 1 : parameters.max_players;

View File

@@ -224,7 +224,7 @@ public:
}
private:
GRenderWindow* render_window;
[[maybe_unused]] GRenderWindow* render_window;
};
class OpenGLRenderWidget : public RenderWidget {
@@ -260,7 +260,7 @@ static Core::Frontend::WindowSystemType GetWindowSystemType() {
else if (platform_name == QStringLiteral("wayland"))
return Core::Frontend::WindowSystemType::Wayland;
LOG_CRITICAL(Frontend, "Unknown Qt platform!");
LOG_CRITICAL(Frontend, "Unknown Qt platform {}!", platform_name.toStdString());
return Core::Frontend::WindowSystemType::Windows;
}

View File

@@ -73,7 +73,7 @@ constexpr Settings::ControllerType GetControllerTypeFromIndex(int index) {
}
/// Maps the Controller Type enum to controller type combobox index
constexpr int GetIndexFromControllerType(Settings::ControllerType type) {
[[maybe_unused]] constexpr int GetIndexFromControllerType(Settings::ControllerType type) {
switch (type) {
case Settings::ControllerType::ProController:
default:

View File

@@ -8,6 +8,7 @@
#include <QMessageBox>
#include <QPushButton>
#include <QVBoxLayout>
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/settings.h"
#include "input_common/main.h"
@@ -49,6 +50,8 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
case CalibrationConfigurationJob::Status::Completed:
text = tr("Configuration completed!");
break;
case CalibrationConfigurationJob::Status::Initialized:
UNREACHABLE();
}
QMetaObject::invokeMethod(this, "UpdateLabelText", Q_ARG(QString, text));
if (status == CalibrationConfigurationJob::Status::Completed) {

View File

@@ -1443,7 +1443,7 @@ static bool RomFSRawCopy(QProgressDialog& dialog, const FileSys::VirtualDir& src
}
void GMainWindow::OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type) {
const QString entry_type = [this, type] {
const QString entry_type = [type] {
switch (type) {
case InstalledEntryType::Game:
return tr("Contents");
@@ -1539,7 +1539,7 @@ void GMainWindow::RemoveAddOnContent(u64 program_id, const QString& entry_type)
}
void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target) {
const QString question = [this, target] {
const QString question = [target] {
switch (target) {
case GameListRemoveTarget::ShaderCache:
return tr("Delete Transferable Shader Cache?");

View File

@@ -347,7 +347,6 @@ void Config::ReadValues() {
// System
Settings::values.use_docked_mode.SetValue(
sdl2_config->GetBoolean("System", "use_docked_mode", false));
const auto size = sdl2_config->GetInteger("System", "users_size", 0);
Settings::values.current_user = std::clamp<int>(
sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1);