Commit Graph

16442 Commits

Author SHA1 Message Date
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
bunnei
5d1447897a Merge pull request #4451 from slashiee/extended-logging
logging/settings: Increase maximum log size to 100 MB and add extended logging option
2020-11-23 13:34:15 -08:00
bunnei
2b05c32343 Merge pull request #4969 from liushuyu/master
CI: move refreshenv to the configure step
2020-11-22 20:27:16 -08:00
liushuyu
b546640c41 CI: move refreshenv to the configure step...
... so that cmake can find the Vulkan SDK binaries
2020-11-22 16:19:34 -07:00
bunnei
3a85bc1e77 Merge pull request #4944 from lioncash/system-rem
patch_manager: Remove usages of the global system instance
2020-11-21 22:12:34 -08:00
Morph
e13a91fa9b Merge pull request #4954 from lioncash/compare
gl_rasterizer: Make floating-point literal a float
2020-11-22 09:55:23 +08:00
bunnei
5502f39125 Merge pull request #4955 from lioncash/move3
async_shaders: std::move data within QueueVulkanShader()
2020-11-21 01:21:08 -08:00
Rodrigo Locatti
ba3dd7b78f Merge pull request #4960 from liushuyu/master
ci: install Vulkan SDK in MSVC build
2020-11-21 03:47:17 -03:00
bunnei
afd0e2ee87 Merge pull request #4907 from ogniK5377/nvdrv-cleanup
core: Make nvservices more standardized
2020-11-20 22:15:44 -08:00
liushuyu
185bf3fd28 ci: install Vulkan SDK in MSVC build 2020-11-20 23:01:59 -07:00
LC
d88baa746b Merge pull request #4957 from ReinUsesLisp/alpha-test-rt
gl_rasterizer: Remove warning of untested alpha test
2020-11-20 21:19:06 -05:00
ReinUsesLisp
acc14d233f gl_rasterizer: Remove warning of untested alpha test
Alpha test has been proven to only affect the first render target.
2020-11-20 23:17:40 -03:00
bunnei
b00f4abe36 Merge pull request #4953 from lioncash/shader-shadow
shader_bytecode: Eliminate variable shadowing
2020-11-20 16:58:14 -08:00
bunnei
c47c3d723f Merge pull request #4951 from bunnei/olsc-stub
hle: service: Stub OLSC Initialize and SetSaveDataBackupSettingEnabled functions.
2020-11-20 14:06:37 -08:00
bunnei
3794c91145 olsc: Move member initialization to after member functions. 2020-11-20 10:50:50 -08:00
Lioncash
01db5cf203 async_shaders: emplace threads into the worker thread vector
Same behavior, but constructs the threads in place instead of moving
them.
2020-11-20 04:46:56 -05:00
Lioncash
ba3916fc67 async_shaders: Simplify implementation of GetCompletedWork()
This is equivalent to moving all the contents and then clearing the
vector. This avoids a redundant allocation.
2020-11-20 04:44:44 -05:00
Lioncash
3fcc98e11a async_shaders: Simplify moving data into the pending queue 2020-11-20 04:41:29 -05:00
Lioncash
5b441fa25d async_shaders: std::move data within QueueVulkanShader()
Same behavior, but avoids redundant copies.

While we're at it, we can simplify the pushing of the parameters into
the pending queue.
2020-11-20 04:38:18 -05:00
Lioncash
8469b76630 gl_rasterizer: Make floating-point literal a float
Gets rid of an unnecessary expansion from float to double.
2020-11-20 04:24:33 -05:00
Lioncash
b7cd5d742e shader_bytecode: Make use of [[nodiscard]] where applicable
Ensures that all queried values are made use of.
2020-11-20 02:20:37 -05:00
Lioncash
56ecafc204 shader_bytecode: Eliminate variable shadowing 2020-11-20 02:13:45 -05:00
Morph
715f0c3b0c Merge pull request #4941 from lioncash/config
configure_input_player: Use static qualifier for IsProfileNameValid()
2020-11-20 14:16:01 +08:00
LC
bba7e8ea4b Merge pull request #4950 from german77/RumbleStrenght
Modify rumble amplification
2020-11-20 00:40:09 -05:00
LC
e883101999 Merge pull request #4952 from ReinUsesLisp/bit-cast
common/bit_cast: Add function matching std::bit_cast without constexpr
2020-11-20 00:39:30 -05:00