Commit Graph

11330 Commits

Author SHA1 Message Date
Lioncash
d72e675df5 common/logging: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
4f4691502b common/zstd_compression: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
1c23c2ec5e common/uint128: Apply nodiscard and noexcept where applicable 2019-04-15 15:46:17 -04:00
Lioncash
1c13186ec5 common/timer: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
5ef9259e64 common/threadsafe_queue: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
737fafef56 common/thread_queue_list: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
5cbc3dcfe6 common/thread: Apply nodiscard where applicable 2019-04-15 15:46:17 -04:00
Lioncash
1a40a58fd5 common/telemetry: Apply nodiscard where applicable 2019-04-15 15:46:05 -04:00
Lioncash
3519abc87a common/string_util: Apply nodiscard where applicable 2019-04-15 13:18:24 -04:00
Lioncash
f811a4fef0 common/ring_buffer: Apply nodiscard where applicable 2019-04-15 13:16:06 -04:00
Lioncash
52d845f59c common/quaternion: Apply nodiscard and noexcept where applicable 2019-04-15 13:13:11 -04:00
Lioncash
406b04c7de common/param_package: Apply nodiscard where applicable 2019-04-15 13:11:26 -04:00
Lioncash
76eb6c89ed common/page_table: Apply nodiscard where applicable 2019-04-15 13:10:24 -04:00
Lioncash
30f35cbd5b common/multi_level_queue: Apply nodiscard where applicable 2019-04-15 13:09:09 -04:00
Lioncash
329dc99635 common/memory_hook: Apply nodiscard where applicable 2019-04-15 13:06:35 -04:00
Lioncash
07fd12f353 common/math_util: Apply nodiscard and noexcept where applicable
Applies the nodiscard attribute where it would be a bug/logic error to
ignore the return value.

Also marks inline member functions as noexcept where applicable.
2019-04-15 13:02:46 -04:00
Lioncash
a88b2e8c88 common/lz4_compression: Apply nodiscard where applicable
Applies nodiscard where it would 100% be a bug if the return value is
ignored.
2019-04-15 12:58:51 -04:00
Lioncash
4ddf95aba0 common/hex_util: Apply nodiscard where applicable
Applies nodiscard to functions where ignoring the return value would be
a bug.
2019-04-15 12:57:09 -04:00
Lioncash
016a647623 common/file_util: Apply nodiscard where applicable
Applies nodiscard to functions where it would be guaranteed to be a bug
if the return value is ignored.
2019-04-15 12:54:15 -04:00
Lioncash
6d266f4374 common/common_funcs: Apply nodiscard and noexcept where applicable
In all cases, it would be a bug to ignore the return value.
2019-04-15 12:45:58 -04:00
Lioncash
50e452217e common/bit_util: Apply nodiscard and noexcept where applicable
In all scenarios here, it would be a bug to ignore the return values of
these functions.
2019-04-15 12:43:40 -04:00
Lioncash
d0ea421f2d common/bit_field: Apply nodiscard and noexcept where applicable
Marks functions where it would be a bug to ignore the return value with
nodiscard.
2019-04-15 12:43:20 -04:00
Lioncash
10cfa87eb6 common/alignment: Apply nodiscard and noexcept to utility functions
In all scenarios, ignoring the return value of these functions is a bug.
While we're at it, we can also make them noexcept.
2019-04-15 12:36:16 -04:00
bunnei
1f4dfb3998 Merge pull request #2378 from lioncash/ro
ldr: Minor amendments to IPC-related parameters
2019-04-13 22:16:10 -04:00
bunnei
c9454c8422 Merge pull request #2373 from FernandoS27/z32
Set Pixel Format to Z32 if its R32F and depth compare enabled, and Implement format ZF32_X24S8
2019-04-13 22:14:51 -04:00
bunnei
6088898b02 Merge pull request #2357 from zarroboogs/force-30fps-mode
Add a toggle to force 30FPS mode
2019-04-13 22:14:04 -04:00
bunnei
a788c861bd Merge pull request #2381 from lioncash/fs
fsp_srv: Minor cleanup related changes
2019-04-13 22:09:58 -04:00
bunnei
ee2206a1b7 Merge pull request #2386 from ReinUsesLisp/shader-manager
gl_shader_manager: Move code to source file and minor clean up
2019-04-13 22:09:27 -04:00
bunnei
065f83c6c3 Merge pull request #2017 from jroweboy/glwidget
Frontend: Migrate to QOpenGLWindow and support shared contexts
2019-04-13 22:08:40 -04:00
bunnei
ee3f576495 Merge pull request #2389 from FreddyFunk/rename-gamedir
ui_settings: Rename game directory variables
2019-04-13 22:06:51 -04:00
bunnei
b42595fa6b Merge pull request #2391 from lioncash/scope
common/scope_exit: Replace std::move with std::forward in ScopeExit()
2019-04-12 21:52:35 -04:00
bunnei
0faf7b17a1 Merge pull request #2392 from lioncash/swap
common/swap: Minor cleanup and improvements to byte swapping functions
2019-04-12 21:52:16 -04:00
FreddyFunk
382722b9c4 Fix Clang Format 2019-04-12 16:40:35 +02:00
Lioncash
0d8ef2d3b9 common/swap: Improve codegen of the default swap fallbacks
Uses arithmetic that can be identified more trivially by compilers for
optimizations. e.g. Rather than shifting the halves of the value and
then swapping and combining them, we can swap them in place.

e.g. for the original swap32 code on x86-64, clang 8.0 would generate:

    mov     ecx, edi
    rol     cx, 8
    shl     ecx, 16
    shr     edi, 16
    rol     di, 8
    movzx   eax, di
    or      eax, ecx
    ret

while GCC 8.3 would generate the ideal:

    mov     eax, edi
    bswap   eax
    ret

now both generate the same optimal output.

MSVC used to generate the following with the old code:

    mov     eax, ecx
    rol     cx, 8
    shr     eax, 16
    rol     ax, 8
    movzx   ecx, cx
    movzx   eax, ax
    shl     ecx, 16
    or      eax, ecx
    ret     0

Now MSVC also generates a similar, but equally optimal result as clang/GCC:

    bswap   ecx
    mov     eax, ecx
    ret     0

====

In the swap64 case, for the original code, clang 8.0 would generate:

    mov     eax, edi
    bswap   eax
    shl     rax, 32
    shr     rdi, 32
    bswap   edi
    or      rax, rdi
    ret

(almost there, but still missing the mark)

while, again, GCC 8.3 would generate the more ideal:

    mov     rax, rdi
    bswap   rax
    ret

now clang also generates the optimal sequence for this fallback as well.

This is a case where MSVC unfortunately falls short, despite the new
code, this one still generates a doozy of an output.

    mov     r8, rcx
    mov     r9, rcx
    mov     rax, 71776119061217280
    mov     rdx, r8
    and     r9, rax
    and     edx, 65280
    mov     rax, rcx
    shr     rax, 16
    or      r9, rax
    mov     rax, rcx
    shr     r9, 16
    mov     rcx, 280375465082880
    and     rax, rcx
    mov     rcx, 1095216660480
    or      r9, rax
    mov     rax, r8
    and     rax, rcx
    shr     r9, 16
    or      r9, rax
    mov     rcx, r8
    mov     rax, r8
    shr     r9, 8
    shl     rax, 16
    and     ecx, 16711680
    or      rdx, rax
    mov     eax, -16777216
    and     rax, r8
    shl     rdx, 16
    or      rdx, rcx
    shl     rdx, 16
    or      rax, rdx
    shl     rax, 8
    or      rax, r9
    ret     0

which is pretty unfortunate.
2019-04-12 00:07:39 -04:00
bunnei
ea80e2bc57 Merge pull request #2235 from ReinUsesLisp/spirv-decompiler
vk_shader_decompiler: Implement a SPIR-V decompiler
2019-04-11 21:54:23 -04:00
bunnei
83a2fb3c3a Merge pull request #2360 from lioncash/svc-global
kernel/svc: Deglobalize the supervisor call handlers
2019-04-11 21:50:05 -04:00
bunnei
e2f2155dab Merge pull request #2388 from lioncash/constexpr
kernel: Make handle type declarations constexpr
2019-04-11 21:49:45 -04:00
bunnei
c0b2b7020d Merge pull request #2387 from FernandoS27/fast-copy-relax
gl_rasterizer_cache: Relax restrictions on FastCopySurface
2019-04-11 21:49:21 -04:00
Lioncash
66b73fd399 common/swap: Mark byte swapping free functions with [[nodiscard]] and noexcept
Allows the compiler to inform when the result of a swap function is
being ignored (which is 100% a bug in all usage scenarios). We also mark
them noexcept to allow other functions using them to be able to be
marked as noexcept and play nicely with things that potentially inspect
"nothrowability".
2019-04-11 20:42:44 -04:00
Lioncash
9cb4b7be40 common/swap: Simplify swap function ifdefs
Including every OS' own built-in byte swapping functions is kind of
undesirable, since it adds yet another build path to ensure compilation
succeeds on.

Given we only support clang, GCC, and MSVC for the time being, we can
utilize their built-in functions directly instead of going through the
OS's API functions.

This shrinks the overall code down to just

if (msvc)
  use msvc's functions
else if (clang or gcc)
  use clang/gcc's builtins
else
  use the slow path
2019-04-11 20:36:19 -04:00
Lioncash
598954436f common/swap: Remove 32-bit ARM path
We don't plan to support host 32-bit ARM execution environments, so this
is essentially dead code.
2019-04-11 20:15:47 -04:00
Lioncash
b569641098 common/scope_exit: Replace std::move with std::forward in ScopeExit()
The template type here is actually a forwarding reference, not an rvalue
reference in this case, so it's more appropriate to use std::forward to
preserve the value category of the type being moved.
2019-04-11 20:01:33 -04:00
Lioncash
6300ccbc3c kernel: Make handle type declarations constexpr
Some objects declare their handle type as const, while others declare it
as constexpr. This makes the const ones constexpr for consistency, and
prevent unexpected compilation errors if these happen to be attempted to be
used within a constexpr context.
2019-04-11 16:34:53 -04:00
FreddyFunk
dffa1a872a ui_settings: Rename game directory variables 2019-04-11 19:55:56 +02:00
Fernando Sahmkow
c9305959d3 gl_rasterizer_cache: Relax restrictions on FastCopySurface and FastLayeredCopySurface 2019-04-11 13:14:28 -04:00
bunnei
6951741a94 Merge pull request #2278 from ReinUsesLisp/vc-texture-cache
video_core: Implement API agnostic view based texture cache
2019-04-10 21:17:35 -04:00
bunnei
0371650bd7 Merge pull request #2372 from FernandoS27/fermi-fix
Correct Fermi Copy on Linear Textures.
2019-04-10 21:17:03 -04:00
ReinUsesLisp
93af663683 gl_shader_manager: Move code to source file and minor clean up 2019-04-10 19:29:15 -03:00
Lioncash
dae2449880 ldr: Mark IsValidNROHash() as a const member function
This doesn't modify instance state, so it can be made const.
2019-04-10 15:57:02 -04:00
Lioncash
0032cf3818 ldr: Amend parameters for LoadNro/UnloadNro LoadNrr/UnloadNrr
The initial two words indicate a process ID. Also UnloadNro only
specifies one address, not two.
2019-04-10 15:56:43 -04:00