Commit Graph

13005 Commits

Author SHA1 Message Date
Lioncash dcbb39cdae CMakeLists: Make missing declarations a compile-time error
Ensures that our code always has its linkage explicit.
2020-04-16 23:43:41 -04:00
Lioncash e2d8be1ca2 General: Resolve warnings related to missing declarations 2020-04-16 23:43:34 -04:00
MerryMage 1cc9507bc5 gdbstub: Fix some gdbstub jankiness
1. Ensure that register information available to gdbstub is most up-to-date.
2. There's no reason to check for current_thread == thread when emitting a trap.
   Doing this results in random hangs whenever a step happens upon a thread switch.
2020-04-17 05:41:43 +02:00
bunnei 86f9c9aa1c
Merge pull request #3671 from lioncash/switch
kernel/thread: Resolve -Wswitch warnings
2020-04-16 23:30:32 -04:00
Lioncash 8f9c599c9f key_manager: Resolve missing field initializer warning 2020-04-16 22:45:44 -04:00
Lioncash 678ac54749 decode/memory: Resolve unused variable warning
Only the first element of the returned pair is ever used.
2020-04-16 22:45:44 -04:00
Lioncash d159643fd7 decode/texture: Resolve unused variable warnings.
Some variables aren't used, so we can remove these.

Unfortunately, diagnostics are still reported on structured bindings
even when annotated with [[maybe_unused]], so we need to unpack the
elements that we want to use manually.
2020-04-16 22:45:41 -04:00
Lioncash f522abd8ab decode/texture: Collapse loop down into std::generate
Same behavior, less code.
2020-04-16 22:29:07 -04:00
Lioncash 7e2d60de26 decode/texture: Eliminate trivial missing field initializer warnings
We can just specify the initializers.
2020-04-16 22:27:21 -04:00
Lioncash 337f2dc11f time_zone_manager: Resolve sign conversion warnings
ttis and ats will never exceed the length of INT32_MAX in our case, so
this is safe.
2020-04-16 22:23:59 -04:00
Lioncash fc5df84581 CMakeLists: Enable -Wmissing-declarations on Linux builds
Allows catching cases where internal linkage isn't specified for helper
functions when they should be marked as such.
2020-04-16 22:07:16 -04:00
Lioncash 77356731a9 hle_ipc: Remove std::size_t casts where applicable
These were added in the change that enabled -Wextra on linux builds so
as not to introduce interface changes in the same change as a
build-system flag addition.

Now that the flags are enabled, we can freely change the interface to
make these unnecessary.
2020-04-16 22:02:10 -04:00
bunnei 79c1269f0f
Merge pull request #3673 from lioncash/extra
CMakeLists: Specify -Wextra on linux builds
2020-04-16 21:12:33 -04:00
ReinUsesLisp 238c6016f9 maxwell_3d: Initialize format attributes constant as one
nouveau expects this to be true but it doesn't set it.
2020-04-16 21:15:07 -03:00
ReinUsesLisp c961770900 vk_compute_pass: Implement indexed quads
Implement indexed quads (GL_QUADS used with glDrawElements*) with a
compute pass conversion.

The compute shader converts from uint8/uint16/uint32 indices to uint32.
The format is passed through push constants to avoid having different
variants of the same shader.

- Used by Fast RMX
- Used by Xenoblade Chronicles 2 (it still has graphical due to
synchronization issues on Vulkan)
2020-04-16 21:12:32 -03:00
Fernando Sahmkow c81f256111
Merge pull request #3600 from ReinUsesLisp/no-pointer-buf-cache
buffer_cache: Return handles instead of pointer to handles
2020-04-16 19:58:13 -04:00
Markus Wick fedf750e1b externals: Move LibreSSL linking to httplib.
Neither core nor web_services use OpenSSL nor LibreSSL.
However they need to link them as it's a requirement of httplib.
So let's declare this within httplib instead of core and web_services.
2020-04-16 16:46:33 +02:00
Markus Wick 94c2c828a5 input_common: Use the CMake target instead of the variable. 2020-04-16 16:42:59 +02:00
Rodrigo Locatti db67e017cb
Merge pull request #3659 from bunnei/time-calc-standard-user
service: time: Implement CalculateStandardUserSystemClockDifferenceByUser.
2020-04-16 02:51:57 -03:00
ReinUsesLisp 090fd3fefa buffer_cache: Return handles instead of pointer to handles
The original idea of returning pointers is that handles can be moved.
The problem is that the implementation didn't take that in mind and made
everything harder to work with. This commit drops pointer to handles and
returns the handles themselves. While it is still true that handles can
be invalidated, this way we get an old handle instead of a dangling
pointer.

This problem can be solved in the future with sparse buffers.
2020-04-16 02:33:34 -03:00
Rodrigo Locatti a5a2ee8766
Merge pull request #3689 from lioncash/unused-var
decode/shift: Remove unused variable within Shift()
2020-04-16 02:05:54 -03:00
Rodrigo Locatti d196ce0f71
Merge pull request #3688 from lioncash/nequal
surface_view: Add missing operator!= to ViewParams
2020-04-16 01:39:51 -03:00
Rodrigo Locatti 4209dba1f6
Merge pull request #3680 from lioncash/static
gl_device: Mark stage_swizzle as constexpr
2020-04-16 01:26:23 -03:00
Rodrigo Locatti 60e8de7c95
Merge pull request #3687 from lioncash/constness
surface_base: Make IsInside() a const member function
2020-04-16 01:22:50 -03:00
Rodrigo Locatti 612966399b
Merge pull request #3685 from lioncash/copies
control_flow: Make use of std::move in TryInspectAddress()
2020-04-16 01:22:40 -03:00
Lioncash cd2a12e78f decode/shift: Remove unused variable within Shift()
Removes a redundant variable that is already satisfied by the IsFull()
utility function.
2020-04-16 00:16:06 -04:00
Lioncash 5fbe8785d2 surface_view: Add missing operator!= to ViewParams
Provides logical symmetry to the interface.
2020-04-16 00:03:12 -04:00
Lioncash d551c910bb surface_base: Make IsInside() a const member function
This doesn't modify internal state, so this can be made const.
2020-04-15 23:59:35 -04:00
bunnei 319df1db77
Merge pull request #3683 from lioncash/docs
video_core: Amend doxygen comment references
2020-04-15 23:54:58 -04:00
Lioncash 636c8ab85b texture_cache/format_lookup_table: Fix incorrect green, blue, and alpha indices
Previously these were all using the red component to derive the indices,
which is definitely not intentional.
2020-04-15 23:50:46 -04:00
Lioncash 72a224d3fc control_flow: Make use of std::move in TryInspectAddress()
Eliminates redundant atomic reference count increments and decrements.
2020-04-15 23:31:22 -04:00
Lioncash 11837e8f13 video_core: Amend doxygen comment references
Fixes broken documentation references.
2020-04-15 22:33:29 -04:00
Lioncash 3a60f19eaf gl_query_cache: Resolve use-after-move in CachedQuery move assignment operator
Avoids potential invalid junk data from being read.
2020-04-15 22:20:06 -04:00
Lioncash 71fb156611 gl_device: Mark stage_swizzle as constexpr
Previously this was mutable even though it shouldn't be.
2020-04-15 21:59:13 -04:00
Lioncash e15ec2705c track: Eliminate redundant copies
Two variables can be references, while two others can be std::moved.
Makes for 4 less atomic reference count increments and decrements.
2020-04-15 21:50:09 -04:00
Lioncash 1c340c6efa CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as
implicit fallthrough cases, etc.

We currently ignore unused parameters, since we currently have many
cases where this is intentional (virtual interfaces).

While we're at it, we can also tidy up any existing code that causes
warnings. This also uncovered a few bugs as well.
2020-04-15 21:33:46 -04:00
Rodrigo Locatti 65cbb122ea
Merge pull request #3649 from FernandoS27/3d-fix
Texture Cache: Read current data when flushing a 3D segment.
2020-04-15 17:06:55 -03:00
Fernando Sahmkow e33196d4e7
Merge pull request #3612 from ReinUsesLisp/red
shader/memory: Implement RED.E.ADD and minor changes to ATOM
2020-04-15 15:03:49 -04:00
Lioncash e77337588e file_util: Early-exit in WriteArray and ReadArray if specified lengths are zero
It's undefined behavior to pass a null pointer to std::fread and
std::fwrite, even if the length passed in is zero, so we must perform
the precondition checking ourselves.

A common case where this can occur is when passing in the data of an
empty std::vector and size, as an empty vector will typically have a
null internal buffer.

While we're at it, we can move the implementation out of line and add
debug checks against passing in nullptr to std::fread and std::fwrite.
2020-04-15 14:43:37 -04:00
Lioncash 213fff67bc CMakeLists: Make -Wreorder a compile-time error
This can result in silent logic bugs within code, and given the amount
of times these kind of warnings are caused, they should be flagged at
compile-time so no new code is submitted with them.
2020-04-15 14:14:41 -04:00
Lioncash 521c4c33b5 kernel/thread: Resolve -Wswitch warnings 2020-04-15 13:48:14 -04:00
Mat M 64b5985f0a
Merge pull request #3662 from ReinUsesLisp/constant-attrs
gl_rasterizer: Implement constant vertex attributes
2020-04-15 11:54:50 -04:00
Fernando Sahmkow 6789d88a9c Texture Cache: Read current data when flushing a 3D segment.
This PR corrects flushing of 3D segments when data of other segments is
mixed, this aims to preserve the data in place.
2020-04-15 11:46:17 -04:00
Mat M 9208d555b7
Merge pull request #3668 from ReinUsesLisp/vtx-format-16ui
maxwell_to_vk: Add uint16 vertex formats
2020-04-15 11:43:52 -04:00
Mat M ab72696beb
Merge pull request #3656 from ReinUsesLisp/glsl-full-decompile
gl_shader_cache: Use CompileDepth::FullDecompile on GLSL
2020-04-15 03:17:46 -04:00
Mat M 4878d6bb49
Merge pull request #3654 from ReinUsesLisp/fix-fb-attach
gl_texture_cache: Fix layered texture attachment base level
2020-04-15 03:17:18 -04:00
Mat M 50c0a92db8
Merge pull request #3663 from ReinUsesLisp/fcmp-rc
shader/arithmetic: Add FCMP_CR variant
2020-04-15 03:16:56 -04:00
Mat M 13331a3a32
Merge pull request #3664 from ReinUsesLisp/fe3h-black-squares
Revert "gl_shader_decompiler: Implement merges with bitfieldInsert"
2020-04-15 03:14:28 -04:00
ReinUsesLisp 3036067047 maxwell_to_vk: Add uint16 vertex formats 2020-04-15 04:06:30 -03:00
ReinUsesLisp b4e43c64c8 maxwell_to_vk: Add missing breaks
Avoid invalid fallbacks.
2020-04-15 04:05:33 -03:00
ReinUsesLisp 0ca456830f vk_blit_screen: Initialize all members in VkPipelineViewportStateCreateInfo
When the dynamic state is specified, pViewports and pScissors are
ignored, quoting the specification:

  pViewports is a pointer to an array of VkViewport structures, defining
  the viewport transforms. If the viewport state is dynamic, this member
  is ignored.

That said, AMD's proprietary driver itself seem to read it regardless of
what the specification says.
2020-04-15 03:30:08 -03:00
Rodrigo Locatti 0b132e8cc1
Merge pull request #3657 from ReinUsesLisp/viewport-zero
vk_rasterizer: Default to 1 viewports with a size of 0
2020-04-15 01:51:17 -03:00
Fernando Sahmkow daddbeffd1
Texture Cache: Only do buffer copies on accurate GPU. (#3634)
This is a simple optimization as Buffer Copies are mostly used for texture recycling. They are, however, useful when games abuse undefined behavior but most 3D APIs forbid it.
2020-04-14 23:21:00 -04:00
bunnei eb676c343a service: time: Implement CalculateStandardUserSystemClockDifferenceByUser.
- Used by Animal Crossing: New Horizons.
2020-04-14 22:28:41 -04:00
ReinUsesLisp fd6371eba7 Revert "gl_shader_decompiler: Implement merges with bitfieldInsert"
This reverts commit 05cf270836.

Apparently the first approach using floats instead of bitfieldInert
worked better for Fire Emblem: Three Houses. Reverting to get that
behavior back.
2020-04-14 21:24:33 -03:00
ReinUsesLisp fefe7f18f9 shader/arithmetic: Add FCMP_CR variant
Adds another variant of FCMP.
2020-04-14 19:11:04 -03:00
Zach Hilman e366b4ee1f
Merge pull request #3660 from bunnei/friend-blocked-users
service: friend: Stub IFriendService::GetBlockedUserListIds.
2020-04-14 16:59:46 -04:00
ReinUsesLisp 6dfcabc800 gl_rasterizer: Implement constant vertex attributes
Credits go to gdkchan from Ryujinx for finding constant attributes are
used in retail games.
2020-04-14 17:58:53 -03:00
bunnei fc35803f91 file_sys: patch_manager: Return early when there are no layers to apply. 2020-04-14 16:25:55 -04:00
bunnei 598740f1dd service: friend: Stub IFriendService::GetBlockedUserListIds.
- This is safe to stub, as there should be no adverse consequences from reporting no blocked users.
2020-04-14 16:20:51 -04:00
ReinUsesLisp 37e5c4fa7c vk_rasterizer: Default to 1 viewports with a size of 0
Silence validation layer errors.
2020-04-14 04:44:34 -03:00
ReinUsesLisp 453d7419d9 gl_shader_cache: Use CompileDepth::FullDecompile on GLSL
From my testing on a Splatoon 2 shader that takes 3800ms on average to
compile changing to FullDecompile reduces it to 900ms on average.

The shader decoder will automatically fallback to a more naive method if
it can't use full decompile.
2020-04-14 01:34:20 -03:00
ReinUsesLisp 0e232cfdc1 renderer_vulkan: Integrate Nvidia Nsight Aftermath on Windows
Adds optional support for Nsight Aftermath. It is enabled through
ENABLE_NSIGHT_AFTERMATH in cmake. A path to the SDK has to be provided
by the environment variable NSIGHT_AFTERMATH_SDK.

Nsight Aftermath allows an application to generate "minidumps" of the
GPU state when a device loss happens. By analysing these on Nsight we
can know what a game was doing and why it triggered a device loss.

The dump is generated inside %APPDATA%\yuzu\log\gpucrash and this
directory is deleted every time a new instance is initialized with
Nsight enabled.

To enable it on yuzu there has a to be a driver and device capable of
running Nsight Aftermath on Vulkan. That means only Turing based GPUs
on the latest stable driver, beta drivers won't work for now.

It is manually enabled in Configuration>Debug>Enable Graphics Debugging
because when using all debugging capabilities there is a runtime cost.
2020-04-14 00:39:21 -03:00
FearlessTobi c2bf91156a yuzu/main: Add better popup texts and remove duplicated actions
Makes popup texts more compact and clear and also links our quickstart guide now.
Also removes OnMenuSelectEmulatedDirectory from the File dropdown, as the action already exists in the Filesystem tab and provides better visual feedback there.
2020-04-14 02:56:22 +02:00
ReinUsesLisp 21dc842171 gl_texture_cache: Fix layered texture attachment base level
The base level is already included in the texture view. If we specify
the base level in the texture again, this will end up in the incorrect
level and potentially out of bounds.
2020-04-13 18:24:56 -03:00
ReinUsesLisp 6cfe2a7246 renderer_vulkan: Remove Nvidia checkpoints 2020-04-13 17:33:59 -03:00
ReinUsesLisp 16105c6a66 renderer_vulkan: Catch device losses in more places 2020-04-13 17:33:59 -03:00
Rodrigo Locatti 7e4a132a77
Merge pull request #3636 from ReinUsesLisp/drop-vk-hpp
renderer_vulkan: Drop Vulkan-Hpp
2020-04-13 17:08:04 -03:00
Mat M fbf13d3f48
Merge pull request #3651 from ReinUsesLisp/line-widths
gl_rasterizer: Implement line widths and smooth lines
2020-04-13 10:19:59 -04:00
Mat M 08266d70ba
Merge pull request #3638 from ReinUsesLisp/remove-preserve-contents
texture_cache: Remove preserve_contents
2020-04-13 10:19:01 -04:00
Mat M c4001225f6
Merge pull request #3631 from ReinUsesLisp/more-astc
texture/astc: More small ASTC optimizations
2020-04-13 10:17:32 -04:00
Mat M 7b62212461
Merge pull request #3619 from ReinUsesLisp/i2i
shader/conversion: Implement I2I sign extension, saturation and selection
2020-04-13 10:17:07 -04:00
Mat M 3351e1e94f
Merge pull request #3627 from ReinUsesLisp/layered-view
gl_texture_cache: Attach view instead of base texture for layered attchments
2020-04-13 10:16:18 -04:00
Mat M d37d899431
Merge pull request #3646 from ReinUsesLisp/fix-glsl-turing
gl_shader_decompiler: Improve generated code in HMergeH*
2020-04-13 10:15:12 -04:00
Mat M 47036859eb
Merge pull request #3633 from ReinUsesLisp/clean-texdec
shader/texture: Remove type mismatches management from shader decoder
2020-04-13 10:13:05 -04:00
ReinUsesLisp 76615b9f34 gl_rasterizer: Implement line widths and smooth lines
Implements "legacy" features from OpenGL present on hardware such as
smooth lines and line width.
2020-04-13 01:30:34 -03:00
ReinUsesLisp 05cf270836 gl_shader_decompiler: Implement merges with bitfieldInsert
This also fixes Turing issues but it avoids doing more bitcasts. This
should improve the generated code while also avoiding more points where
compilers can flush floats.
2020-04-12 22:39:59 -03:00
bunnei a9f866264d
Merge pull request #3606 from ReinUsesLisp/nvflinger
service/vi: Partially implement BufferQueue disconnect
2020-04-12 11:44:48 -04:00
Fernando Sahmkow 3d91dbb21d
Merge pull request #3578 from ReinUsesLisp/vmnmx
shader/video: Partially implement VMNMX
2020-04-12 10:44:03 -04:00
Mat M 4aec01b850
Merge pull request #3644 from ReinUsesLisp/msaa
video_core: Add MSAA registers in 3D engine and TIC
2020-04-12 09:11:44 -04:00
ReinUsesLisp 75eb953575 gl_shader_decompiler: Improve generated code in HMergeH*
Avoiding bitwise expressions, this fixes Turing issues in shaders using
half float merges that affected several games.
2020-04-12 05:06:55 -03:00
ReinUsesLisp 76f178ba6e shader/video: Partially implement VMNMX
Implements the common usages for VMNMX. Inputs with a different size
than 32 bits are not supported and sign mismatches aren't supported
either.

VMNMX works as follows:
It grabs Ra and Rb and applies a maximum/minimum on them (this is
defined by .MX), having in mind the input sign. This result can then be
saturated. After the intermediate result is calculated, it applies
another operation on it using Rc. These operations are merges,
accumulations or another min/max pass.

This instruction allows to implement with a more flexible approach GCN's
min3 and max3 instructions (for instance).
2020-04-12 00:34:42 -03:00
ReinUsesLisp a7baf6fee4 video_core: Add MSAA registers in 3D engine and TIC
This adds the registers used for multisampling. It doesn't implement
anything for now.
2020-04-12 00:21:27 -03:00
Rodrigo Locatti 75e39f7f88
Merge pull request #3635 from FernandoS27/buffer-free
Buffer queue: Correct behavior of free buffer.
2020-04-11 17:58:15 -03:00
bunnei 8938f9941c
Merge pull request #3611 from FearlessTobi/port-4956
Port citra-emu/citra#4956: "Fixes to game list sorting"
2020-04-11 12:44:36 -04:00
ReinUsesLisp 94b0e2e5da texture_cache: Remove preserve_contents
preserve_contents was always true. We can't assume we don't have to
preserve clears because scissored and color masked clears exist.

This removes preserve_contents and assumes it as true at all times.
2020-04-11 01:51:02 -03:00
ReinUsesLisp 2905142f47 renderer_vulkan: Drop Vulkan-Hpp 2020-04-10 22:49:02 -03:00
bunnei 51c6688e21
Merge pull request #3594 from ReinUsesLisp/vk-instance
yuzu: Drop SDL2 and Qt frontend Vulkan requirements
2020-04-10 20:06:55 -04:00
Fernando Sahmkow 486a42c45a Buffer queue: Correct behavior of free buffer.
This corrects the behavior of free buffer after witnessing it in an
unrelated hardware test. I haven't found any games affected by it but in
name of better accuracy we'll correct such behavior.
2020-04-10 16:44:28 -04:00
bunnei 8adf66f9fd
Merge pull request #3607 from FearlessTobi/input-kms
yuzu/configuration: Fix input profiles and a wrong assert
2020-04-10 00:39:48 -04:00
ReinUsesLisp 8c0ba9c6fe service/vi: Partially implement BufferQueue disconnect 2020-04-10 01:00:50 -03:00
ReinUsesLisp a87b16da9a shader/texture: Remove type mismatches management from shader decoder
Since commit e22816a5bb we handle type mismatches from the CPU.
We don't need to hack our shader decoder due to game bugs anymore.

Removed in this commit.
2020-04-10 00:57:32 -03:00
Fernando Sahmkow f570b129a2
Merge pull request #3623 from ReinUsesLisp/renderdoc-bind-spam
qt/bootmanager: Remove unnecessary glBindFramebuffer
2020-04-09 18:02:17 -04:00
Fernando Sahmkow 7182ef31c9
Merge pull request #3622 from ReinUsesLisp/srgb-texture-border
video_core/texture: Use a LUT to convert sRGB texture borders
2020-04-09 18:01:48 -04:00
ReinUsesLisp 6bf5d2b011 astc: Hard code bit depth changes to 8 and use fast replicate 2020-04-09 18:37:12 -03:00
Rodrigo Locatti 36f607217f
Merge pull request #3610 from FernandoS27/gpu-caches
Refactor all the GPU Caches to use VAddr for cache addressing
2020-04-09 17:59:21 -03:00
Ben Russell f98a2c42de
common/file_util: Allow access to files on network shares
On Windows, network shares use paths like \\server\share\file which were
being broken by FileUtil::SanitizePath() removing double slashes.

Changed the code in SanitizePath to permit a double-backslash if it
occurs at the start of a filepath (on Windows only).
2020-04-09 18:48:28 +01:00
ReinUsesLisp bd2c1ab8a0 astc: Use boost's static_vector to avoid heap allocations 2020-04-09 05:27:57 -03:00
ReinUsesLisp 5de130beea astc: Implement a fast precompiled alternative for Replicate 2020-04-09 03:58:25 -03:00
ReinUsesLisp 6b4d4473be astc: Move Replicate to a constexpr LUT when possible 2020-04-09 03:35:07 -03:00
ReinUsesLisp d22a689250 astc: Make InputBitStream constexpr 2020-04-09 02:54:05 -03:00
ReinUsesLisp 0efc230381 astc: OutputBitStream style changes and make it constexpr 2020-04-09 02:37:51 -03:00
bunnei b96fd0bd0e
Merge pull request #3601 from ReinUsesLisp/some-shader-encodings
video_core/shader: Add some instruction and S2R encodings
2020-04-09 00:17:39 -04:00
ReinUsesLisp 6c8f9f40d7 gl_texture_cache: Attach view instead of base texture for layered attachments
This way we are not ignoring the base layer of the current texture.
2020-04-08 22:20:25 -03:00
Fernando Sahmkow 7cd6daf115 VkRasterizer: Eliminate Legacy code. 2020-04-08 18:59:09 -04:00
Fernando Sahmkow 1c18dc6577 Memory: Correct GCC errors. 2020-04-08 18:09:16 -04:00
Fernando Sahmkow 913f42a3a7 Memory: Address Feedback. 2020-04-08 13:40:46 -04:00
Fernando Sahmkow e00d992848 GPUMemoryManager: Improve safety of memory reads. 2020-04-08 12:08:06 -04:00
Kewlan 848d619aec Place SL and SR in the right most column. 2020-04-08 11:34:16 +02:00
bunnei b128beb3a9
Merge pull request #3572 from FearlessTobi/port-5127
Port citra-emu/citra#5127: "common: Port some changes from dolphin"
2020-04-07 23:48:16 -04:00
ReinUsesLisp c6ea0d010b qt/bootmanager: Remove unnecessary glBindFramebuffer
Presentation context always has GL_DRAW_FRAMEBUFFER_BINDING as zero.
There is no need to bind the default framebuffer constantly.

According to Nsight this was using ~0.7ms per frame and it broke
renderdoc captures.
2020-04-07 20:51:56 -03:00
ReinUsesLisp a209d464f9 video_core/textures: Move GetMaxAnisotropy to cpp file 2020-04-07 20:47:31 -03:00
ReinUsesLisp d7db088180 video_core/texture: Use a LUT to convert sRGB texture borders
This is a reversed look up table extracted from
https://gist.github.com/rygorous/2203834#file-gistfile1-cpp-L41-L62

that is used in
04d4e9e587/source/maxwell/tsc_generate.cpp (L38)

Games usually bind 0xFD expecting a float texture border of 1.0f.
The conversion previous to this commit was multiplying the uint8 sRGB
texture border color by 255. This is close to 1.0f but when that
difference matters, some graphical glitches appear.

This look up table is manually changed in the edges, clamping towards
0.0f and 1.0f.

While we are at it, move this logic to its own translation unit.
2020-04-07 20:38:14 -03:00
Zach Hilman 26ed65495d
Merge pull request #3621 from SilverBeamx/fullnamefix
Log version and about section version fix
2020-04-07 17:16:23 -04:00
SilverBeamx 863f7385dc Addressed feedback: switched to snake case and fixed clang-format errors 2020-04-07 22:59:09 +02:00
bunnei f316911248
Merge pull request #3599 from ReinUsesLisp/revert-3499
Revert "Merge pull request #3499 from ReinUsesLisp/depth-2d-array"
2020-04-07 16:51:41 -04:00
SilverBeamx 6b512d78c9 Addressed feedback: removed CMake hack in favor of building the necessary strings via the supplied title format 2020-04-07 22:41:45 +02:00
ReinUsesLisp bf1d66b7c0 yuzu: Drop SDL2 and Qt frontend Vulkan requirements
Create Vulkan instances and surfaces from the Vulkan backend.
2020-04-07 16:32:19 -03:00
Rodrigo Locatti 487f9ba525
Merge pull request #3489 from namkazt/patch-2
shader: implement SULD.D bits32/64
2020-04-07 16:21:09 -03:00
Nguyen Dac Nam 935648ffa9
address nit. 2020-04-07 18:29:30 +07:00
ReinUsesLisp bc1b4b85b0 renderer_vulkan: Query device names from the backend 2020-04-07 02:23:23 -03:00
ReinUsesLisp 7104e01bb3 common/dynamic_library: Import and adapt helper from Dolphin 2020-04-07 02:23:23 -03:00
ReinUsesLisp da706cad25 shader/conversion: Implement I2I sign extension, saturation and selection
Reimplements I2I adding sign extension, saturation (clamp source value
to the destination), selection and destination sizes that are not 32
bits wide.

It doesn't implement CC yet.
2020-04-07 02:19:44 -03:00
Nguyen Dac Nam bf1174c114
Apply suggestions from code review
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-04-07 07:55:49 +07:00
enler 27f122c48c
file_sys: fix LayeredFS error when loading some games made with… (#3602)
* fix LayeredFS error when loading some games made with the Unity
2020-04-07 02:03:32 +02:00
Fernando Sahmkow f9d5718c4b Clang Format. 2020-04-06 09:23:08 -04:00
Fernando Sahmkow ea535d9470 Shader/Pipeline Cache: Use VAddr instead of physical memory for addressing. 2020-04-06 09:23:07 -04:00
Fernando Sahmkow 3dd5c07454 Query Cache: Use VAddr instead of physical memory for adressing. 2020-04-06 09:23:07 -04:00
Fernando Sahmkow 7fcd0fee6d Buffer Cache: Use vAddr instead of physical memory. 2020-04-06 09:23:06 -04:00
Fernando Sahmkow 6ee316cb8f Texture Cache: Use vAddr instead of physical memory for caching. 2020-04-06 09:23:05 -04:00
Fernando Sahmkow 9c0f40a1f5 GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddr 2020-04-06 09:21:46 -04:00
Fernando Sahmkow 588a20be3f
Merge pull request #3513 from ReinUsesLisp/native-astc
video_core: Use native ASTC when available
2020-04-06 09:21:11 -04:00
namkazy 2c98e14d13 shader_decode: SULD.D using std::pair instead of out parameter 2020-04-06 13:46:55 +07:00
namkazy 9efa51311f shader_decode: SULD.D avoid duplicate code block. 2020-04-06 13:34:06 +07:00
namkazy 7f5696513f shader_decode: SULD.D fix conversion error. 2020-04-06 13:26:58 +07:00
namkazy 2906372ba1 shader_decode: SULD.D implement bits64 and reverse shader ir init method to removed shader stage. 2020-04-06 13:09:19 +07:00
ReinUsesLisp 3185245845 shader/memory: Implement RED.E.ADD
Implements a reduction operation. It's an atomic operation that doesn't
return a value.

This commit introduces another primitive because some shading languages
might have a primitive for reduction operations.
2020-04-06 02:24:47 -03:00
ReinUsesLisp fd0a2b5151 shader/memory: Add "using std::move" 2020-04-06 02:18:14 -03:00
ReinUsesLisp 79970c9174 shader/memory: Minor fixes in ATOM 2020-04-06 00:54:22 -03:00
FearlessTobi 8d0fb33ac4 yuzu: Fixes to game list sorting
Should fix citra-emu/citra#4593.
As the issue might not be entirely clear, I'll offer a short explanation from what I understood from it and found from experimentation.

Currently yuzu offers the user the option to change the text that's displayed in the "Name" column in the game list. Generally, it is expected that the items are sorted based on the displayed text, but yuzu would sort them by title instead.

Made it so that an access to SortRole returns the same as DisplayRole.
There shouldn't be any UI changes, only change in behaviour.

Also fixes a bug with directory sorting, where having the directories out of order would enable you to try to "move up" to the addDirectory button, which would crash the emulator.

Co-Authored-By: Vitor K <vitor-k@users.noreply.github.com>
2020-04-06 03:12:17 +02:00
Fernando Sahmkow 69277de29d
Merge pull request #3592 from ReinUsesLisp/ipa
shader_decompiler: Remove FragCoord.w hack and change IPA implementation
2020-04-05 19:29:40 -04:00
Fernando Sahmkow 1633fbf99a
Merge pull request #3589 from ReinUsesLisp/fix-clears
gl_rasterizer: Mark cleared textures as dirty
2020-04-05 19:29:26 -04:00
namkazy 730f9b55b3 silent warning (conversion error) 2020-04-05 16:02:07 +07:00
namkazy 9f6ebccf06 shader_decode: SULD.D -> SINT actually same as UNORM. 2020-04-05 15:18:42 +07:00
namkazy 6f2b7087c2 shader_decode: SULD.D fix decode SNORM component 2020-04-05 14:46:43 +07:00
namkazy 69657ff19c clang-format 2020-04-05 12:57:50 +07:00
namkazy 24cc64c5b3 shader_decode: get sampler descriptor from registry. 2020-04-05 12:54:48 +07:00
FearlessTobi aa6214feb7 yuzu/configuration: Only assert that all buttons exist when we are handling the click for a button device
This fixes failed assertions that were present in yuzu master code for 18 months.
2020-04-05 07:16:09 +02:00
FearlessTobi fb8afee077 yuzu/configure_input_simple: Fix "Docked Joycons" controller profile
This was incorrectly using PlayerIndex 1 when calling the ConfigureDialog.
2020-04-05 07:14:35 +02:00
namkazy acd3f0ab37 tweaking. 2020-04-05 10:31:32 +07:00
Nguyen Dac Nam 8370188b3c clang-format 2020-04-05 10:31:31 +07:00
namkazy 3e3afa9be6 cleanup unuse params 2020-04-05 10:31:31 +07:00
namkazy 5cd5857000 cleanup debug code. 2020-04-05 10:31:30 +07:00
namkazy 658112783d reimplement get component type, uncomment mistaken code 2020-04-05 10:31:30 +07:00
namkazy 3ad06e9b2b remove disable optimize 2020-04-05 10:31:30 +07:00
namkazy f24c2e1103 [wip] reimplement SULD.D 2020-04-05 10:31:29 +07:00
namkazy 58bcb86af5 add shader stage when init shader ir 2020-04-05 10:31:29 +07:00
Nguyen Dac Nam 2cefdd92bd clang-fix 2020-04-05 10:31:28 +07:00
Nguyen Dac Nam 1f3d142875 shader: image - import PredCondition 2020-04-05 10:31:27 +07:00
Nguyen Dac Nam 08db60392d shader: SULD.D bits32 implement more complexer method. 2020-04-05 10:31:27 +07:00
Nguyen Dac Nam ed1d8beb13 shader: SULD.D import StoreType 2020-04-05 10:31:26 +07:00
Nguyen Dac Nam 6d235b8631 shader: implement SULD.D bits32 2020-04-05 10:31:26 +07:00
ReinUsesLisp 60106531b4 shader/other: Add error message for some S2R registers 2020-04-04 03:46:07 -03:00
ReinUsesLisp 8b719e9e1d shader_bytecode: Rename MOV_SYS to S2R 2020-04-04 03:37:51 -03:00
ReinUsesLisp 9d15feb892 shader_bytecode: Add encoding for BAR 2020-04-04 03:36:21 -03:00
ReinUsesLisp 16ae98dbb3 shader_ir: Add error message for EXIT.FCSM_TR 2020-04-04 03:34:08 -03:00
ReinUsesLisp c02a2dc24a shader_bytecode: Add encoding for VOTE.VTG 2020-04-04 03:28:11 -03:00
ReinUsesLisp 80c4fee4ec Revert "Merge pull request #3499 from ReinUsesLisp/depth-2d-array"
This reverts commit 41905ee467, reversing
changes made to 35145bd529.

It causes regressions in several games.
2020-04-04 00:02:26 -03:00
bunnei e6f02d5725
Merge pull request #3579 from Kewlan/reorder-shoulder
configuration: Reorder shoulder buttons
2020-04-03 11:28:14 -04:00
Fernando Sahmkow 9d8886b1a4
Merge pull request #3563 from bunnei/fix-ldr-memstate
services: ldr: Fix MemoryState for read/write regions of NROs.
2020-04-03 10:14:56 -04:00
ReinUsesLisp e1bd89e1c2 shader/memory: Silence no return value warning
Silences a warning about control paths not all returning a value.
2020-04-02 03:34:27 -03:00
Rodrigo Locatti 825a6e2615
Merge pull request #3552 from jroweboy/single-context
Refactor Context management (Fixes renderdoc on opengl issues)
2020-04-02 01:38:25 -03:00
ReinUsesLisp 2339fe199f shader_decompiler: Remove FragCoord.w hack and change IPA implementation
Credits go to gdkchan and Ryujinx. The pull request used for this can
be found here: https://github.com/Ryujinx/Ryujinx/pull/1082

yuzu was already using the header for interpolation, but it was missing
the FragCoord.w multiplication described in the linked pull request.
This commit finally removes the FragCoord.w == 1.0f hack from the shader
decompiler.

While we are at it, this commit renames some enumerations to match
Nvidia's documentation (linked below) and fixes component declaration
order in the shader program header (z and w were swapped).

https://github.com/NVIDIA/open-gpu-doc/blob/master/Shader-Program-Header/Shader-Program-Header.html
2020-04-01 21:48:55 -03:00
ReinUsesLisp dd1232755b gl_texture_cache: Fix software ASTC fallback 2020-04-01 01:44:15 -03:00
ReinUsesLisp 2f0da10dc3 vk_device: Add missing ASTC queries 2020-04-01 01:14:04 -03:00
ReinUsesLisp b6571ca9f0 video_core: Use native ASTC when available 2020-04-01 01:14:04 -03:00
ReinUsesLisp 16270dcfe4 gl_device: Detect if ASTC is reported and expose it 2020-04-01 01:14:04 -03:00
Rodrigo Locatti baf91c920c
Merge pull request #3591 from ReinUsesLisp/vk-wrapper-part2
renderer_vulkan/wrapper: Add a Vulkan wrapper (part 2 of 2)
2020-03-31 22:14:26 -03:00
Vitor K bd0c56c6e7 common: Port some changes from dolphin (#5127)
* IOFile: Make the move constructor and move assignment operator noexcept

Certain parts of the standard library try to determine whether or not a
transfer operation should either be a copy or a move. The prevalent notion
of move constructors/assignment operators is that they should not throw,
they simply move an already existing resource somewhere else.

This is typically done with 'std::move_if_noexcept'. Like the name says,
if a type's move constructor is noexcept, then the functions retrieves an
r-value reference (for move semantics), or an l-value (for copy semantics)
if it is not noexcept.

As IOFile deletes the copy constructor and copy assignment operators,
using IOFile with certain parts of the standard library can fail in
unexcepted ways (especially when used with various container
implementations). This prevents that.

* fix various instances of -1 being assigned to unsigned types

* do not assign in conditional statements

* File/IOFile: Check _tfopen_s properly

* common/file_util.cpp: address review comments

Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: Shawn Hoffman <godisgovernment@gmail.com>
Co-authored-by: Sepalani <sepalani@hotmail.fr>
2020-04-01 02:58:42 +02:00
ReinUsesLisp f22f6b72c3 renderer_vulkan/wrapper: Add vkEnumerateInstanceExtensionProperties wrapper 2020-03-31 21:32:08 -03:00
ReinUsesLisp 27dd542c60 renderer_vulkan/wrapper: Add command buffer handle 2020-03-31 21:32:08 -03:00
ReinUsesLisp 5c90d060d8 renderer_vulkan/wrapper: Add physical device handle 2020-03-31 21:32:08 -03:00
ReinUsesLisp 0eb37de98f renderer_vulkan/wrapper: Add device handle 2020-03-31 21:32:08 -03:00
ReinUsesLisp 11774308d3 renderer_vulkan/wrapper: Add swapchain handle 2020-03-31 21:32:07 -03:00
ReinUsesLisp 7fe52ef77f renderer_vulkan/wrapper: Add fence handle 2020-03-31 21:32:07 -03:00
ReinUsesLisp 3a63ae0658 renderer_vulkan/wrapper: Add device memory handle 2020-03-31 21:32:07 -03:00
ReinUsesLisp 397f53dea1 renderer_vulkan/wrapper: Add pool handles 2020-03-31 21:32:07 -03:00
ReinUsesLisp affee77b70 renderer_vulkan/wrapper: Add buffer and image handles 2020-03-31 21:32:07 -03:00
ReinUsesLisp d85ca0ab33 renderer_vulkan/wrapper: Add queue handle 2020-03-31 21:32:07 -03:00
ReinUsesLisp 151ddcf419 renderer_vulkan/wrapper: Add instance handle 2020-03-31 21:32:07 -03:00
Morph 224a75d839
capsrv: Split Capture services into individual files and stub GetAlbumContentsFileListForApplication (#3571)
* Organize capture services into individual files

* Stub GetAlbumContentsFileListForApplication

* Address feedback
2020-03-31 19:16:36 -04:00
Fernando Sahmkow b03c0536ce
Merge pull request #3561 from ReinUsesLisp/f2f-conversion
shader/conversion: Fix F2F rounding operations with different sizes
2020-03-31 14:45:02 -04:00
Fernando Sahmkow 5b95a01463
Merge pull request #3577 from ReinUsesLisp/lea
shader/lea: Fix LEA implementation
2020-03-31 14:36:07 -04:00
ReinUsesLisp 1c5e2b60a7 gl_rasterizer: Mark cleared textures as dirty
Fixes a potential edge case where cleared textures read from the CPU
were not flushed.
2020-03-31 05:51:56 -03:00
Rodrigo Locatti c19425ed69
Merge pull request #3506 from namkazt/patch-9
shader_decode: Implement partial ATOM/ATOMS instr
2020-03-31 00:56:28 -03:00
Nguyen Dac Nam 238c35b2c9
clang-format 2020-03-31 08:08:06 +07:00
Nguyen Dac Nam defb9642da
shader_decode: fix by suggestion 2020-03-31 08:02:44 +07:00
Rodrigo Locatti 69728e8ad5
Merge pull request #3566 from ReinUsesLisp/vk-wrapper-part1
renderer_vulkan/wrapper: Add a Vulkan wrapper (part 1 of 2)
2020-03-30 21:57:36 -03:00
bunnei 4c72190a06
Merge pull request #3560 from ReinUsesLisp/fix-stencil
gl_rasterizer: Synchronize stencil testing on clears
2020-03-30 17:03:07 -04:00
James Rowe f1da3ec584 Frontend: Don't call DoneCurrent if the context isnt already current 2020-03-30 14:57:42 -06:00
namkazy cb0a4151f8 clang-format 2020-03-30 20:46:21 +07:00
namkazy c2665ec9c2 gl_decompiler: min/max op not implement yet 2020-03-30 18:48:22 +07:00
namkazy 4f7bea403a shader_decode: ATOM/ATOMS: add function to avoid code repetition 2020-03-30 18:47:50 +07:00
namkazy c8f6d9effd shader_decode: merge GlobalAtomicOp to AtomicOp 2020-03-30 18:47:00 +07:00
Nguyen Dac Nam 972485ff18 shader_decode: implement ATOM operation for S32 and U32 2020-03-30 17:44:48 +07:00
namkazy 93cac0d294 clang-format 2020-03-30 17:44:48 +07:00
Nguyen Dac Nam 3dc09a6250 shader_decode: implement ATOMS instr partial. 2020-03-30 17:44:46 +07:00
Nguyen Dac Nam a2cc80b605 vk_decompiler: add atomic op and handler function. 2020-03-30 17:44:45 +07:00
Nguyen Dac Nam 552f0ff267 gl_decompiler: add atomic op 2020-03-30 17:44:45 +07:00
Nguyen Dac Nam 2c780db5b9 shader: node - update correct comment 2020-03-30 17:44:44 +07:00
Nguyen Dac Nam c119473c40 shader_decode: add Atomic op for common usage 2020-03-30 17:44:44 +07:00
Kewlan a8f3a13a1f Re-order the shoulder buttons both in the configuration menu, and in the code. 2020-03-29 14:37:23 +02:00
bunnei 2c9879d2eb
Merge pull request #3568 from bunnei/time-calcspan
services: time: Implement CalculateSpanBetween.
2020-03-29 00:03:55 -04:00
bunnei 5e2f8e30e7
Merge pull request #3545 from FearlessTobi/audren-rev
audio_core: Accept Audren REV8
2020-03-28 22:08:19 -04:00
ReinUsesLisp 08470d261d shader_bytecode: Fix I2I_IMM encoding 2020-03-28 18:49:07 -03:00
bunnei ffe1e2b5ec
Merge pull request #3562 from perillamint/vrsvc
am: Implement VR related APIs
2020-03-28 13:32:52 -04:00
bunnei 997a802bd6
Merge pull request #3569 from bunnei/hid-stub
services: hid: Stub InitializeSevenSixAxisSensor.
2020-03-28 04:10:45 -04:00
ReinUsesLisp b6c9fba81c renderer_vulkan/wrapper: Address feedback 2020-03-28 04:09:02 -03:00
ReinUsesLisp 5300a918c6 shader/lea: Simplify generated LEA code 2020-03-28 03:55:04 -03:00
bunnei 75795a9a63
Merge pull request #3573 from FearlessTobi/port-5089
Port citra-emu/citra#5089: "Set render window's focus policy to Qt::StrongFocus"
2020-03-28 01:48:46 -04:00
FearlessTobi 8ba06aa4e1 yuzu: fix the stuck in fullscreen mode bug
Co-Authored-By: Valentin Vanelslande <vvanelslandedev@gmail.com>
2020-03-28 02:31:35 +01:00
ReinUsesLisp 523a709bf1 shader/lea: Fix op_a and op_b usages
They were swapped.
2020-03-27 18:37:20 -03:00
ReinUsesLisp 796b3319e6 shader/lea: Remove const and use move when possible 2020-03-27 18:36:38 -03:00
Vitor K 10ba8d16be Set render window to also accept focus via tabbing (Qt::StrongFocus) (#5089) 2020-03-27 22:25:01 +01:00
Fernando Sahmkow 7a2f60df26
Merge pull request #3565 from ReinUsesLisp/image-format
engines/const_buffer_engine_interface: Store image format and types
2020-03-27 14:08:54 -04:00
bunnei 8a6a25e4b6 services: hid: Stub InitializeSevenSixAxisSensor.
- Used by Super Smash Bros. Ultimate v7.0.0.
2020-03-27 10:48:01 -04:00
bunnei a60f34a850 services: time: Implement CalculateSpanBetween.
- Used by Super Smash Bros. Ultimate.
2020-03-27 10:42:13 -04:00
perillamint a429644672 am: Implement VR related APIs
Implement (and stub) VR related APIs in AM sysmodule.

This fixes issue #2938
2020-03-27 18:22:28 +09:00
ReinUsesLisp 2694552b7f renderer_vulkan/wrapper: Add owning handles 2020-03-27 03:21:04 -03:00
ReinUsesLisp 7413b30923 renderer_vulkan/wrapper: Add pool allocations owning templated class 2020-03-27 03:21:04 -03:00
ReinUsesLisp d8d392b39a renderer_vulkan/wrapper: Add owning handle templated class 2020-03-27 03:21:04 -03:00
ReinUsesLisp 60f351084a renderer_vulkan/wrapper: Add destroy and free overload set 2020-03-27 03:21:04 -03:00
ReinUsesLisp a9e4528d10 renderer_vulkan/wrapper: Add dispatch table and loaders 2020-03-27 03:21:04 -03:00
ReinUsesLisp 3f0b7673f0 renderer_vulkan/wrapper: Add exception class 2020-03-27 03:21:04 -03:00
ReinUsesLisp f5cee0e885 renderer_vulkan/wrapper: Add ToString function for VkResult 2020-03-27 03:21:03 -03:00
ReinUsesLisp 92c8d783b3 renderer_vulkan/wrapper: Add Vulakn wrapper and a span helper
The intention behind a Vulkan wrapper is to drop Vulkan-Hpp.

The issues with Vulkan-Hpp are:
- Regular breaks of the API.
- Copy constructors that do the same as the aggregates (fixed recently)
- External dynamic dispatch that is hard to remove
- Alias KHR handles with non-KHR handles making it impossible to use
smart handles on Vulkan 1.0 instances with extensions that were included
on Vulkan 1.1.
- Dynamic dispatchers silently change size depending on preprocessor
definitions. Different files will have different dispatch definitions,
generating all kinds of hard to debug memory issues.

In other words, Vulkan-Hpp is not "production ready" for our needs and
this wrapper aims to replace it without losing RAII and exception
safety.
2020-03-27 03:13:18 -03:00
ReinUsesLisp cedbe925cd engines/const_buffer_engine_interface: Store image format type
This information is required to properly implement SULD.B. It might also
be handy for all image operations, since it would allow us to implement
them on devices that require the image format to be specified (on
desktop, this would be AMD on OpenGL and Intel on OpenGL and Vulkan).
2020-03-27 00:36:22 -03:00
Dan 744b207d92 maxwell_to_vk: implement signedscaled vertex formats 2020-03-27 00:14:19 +01:00
bunnei 950b6dbc80
Merge pull request #3453 from FearlessTobi/remove-pause-lock
yuzu: Remove exit lock for game pausing
2020-03-26 16:42:57 -04:00
bunnei 5228bd0bb9 services: ldr: Fix MemoryState for read/write regions of NROs.
- Fixes #3541, used by Final Fantasy VIII Remastered.
2020-03-26 15:52:59 -04:00
James Rowe cf9c94d401 Address review and fix broken yuzu-tester build 2020-03-25 23:32:42 -06:00
ReinUsesLisp 46791c464a shader/conversion: Fix F2F rounding operations with different sizes
Rounding operations only matter when the conversion size of source and
destination is the same, i.e. .F16.F16, .F32.F32 and .F64.F64.

When there is a mismatch (.F16.F32), these bits are used for IEEE
rounding, we don't emulate this because GLSL and SPIR-V don't support
configuring it per operation.
2020-03-26 01:58:49 -03:00
ReinUsesLisp 7617e88fb2 gl_rasterizer: Update stencil test regardless of it being disabled 2020-03-26 01:08:14 -03:00
ReinUsesLisp c310cef615 gl_rasterizer: Synchronize stencil testing on clears 2020-03-26 00:51:47 -03:00
bunnei 23c7dda710
Merge pull request #3544 from makigumo/myfork/patch-2
xmad: fix clang build error
2020-03-25 19:29:16 -04:00
bunnei e6aff11057
Merge pull request #3520 from ReinUsesLisp/legacy-varyings
gl_shader_decompiler: Implement legacy varyings
2020-03-25 19:27:51 -04:00
James Rowe 282adfc70b Frontend/GPU: Refactor context management
Changes the GraphicsContext to be managed by the GPU core. This
eliminates the need for the frontends to fool around with tricky
MakeCurrent/DoneCurrent calls that are dependent on the settings (such
as async gpu option).

This also refactors out the need to use QWidget::fromWindowContainer as
that caused issues with focus and input handling. Now we use a regular
QWidget and just access the native windowHandle() directly.

Another change is removing the debug tool setting in FrameMailbox.
Instead of trying to block the frontend until a new frame is ready, the
core will now take over presentation and draw directly to the window if
the renderer detects that its hooked by NSight or RenderDoc

Lastly, since it was in the way, I removed ScopeAcquireWindowContext and
replaced it with a simple subclass in GraphicsContext that achieves the
same result
2020-03-24 21:03:42 -06:00
bunnei f8382c9d9d
Merge pull request #3524 from FearlessTobi/port-5106
Port citra-emu/citra#5106: "gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization"
2020-03-24 16:50:58 -04:00
Fernando Sahmkow 497f593525
Merge pull request #3543 from ReinUsesLisp/gl-depth-range
gl_rasterizer: Use transformed viewport for depth ranges
2020-03-23 12:00:21 -04:00
Fernando Sahmkow 7981910746
Merge pull request #3542 from namkazt/patch-10
Implement MME shadow RAM
2020-03-23 12:00:01 -04:00
FearlessTobi 4afebf26b6 sm/controller: Increase PointerBufferSize
This increases the PointerBufferSize as a lager one is required by some services.
This change is still not hw-accurate, but it is proven to work in Ryujinx.

Instead of using a hardcoded size, we should figure out the specific values for each service in the future. Some of them can be taken from Atmosphere: https://github.com/Atmosphere-NX/Atmosphere/search?q=PointerBufferSize.
2020-03-23 03:19:30 +01:00
FearlessTobi 5d3b228409 audio_core: Accept Audren REV8
According to Ryujinx, REV8 only added changes on Performance buffer and Wavebuffer DSP command generation.

As we don't support any of those, we can just increment the revision number for now.
2020-03-23 03:07:14 +01:00
makigumo 5a5c6d4ed8 xmad: fix clang build error 2020-03-23 00:09:31 +01:00
bunnei e731c4b991
Merge pull request #3477 from FearlessTobi/webapplet-shit
core/web_browser: Allow WebApplet to exit gracefully when an error occurs
2020-03-22 13:11:02 -04:00
namkazy fc37672f26 apply replay logic to all writes. remove replay from MacroInterpreter::Send (@fincs) 2020-03-22 22:25:44 +07:00
FearlessTobi 977418c65b core/web_browser: Allow WebApplet to exit gracefully when an error occurs
Currently, yuzu just freezes when an error occurs while Initializing the WebApplet.
From a user perspective, this obviously isn't great as the game just softlocks.
With this change, yuzu will call the Finalize method, so to the game it seems like as the user just exited the WebApplet normally.

This works around https://github.com/yuzu-emu/yuzu/issues/2852.
2020-03-22 16:01:13 +01:00
namkazy f66743cd0c maxwell_3d: change declaration order 2020-03-22 13:41:16 +07:00
namkazy d4e93cf38c maxwell_3d: init shadow_state 2020-03-22 13:35:11 +07:00
ReinUsesLisp bdcedc8506 gl_rasterizer: Use transformed viewport for depth ranges
Implement depth ranges using the transformed viewport instead of the
generic one. This matches the current Vulkan implementation but doesn't
support negative depth ranges. An update to glad is required for this.
2020-03-22 03:26:07 -03:00
namkazy 22f4268c2f maxwell_3d: this seem more correct. 2020-03-22 12:02:54 +07:00
namkazy 7051dc1902 maxwell_3d: update comments for shadow ram usage 2020-03-22 11:35:26 +07:00
Nguyen Dac Nam 01af036c1f marco_interpreter: write hw value when shadow ram requested 2020-03-22 10:53:41 +07:00
Nguyen Dac Nam 63c2635e6f maxwell_3d: track shadow ram ctrl and hw reg value 2020-03-22 10:53:41 +07:00
Nguyen Dac Nam dbfbe352e0 maxwell_3d: implement MME shadow RAM 2020-03-22 10:53:35 +07:00
bunnei e5bb5d13c4
Merge pull request #3531 from makigumo/yuzu_master
set: implement GetRegionCode
2020-03-21 22:49:28 -04:00
bunnei e70451d967
Merge pull request #3525 from FearlessTobi/linux-compile-error
input_common/udp: Fix Linux build by using a backwards compatible way of error checking
2020-03-21 16:04:45 -04:00
bunnei 81fa492825
Merge pull request #3526 from FearlessTobi/bcat-disable
bcat: Disable Boxcat backend by default
2020-03-20 13:01:28 -04:00
bunnei bdddbe2daa
Merge pull request #3505 from namkazt/patch-8
shader_decode: implement XMAD mode CSfu
2020-03-19 17:41:01 -04:00
Dan 06dea163fa set: implement GetRegionCode 2020-03-19 10:37:42 +01:00
bunnei bc681dc555
Merge pull request #3527 from FearlessTobi/output-mode
yuzu: Save sound output mode and set it to Stereo by default
2020-03-18 23:19:22 -04:00
Mat M 9418b983bd
Merge pull request #3535 from ReinUsesLisp/gcc-warnings
video_core: Silence misc warnings
2020-03-18 20:09:32 -04:00
ReinUsesLisp 38c1e77f01 vk_texture_cache: Silence misc warnings 2020-03-18 20:03:19 -03:00
ReinUsesLisp b6b2e31e5e vk_staging_buffer_pool: Silence unused constant warning 2020-03-18 20:03:19 -03:00
ReinUsesLisp fc51ece7bf vk_rasterizer: Remove unused variable 2020-03-18 20:03:19 -03:00
ReinUsesLisp 98d85cdc20 vk_pipeline_cache: Remove unused variable 2020-03-18 20:03:19 -03:00
ReinUsesLisp dab450ec46 maxwell_to_vk: Sielence -Wswitch warning 2020-03-18 20:03:19 -03:00
ReinUsesLisp 351816ac38 gl_shader_decompiler: Remove deprecated function and its usages 2020-03-18 20:03:19 -03:00
ReinUsesLisp acf328a71f gl_rasterizer: Silence misc warnings 2020-03-18 20:03:19 -03:00
ReinUsesLisp 9f46066bda kepler_compute: Remove unused variables 2020-03-18 20:03:19 -03:00
ReinUsesLisp ac7ee21331 time_zone_content_manager: Fix out of bounds read
There were cases where raw_data didn't contain enough
space to hold the zero terminator.

This was caught with -fsanitize=address.
2020-03-18 19:06:16 -03:00
ReinUsesLisp 716d6aee30 input_common/udp: Fix clang build issues 2020-03-18 04:30:26 -03:00
ReinUsesLisp 664fa4ea06 astc: Fix clang build issues 2020-03-18 04:30:25 -03:00
ReinUsesLisp f5658a9fda gl_shader_decompiler: Don't redeclare gl_VertexID and gl_InstanceID 2020-03-18 01:28:41 -03:00
Mat M edb9cccb36
Merge pull request #3510 from FernandoS27/dirty-write
DirtyFlags: relax need to set render_targets as dirty
2020-03-17 17:29:22 -04:00
Mat M f54d2d3114
Merge pull request #3509 from ReinUsesLisp/astc-opts
astc: General changes and optimizations
2020-03-17 17:28:49 -04:00
Mat M d787856621
Merge pull request #3518 from ReinUsesLisp/scissor-clears
vk_rasterizer: Implement scissor clears and layered clears
2020-03-17 17:27:15 -04:00
Mat M 9fdfd58f9f
Merge pull request #3519 from ReinUsesLisp/int-formats
maxwell_to_vk: Implement RG32 and RGB32 integer vertex formats
2020-03-17 17:26:16 -04:00
FearlessTobi cdeadd448b yuzu: Save sound output mode and set it to Stereo by default 2020-03-17 19:03:00 +01:00
bunnei 1c45c8086e
Merge pull request #3498 from ReinUsesLisp/texel-fetch-glsl
gl_shader_decompiler: Add layer component to texelFetch
2020-03-17 10:53:38 -04:00
FearlessTobi 2fd3b328ae bcat: Disable Boxcat backend by default
This commit disables the Boxcat backend by default for new users of yuzu.

There's several reasons as to why this is done:
1. Boxcat currently only actually has an impact on 3 games and doesn't influence any core mechanics of them
2. It causes a plethora of issues when enabled such as games like Crash Team Racing, Diablo 3 and Tales of Vesperia not booting at all or hanging
3. It causes https://github.com/yuzu-emu/yuzu/issues/2957 to happen. This makes the configuration menu totally unusable for many Linux users of yuzu

I think those points show that currently the negative impact of Boxcat outweighs its benefits and should therefore be disabled by default.
For users who are eager to use the extra features provided by it, they can still just turn it on in the settings.
2020-03-17 15:24:26 +01:00
FearlessTobi 230ac6a4e8 input_common/udp: Fix Linux build by using a backwards compatible way of error checking
Should fix https://github.com/yuzu-emu/yuzu/issues/3487.

error_code::failed is a function which has been introduced in Boost 1.69.
This version of boost hasn't landed in most major distros yet.
2020-03-17 12:29:25 +01:00
Gauvain "GovanifY" Roussel-Tarbouriech eae2ed6b07 gdbstub: small logic bug fix with defer_start 2020-03-17 11:18:39 +01:00
Gauvain "GovanifY" Roussel-Tarbouriech 38036eb1c8 gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization 2020-03-17 11:18:13 +01:00
ReinUsesLisp 53d673a7d3 renderer_opengl: Move some logic to an anonymous namespace 2020-03-16 04:03:34 -03:00
ReinUsesLisp 311d2fc768 renderer_opengl: Detect Nvidia Nsight as a debugging tool
Use getenv to detect Nsight.
2020-03-16 03:59:08 -03:00
Rodrigo Locatti b16c8e0e8d
Merge pull request #3515 from ReinUsesLisp/vertex-vk-assert
vk_rasterizer: Fix vertex range assert
2020-03-15 21:26:54 -03:00
Rodrigo Locatti 7cc46a6faa
Merge pull request #3501 from ReinUsesLisp/rgba16-snorm
video_core: Implement RGBA16_SNORM
2020-03-15 21:24:53 -03:00
Rodrigo Locatti ddafc99776
Merge pull request #3502 from namkazt/patch-3
shader_decode: Reimplement BFE instructions
2020-03-15 21:23:04 -03:00
Rodrigo Locatti d64edf21bb
Merge pull request #3503 from makigumo/patch-2
maxwell_to_vk: add vertex format eA2B10G10R10UnormPack32
2020-03-15 21:21:38 -03:00
ReinUsesLisp 5afc397d52 gl_shader_decompiler: Implement legacy varyings
Legacy varyings are special attributes carried over in hardware from
the OpenGL 1 and OpenGL 2 days. These were generally used instead of the
generic attributes we use today. They are deprecated or removed from
most APIs, but Nvidia still ships them in hardware.

To implement these, this commit maps them 1:1 to OpenGL compatibility.
2020-03-15 21:03:59 -03:00
ReinUsesLisp 6442e02c5d shader/shader_ir: Track usage in input attribute and of legacy varyings 2020-03-15 21:01:52 -03:00
ReinUsesLisp 8e6e55d6f8 shader/shader_ir: Fix clip distance usage stores 2020-03-15 20:53:14 -03:00
ReinUsesLisp 464bd5fad7 shader/shader_ir: Change declare output attribute to a switch 2020-03-15 20:49:35 -03:00
Rodrigo Locatti 86b1f15d9a
Merge pull request #3512 from bunnei/fix-renderdoc
renderer_opengl: Keep frames synchronized when using a GPU debugger.
2020-03-15 19:28:43 -03:00
ReinUsesLisp 52acb7f9a0 maxwell_to_vk: Implement RG32 and RGB32 integer vertex formats 2020-03-15 18:51:49 -03:00
ReinUsesLisp 71cc772988 vk_rasterizer: Implement layered clears 2020-03-15 18:37:19 -03:00
makigumo f91046bf8d
vk_shader_decompiler: fix linux build 2020-03-15 18:00:14 +01:00
ReinUsesLisp a7131af7d6 vk_rasterizer: Fix vertex range assert
End can be equal to start in CalculateVertexArraysSize. This is quite
common when the vertex size is zero.
2020-03-15 04:04:17 -03:00
ReinUsesLisp 8baf98e439 vk_rasterizer: Reimplement clears with vkCmdClearAttachments 2020-03-15 03:40:41 -03:00
bunnei c5afe93dcc renderer_opengl: Keep presentation frames in lock-step when GPU debugging.
- Fixes renderdoc with OpenGL renderer.
2020-03-14 17:45:01 -04:00
bunnei 4373fa8042 gl_device: Add option to check GL_EXT_debug_tool. 2020-03-14 17:39:29 -04:00
bunnei 4dfd5c84ea
Merge pull request #3508 from FernandoS27/page-table
PageTable: move backing addresses to a children class as the CPU page table does not need them.
2020-03-14 16:50:27 -04:00
Fernando Sahmkow 380fc8d2e1 DirtyFlags: relax need to set render_targets as dirty
The texture cache already takes care of setting a render target to dirty 
when invalidated.
2020-03-14 11:47:33 -04:00
Fernando Sahmkow c51dbf8038
Merge pull request #3500 from ReinUsesLisp/incompatible-types
texture_cache: Report incompatible textures as black
2020-03-14 09:49:05 -04:00
Fernando Sahmkow 41905ee467
Merge pull request #3499 from ReinUsesLisp/depth-2d-array
texture_cache/surface_params: Force depth=1 on 2D textures
2020-03-14 09:48:39 -04:00
Fernando Sahmkow 27cbb75e7c PageTable: move backing addresses to a children class as the CPU page table does not need them.
This PR aims to reduce the memory usage in the CPU page table by moving
GPU specific parameters into a child class. This saves 1Gb of Memory for
most games.
2020-03-14 09:43:57 -04:00
ReinUsesLisp 42cb8f1124 astc: Fix typos from search and replace 2020-03-14 01:05:20 -03:00
ReinUsesLisp 9b8fb3c756 astc: Minor changes to InputBitStream 2020-03-14 00:45:54 -03:00
ReinUsesLisp d71d7d917e astc: Pass val in Replicate by copy 2020-03-14 00:13:58 -03:00
ReinUsesLisp 134f3ff9b4 astc: Call std::vector:reserve on decodedClolorValues to avoid reallocating 2020-03-14 00:09:56 -03:00
Nguyen Dac Nam 3287b1247d
clang-format 2020-03-14 10:07:40 +07:00
Nguyen Dac Nam 240d45830d
nit 2020-03-14 09:57:24 +07:00
ReinUsesLisp 3377b78ea7 astc: Call std::vector::reserve on texelWeightValues to avoid reallocating 2020-03-13 23:52:51 -03:00
ReinUsesLisp 801fd04f75 astc: Create a LUT at compile time for encoding values 2020-03-13 23:40:02 -03:00
ReinUsesLisp e183820956 astc: Make IntegerEncodedValue a trivial structure 2020-03-13 22:49:28 -03:00
ReinUsesLisp 70a31eda62 astc: Make IntegerEncodedValue constructor constexpr 2020-03-13 22:36:45 -03:00
ReinUsesLisp 5ed377b989 astc: Make IntegerEncodedValue trivially copyable 2020-03-13 22:30:31 -03:00
ReinUsesLisp e7d97605e8 astc: Rename C types to common_types 2020-03-13 22:28:51 -03:00
ReinUsesLisp 835a3d09c6 astc: Move Popcnt to an anonymous namespace and make it constexpr 2020-03-13 22:26:48 -03:00
ReinUsesLisp 731a9a322e astc: Use common types instead of stdint.h integer types 2020-03-13 22:22:27 -03:00
ReinUsesLisp d3dc4e399c astc: Use 'enum class' instead of 'enum' for EIntegerEncoding 2020-03-13 22:20:12 -03:00
ReinUsesLisp 69c7a01f88 vk/gl_shader_decompiler: Silence assertion on compute 2020-03-13 18:33:05 -03:00
ReinUsesLisp 62560f1e63 vk_shader_decompiler: Fix default varying regression 2020-03-13 18:33:05 -03:00
ReinUsesLisp afebdda203 maxwell_3d: Add padding words to XFB entries
Use INSERT_UNION_PADDING_WORDS instead of alignas to ensure a size
requirement.
2020-03-13 18:33:05 -03:00
ReinUsesLisp 4bc4851d45 gl_shader_decompiler: Fix implicit conversion errors 2020-03-13 18:33:05 -03:00
Rodrigo Locatti 47459f6a36 vk_shader_decompiler: Fix implicit type conversion
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-13 18:33:05 -03:00
ReinUsesLisp 2fae1e6205 vk_rasterizer: Implement transform feedback binding zero 2020-03-13 18:33:05 -03:00
ReinUsesLisp b67360c0f8 vk_shader_decompiler: Add XFB decorations to generic varyings 2020-03-13 18:33:05 -03:00
ReinUsesLisp 8d5bdcb17b vk_device: Enable VK_EXT_transform_feedback when available 2020-03-13 18:33:05 -03:00
ReinUsesLisp c320702092 vk_device: Shrink formatless capability name size 2020-03-13 18:33:05 -03:00
ReinUsesLisp ae6189d7c2 shader/transform_feedback: Expose buffer stride 2020-03-13 18:33:05 -03:00
ReinUsesLisp 7acebd7eb6 vk_shader_decompiler: Use registry for specialization 2020-03-13 18:33:05 -03:00
ReinUsesLisp 8e9f23f393 gl_rasterizer: Implement transform feedback bindings 2020-03-13 18:33:04 -03:00
ReinUsesLisp 4d711dface gl_shader_decompiler: Decorate output attributes with XFB layout
We sometimes have to slice attributes in different parts. This is needed
for example in instances where the game feedbacks 3 components but
writes 4 from the shader (something that is possible with
GL_NV_transform_feedback).
2020-03-13 18:33:04 -03:00
ReinUsesLisp 3dcaa84ba4 shader/transform_feedback: Add host API friendly TFB builder 2020-03-13 18:33:04 -03:00
Rodrigo Locatti 244fe13219
Merge branch 'master' into shader-purge 2020-03-13 16:44:06 -03:00
bunnei b30b1f741d
Merge pull request #3491 from ReinUsesLisp/polygon-modes
gl_rasterizer: Implement polygon modes and fill rectangles
2020-03-13 10:08:57 -04:00
Nguyen Dac Nam 829f424618
nit & remove some optional param 2020-03-13 20:47:38 +07:00
Nguyen Dac Nam a166217480
shader_decode: implement XMAD mode CSfu 2020-03-13 19:01:49 +07:00
makigumo 753bc2026f
fix formatting 2020-03-13 11:37:24 +01:00
makigumo 54681909be
maxwell_to_vk: add vertex format eA2B10G10R10UnormPack32 2020-03-13 11:26:13 +01:00
Nguyen Dac Nam 00607fe1e0
clang-format 2020-03-13 15:38:57 +07:00
Nguyen Dac Nam 325977c0c6
Apply suggestions from code review
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-13 15:35:15 +07:00
Nguyen Dac Nam 70ff82f72d
shader_decode: BFE add ref of reverse parallel method. 2020-03-13 14:20:18 +07:00
Nguyen Dac Nam 96a4abe12d
shader_decode: implement BREV on BFE
Implement reverse parallel follow: https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel
2020-03-13 14:13:31 +07:00
Nguyen Dac Nam 93547cac68
shader_bytecode: update BFE instructions struct. 2020-03-13 12:52:16 +07:00
Nguyen Dac Nam 911c56ccef
node_helper: add IBitfieldExtract case 2020-03-13 12:50:32 +07:00
Nguyen Dac Nam 465ba30d08
shader_decode: Reimplement BFE instructions 2020-03-13 12:48:01 +07:00
ReinUsesLisp e24197bb3f gl_shader_decompiler: Initialize gl_Position on vertex shaders 2020-03-12 23:31:06 -03:00
Fernando Sahmkow 00e9ba0603
Merge pull request #3483 from namkazt/patch-1
vk_rasterizer: fix mistype on SetupGraphicsImages
2020-03-12 22:10:48 -04:00
Fernando Sahmkow f159a12820
Merge pull request #3480 from ReinUsesLisp/vk-disabled-ubo
vk_rasterizer: Support disabled uniform buffers
2020-03-12 22:09:49 -04:00
ReinUsesLisp 3a10016e38 gl_shader_decompiler: Add missing {} on smem GLSL emission 2020-03-12 21:50:37 -03:00
ReinUsesLisp 4dcca90ef4 video_core: Implement RGBA16_SNORM
Implement RGBA16_SNORM with the current API. Nothing special here.
2020-03-12 21:42:33 -03:00
ReinUsesLisp e22816a5bb texture_cache: Report incompatible textures as black
Some games bind incompatible texture types to certain types.
For example Astral Chain binds a 2D texture with 1 layer (non-array) to
a cubemap slot (that's how it's used in the shader). After testing this
in hardware, the expected "undefined behavior" is to report all pixels
as black.

We already have a path for reporting black textures in the texture
cache. When textures types are incompatible, this commit binds these
kind of textures. This is done on the API agnostic texture cache so no
extra code has to be inserted on OpenGL or Vulkan.

As a side effect, this fixes invalidations of ASTC textures on Astral
Chain. This happened because yuzu detected a cube texture and forced
6 faces, generating a texture larger than what the TIC reported.
2020-03-12 18:22:05 -03:00
ReinUsesLisp daae6a323b texture_cache/surface_params: Force depth=1 on 2D textures
Sometimes games will sample a 2D array TIC with a 2D access in the
shader. This causes bad interactions with the rest of the texture cache.
To emulate what the game wants to do, force a depth=1 on 2D textures
(not 2D arrays) and let the texture cache handle the rest.
2020-03-12 18:11:42 -03:00
ReinUsesLisp 38fe070d78 gl_shader_decompiler: Add layer component to texelFetch
TexelFetch was not emitting the array component generating invalid GLSL.
2020-03-12 18:10:29 -03:00
bunnei ca2d228c9d
Merge pull request #3497 from FernandoS27/microprogfile-extend
Small corrections and features to microprofile
2020-03-12 12:14:03 -04:00
bunnei c21dc36cda
Merge pull request #3496 from vitor-k/remove-enum
framebuffer_layout.h: drop the use of enum for screen dimensions
2020-03-12 12:00:39 -04:00
Fernando Sahmkow 95b804ff05 NVFlinger: Do the microprofile Flip after processing a valid frame. 2020-03-12 10:52:44 -04:00
ReinUsesLisp 825d629565 gl_shader_decompiler: Fix regression in render target declarations
A previous commit introduced a way to declare as few render targets as
possible. Turns out this introduced a regression in some games.
2020-03-12 05:01:20 -03:00
bunnei fce33adcf1
Merge pull request #3494 from ReinUsesLisp/fix-cs-pipeline
gl_shader_manager: Fix interaction between graphics and compute
2020-03-11 13:51:54 -04:00
Vitor Kiguchi e891ff9a0c framebuffer_layout.h: drop the use of enum for screen dimensions.
+clang format
2020-03-11 14:22:28 -03:00
ReinUsesLisp 8357908099 gl_shader_manager: Fix interaction between graphics and compute
After a compute shader was set to the pipeline, no graphics shader was
invoked again. To address this use glUseProgram to bind compute shaders
(without state tracking) and call glUseProgram(0) when transitioning out
of it back to the graphics pipeline.
2020-03-11 01:04:52 -03:00
bunnei 503ebe9b96
Merge pull request #3458 from FearlessTobi/voice-issues
cubeb_sink: Don't discard other channels when performing downmixing
2020-03-10 22:18:37 -04:00
ReinUsesLisp e4bc3c3342 gl_rasterizer: Implement polygon modes and fill rectangles 2020-03-09 20:39:58 -03:00
ReinUsesLisp eb5861e0a2 engines/maxwell_3d: Add TFB registers and store them in shader registry 2020-03-09 18:40:53 -03:00
ReinUsesLisp b1acb4f73f shader/registry: Address feedback 2020-03-09 18:40:53 -03:00
ReinUsesLisp b1061afed9 gl_shader_decompiler: Add identifier to decompiled code 2020-03-09 18:40:53 -03:00
ReinUsesLisp e612242977 gl_shader_decompiler: Roll back to GLSL core 430
RenderDoc won't build shaders if we use GLSL compatibility.
2020-03-09 18:40:53 -03:00
ReinUsesLisp 978172530e const_buffer_engine_interface: Store component types
This is required for Vulkan. Sampling integer textures with float
handles is illegal.
2020-03-09 18:40:53 -03:00
ReinUsesLisp 120f688272 yuzu/loading_screen: Remove unused shader progress mode 2020-03-09 18:40:53 -03:00
ReinUsesLisp e1932351a9 gl_shader_cache: Reduce registry consistency to debug assert
Registry consistency is something that practically can't happen and it
has a measurable runtime cost. Reduce it to a DEBUG_ASSERT.
2020-03-09 18:40:07 -03:00
ReinUsesLisp 66a8a3e887 shader/registry: Cache tessellation state 2020-03-09 18:40:07 -03:00
ReinUsesLisp 0528be5c92 shader/registry: Store graphics and compute metadata
Store information GLSL forces us to provide but it's dynamic state in
hardware (workgroup sizes, primitive topology, shared memory size).
2020-03-09 18:40:07 -03:00
ReinUsesLisp e8efd5a901 video_core: Rename "const buffer locker" to "registry" 2020-03-09 18:40:06 -03:00
ReinUsesLisp bd8b9bbcee gl_shader_cache: Rework shader cache and remove post-specializations
Instead of pre-specializing shaders and then post-specializing them,
drop the later and only "specialize" the shader while decoding it.
2020-03-09 18:40:06 -03:00
Rodrigo Locatti 22e825a3bc
Merge pull request #3301 from ReinUsesLisp/state-tracker
video_core: Remove gl_state and use a state tracker based on dirty flags
2020-03-09 18:34:37 -03:00
ReinUsesLisp 1aa75b1081 textures: Fix anisotropy hack
Previous code could generate an anisotropy value way higher than x16.
2020-03-08 15:59:38 -03:00
FearlessTobi 59d0d34dce cubeb_sink: Don't discard other channels when performing downmixing
Previously, when performing downmixing, we would discard all channels except the left and right one.
This implementation respects them when mixing down to Stereo.
It is taken from this document: http://www.atsc.org/wp-content/uploads/2015/03/A52-201212-17.pdf.

Fixes Luigis Mansion 3 cutscene and Bayonetta audio.
2020-03-08 03:16:06 -04:00
bunnei 84e9f9f395
Merge pull request #3452 from Morph1984/anisotropic-filtering
frontend/Graphics: Add "Advanced" graphics tab and experimental Anisotropic Filtering support
2020-03-07 22:28:35 -05:00
Nguyen Dac Nam 16cfbb068c
vk_reasterizer: fix mistype on SetupGraphicsImages
This should use Maxwell3D engine. Fixed some GPU error on Kirby and maybe other games.
2020-03-08 10:06:59 +07:00
bunnei 662feb8c1c
Merge pull request #3481 from ReinUsesLisp/abgr5-storage
maxwell_to_vk: Remove Storage capability for A1B5G5R5U
2020-03-07 19:51:33 -05:00
ReinUsesLisp e4f9ce0379 vk_rasterizer: Support disabled uniform buffers 2020-03-06 18:47:51 -03:00
ReinUsesLisp aa6fe3f1aa maxwell_to_vk: Remove Storage capability for A1B5G5R5U 2020-03-06 18:47:27 -03:00
bunnei 49eff536d0
Merge pull request #3463 from ReinUsesLisp/vk-toctou
vk_swapchain: Silence TOCTOU race condition
2020-03-05 19:38:42 -05:00
bunnei 4a8fe67964
Merge pull request #3479 from jroweboy/dont-log-on-no-input
Minor fixes for udp input
2020-03-05 15:09:48 -05:00
bunnei 0361aa1915
Merge pull request #3451 from ReinUsesLisp/indexed-textures
vk_shader_decompiler: Implement indexed textures
2020-03-05 11:42:46 -05:00
bunnei fa1d625eed
Merge pull request #3469 from namkazt/patch-1
shader_decode: Fix LD, LDG when track constant buffer
2020-03-04 23:10:01 -05:00
bunnei 1e84d22275
Merge pull request #3478 from bunnei/a32
Refactoring to boot A32 games
2020-03-04 20:37:51 -05:00
James Rowe 002d9508a0 input/udp - Add minor error handling to prevent bad input from crashing 2020-03-03 23:46:05 -07:00
bunnei 67e7186d79
Merge pull request #3455 from ReinUsesLisp/attr-scaled
video_core: Implement more scaled attribute formats
2020-03-03 22:46:20 -05:00
James Rowe fc205a1bc5 Frontend/SDL - Provide proper default for UDP input
When the default file is read in, the settings default value is only used
when the key is missing. As it was, the key existed, but the value was empty string
causing it to accept that as a value to pass into the core
2020-03-03 20:05:42 -07:00
James Rowe 2cdda8c564 input/udp - Dont log on invalid packet received 2020-03-03 19:52:16 -07:00
bunnei dba112e510 core: hle: Implement separate A32/A64 SVC interfaces. 2020-03-02 21:52:03 -05:00
bunnei c083ea7d78 core: Implement separate A32/A64 ARM interfaces. 2020-03-02 21:51:57 -05:00
bunnei 6fc485a607 core: loader: Remove check for 32-bit. 2020-03-02 21:43:15 -05:00
bunnei 64facb403e core: dynarmic: Add CP15 from Citra. 2020-03-02 21:43:15 -05:00
bunnei 08c638f249
Merge pull request #3464 from FernandoS27/jit-fix
ARM_Interface: Cache the JITs instead of deleting/recreating.
2020-03-02 21:41:43 -05:00
Nguyen Dac Nam 85a4222a8c
nit: move comment to right place. 2020-02-29 13:50:10 +07:00
bunnei ca7618684c
Merge pull request #3448 from bunnei/fix-audio-interp-2
audio_core: interpolate: Improvements to fix audio crackling.
2020-02-28 16:07:10 -05:00
ReinUsesLisp 735c003a70 video_core/dirty_flags: Address feedback 2020-02-28 17:56:43 -03:00
ReinUsesLisp ef7f6eb67d renderer_opengl: Fix edge-case where alpha testing might cull presentation 2020-02-28 17:56:43 -03:00
ReinUsesLisp a6a350ddc3 gl_texture_cache: Remove blending disable on blits
Blending doesn't affect blits. Rasterizer discard does, update the
commentaries.
2020-02-28 17:56:43 -03:00
ReinUsesLisp 887d5288ef gl_rasterizer: Don't disable blending on clears
Blending doesn't affect clears.
2020-02-28 17:56:43 -03:00
ReinUsesLisp ac204754d4 dirty_flags: Deduplicate code between OpenGL and Vulkan 2020-02-28 17:56:43 -03:00
ReinUsesLisp 6669b359a3 vk_rasterizer: Pass Maxwell registers to dynamic updates 2020-02-28 17:56:43 -03:00
ReinUsesLisp 042256c6bb state_tracker: Remove type traits with named structures 2020-02-28 17:56:43 -03:00
ReinUsesLisp 6ac3eb4d87 vk_state_tracker: Implement dirty flags for stencil properties 2020-02-28 17:56:43 -03:00
ReinUsesLisp f9df2c6bcd vk_state_tracker: Implement dirty flags for depth bounds 2020-02-28 17:56:43 -03:00
ReinUsesLisp cd0e28c9ec vk_state_tracker: Implement dirty flags for blend constants 2020-02-28 17:56:43 -03:00
ReinUsesLisp a33870996b vk_state_tracker: Implement dirty flags for depth bias 2020-02-28 17:56:43 -03:00
ReinUsesLisp 42f1874965 vk_state_tracker: Implement dirty flags for scissors 2020-02-28 17:56:43 -03:00
ReinUsesLisp 1bd95a314f vk_state_tracker: Initial implementation
Add support for render targets and viewports.
2020-02-28 17:56:43 -03:00
ReinUsesLisp b1498d2c54 gl_rasterizer: Remove num vertex buffers magic number 2020-02-28 17:56:43 -03:00
ReinUsesLisp 62437943a7 gl_rasterizer: Only apply polygon offset clamp if enabled 2020-02-28 17:56:43 -03:00
ReinUsesLisp 2eeea90713 gl_state_tracker: Implement dirty flags for depth clamp enabling 2020-02-28 17:56:43 -03:00
ReinUsesLisp 3ce66776ec gl_rasterizer: Disable scissor 0 when scissor is not used on clear 2020-02-28 17:56:43 -03:00
ReinUsesLisp 35bb9239ca gl_rasterizer: Notify depth mask changes on clear 2020-02-28 17:56:43 -03:00
ReinUsesLisp 98c8948b23 gl_rasterizer: Minor sort changes to clearing 2020-02-28 17:56:42 -03:00
ReinUsesLisp 15cadc3948 maxwell_3d: Use two tables instead of three for dirty flags 2020-02-28 17:56:42 -03:00
ReinUsesLisp a5bfc0d045 gl_state_tracker: Track state of index buffers 2020-02-28 17:56:42 -03:00
ReinUsesLisp a42a6e1a2c gl_state_tracker: Implement dirty flags for clip control 2020-02-28 17:56:42 -03:00
ReinUsesLisp 4f8d152b18 gl_state_tracker: Implement dirty flags for point sizes 2020-02-28 17:56:42 -03:00
ReinUsesLisp 231601763c gl_state_tracker: Implement dirty flags for fragment color clamp 2020-02-28 17:56:42 -03:00
ReinUsesLisp bf1a1d989f gl_state_tracker: Implement dirty flags for logic op 2020-02-28 17:56:42 -03:00
ReinUsesLisp 13afd0e5b0 gl_state_tracker: Implement dirty flags for sRGB 2020-02-28 17:56:42 -03:00
ReinUsesLisp d8f5c45051 gl_state_tracker: Implement dirty flags for rasterize enable 2020-02-28 17:56:42 -03:00
ReinUsesLisp b727d99441 gl_state_tracker: Implement dirty flags for multisample 2020-02-28 17:56:42 -03:00
ReinUsesLisp 3c22bd92d8 gl_state_tracker: Implement dirty flags for alpha testing 2020-02-28 17:56:42 -03:00
ReinUsesLisp 9e46953580 gl_state_tracker: Implement dirty flags for polygon offsets 2020-02-28 17:56:42 -03:00
ReinUsesLisp 46a1888e02 gl_state_tracker: Implement dirty flags for primitive restart 2020-02-28 17:56:42 -03:00
ReinUsesLisp 37536d7a49 gl_state_tracker: Implement dirty flags for stencil testing 2020-02-28 17:56:42 -03:00
ReinUsesLisp 40a2c57df5 gl_state_tracker: Implement depth dirty flags 2020-02-28 17:56:42 -03:00
ReinUsesLisp b910a83a47 gl_state_tracker: Implement dirty flags for front face and culling 2020-02-28 17:56:42 -03:00
ReinUsesLisp b01dd7d1c8 gl_state_tracker: Implement dirty flags for blending 2020-02-28 17:56:42 -03:00
ReinUsesLisp f7ec078592 gl_state_tracker: Implement dirty flags for clip distances and shaders 2020-02-28 17:56:42 -03:00
ReinUsesLisp 758ad3f75d gl_state_tracker: Add dirty flags for buffers and divisors 2020-02-28 17:56:42 -03:00
ReinUsesLisp 9b08698a0c maxwell_3d: Change write dirty flags to a bitset 2020-02-28 17:56:42 -03:00
ReinUsesLisp 69ad6279e4 gl_state_tracker: Implement dirty flags for vertex formats 2020-02-28 17:56:42 -03:00
ReinUsesLisp 6530144ccb gl_state_tracker: Implement dirty flags for color masks 2020-02-28 17:56:42 -03:00
ReinUsesLisp ba6f390448 gl_state_tracker: Implement dirty flags for scissors 2020-02-28 17:56:42 -03:00
ReinUsesLisp 7f52efdf61 gl_state_tracker: Implement dirty flags for viewports 2020-02-28 17:56:41 -03:00
ReinUsesLisp dacf83ac02 renderer_opengl: Reintroduce dirty flags for render targets 2020-02-28 17:56:41 -03:00
ReinUsesLisp 9e74e6988b maxwell_3d: Flatten cull and front face registers 2020-02-28 17:56:41 -03:00
ReinUsesLisp eed789d0d1 video_core: Reintroduce dirty flags infrastructure 2020-02-28 17:56:41 -03:00
ReinUsesLisp b92dfcd7f2 gl_state: Remove completely 2020-02-28 17:56:35 -03:00
ReinUsesLisp 1c4bf9cbfa gl_state: Remove program tracking 2020-02-28 17:52:14 -03:00
ReinUsesLisp 5ccb07933a gl_state: Remove framebuffer tracking 2020-02-28 17:52:10 -03:00
ReinUsesLisp 17a7fa751b gl_state: Remove image tracking 2020-02-28 17:36:40 -03:00
ReinUsesLisp 9677db03da gl_state: Remove texture and sampler tracking 2020-02-28 17:35:58 -03:00
ReinUsesLisp 1bc0da3dea gl_state: Remove blend state tracking 2020-02-28 17:34:43 -03:00
ReinUsesLisp 7d9a5e9e30 gl_state: Remove stencil test tracking 2020-02-28 17:32:05 -03:00
ReinUsesLisp 07a954e67f gl_state: Remove clip control tracking 2020-02-28 17:31:57 -03:00
ReinUsesLisp 1eee891f6e gl_state: Remove clip distances tracking 2020-02-28 17:26:26 -03:00
ReinUsesLisp e8125af8dd gl_state: Remove rasterizer disable tracking 2020-02-28 17:25:28 -03:00
ReinUsesLisp d3e433a380 gl_state: Remove viewport and depth range tracking 2020-02-28 17:25:18 -03:00
ReinUsesLisp 7c16b3551b gl_state: Remove scissor test tracking 2020-02-28 17:00:23 -03:00
ReinUsesLisp 0914c70b7f gl_state: Remove color mask tracking 2020-02-28 16:59:17 -03:00
ReinUsesLisp 2392b548be gl_state: Remove clamp framebuffer color tracking
This commit doesn't reset it for screen draws because clamping doesn't
change anything there.
2020-02-28 16:58:30 -03:00
ReinUsesLisp f92236976b gl_state: Remove multisample tracking 2020-02-28 16:57:47 -03:00
ReinUsesLisp 04d1134191 gl_state: Remove framebuffer sRGB tracking 2020-02-28 16:55:23 -03:00
ReinUsesLisp d5ab0358b6 gl_state: Remove VAO cache and tracking 2020-02-28 16:54:37 -03:00
ReinUsesLisp 2a662fea36 gl_state: Remove depth clamp tracking 2020-02-28 16:53:35 -03:00
ReinUsesLisp e1a16a52fa gl_state: Remove depth tracking 2020-02-28 16:52:46 -03:00
ReinUsesLisp 0f343d32c4 gl_state: Remove primitive restart tracking 2020-02-28 16:51:45 -03:00
ReinUsesLisp 42708c762e gl_state: Remove logic op tracker 2020-02-28 16:51:23 -03:00
ReinUsesLisp 915d73f3b8 gl_state: Remove blend color tracking 2020-02-28 16:50:58 -03:00
ReinUsesLisp a0321b984f gl_state: Remove polygon offset tracking 2020-02-28 16:49:20 -03:00
ReinUsesLisp f646321dd0 gl_state: Remove alpha test tracking 2020-02-28 16:48:57 -03:00
ReinUsesLisp c8f5f54a44 gl_state: Remove cull mode tracking 2020-02-28 16:48:23 -03:00
ReinUsesLisp 925521da5f gl_state: Remove front face tracking 2020-02-28 16:47:59 -03:00
ReinUsesLisp d2d5554296 gl_state: Remove point size tracking 2020-02-28 16:39:44 -03:00
ReinUsesLisp b95f064b51 gl_rasterizer: Add oglEnablei helper 2020-02-28 16:39:44 -03:00
ReinUsesLisp 1698143a1d gl_rasterizer: Add OpenGL enable/disable helper 2020-02-28 16:39:44 -03:00
ReinUsesLisp 96ac3d518a gl_rasterizer: Remove dirty flags 2020-02-28 16:39:27 -03:00
ReinUsesLisp e38ed26b98 common/math_util: Support float type rectangles 2020-02-28 16:22:11 -03:00
bunnei 5056d23d0d renderer_opengl: Fix SRGB presentation frame tracking.
- Fixes SRGB in Super Smash Bros. Ultimate.
2020-02-28 01:13:38 -05:00
Nguyen Dac Nam 6c0c2dfabc shader_decode: Fix LD, LDG when track constant buffer 2020-02-28 13:11:19 +07:00
Morph 7ee6065178 Create an "Advanced" tab in the graphics configuration tab and add anisotropic filtering levels. 2020-02-27 21:34:00 -05:00
bunnei 969357af1a
Merge pull request #3430 from bunnei/split-presenter
Port citra-emu/citra#4940: "Split Presentation thread from Render thread"
2020-02-27 19:51:55 -05:00
bunnei ebbfe73557 renderer_opengl: Reduce swap chain size to 3. 2020-02-27 19:50:17 -05:00
Morph e1efab1f51
AM/ICommonStateGetter: Stub SetLcdBacklighOffEnabled (#3454)
* Stub SetLcdBacklighOffEnabled

Used by Super Smash Bros. Ultimate
We require backlight services to be implemented to turn on/off the backlight.

* Address feedback
2020-02-27 17:49:23 +01:00
Nguyen Dac Nam db2f547434
shader: FMUL switch to using LUT (#3441)
* shader: add FmulPostFactor LUT table

* shader: FMUL apply LUT

* Update src/video_core/engines/shader_bytecode.h

Co-Authored-By: Mat M. <mathew1800@gmail.com>

* nit: mistype

* clang-format & add missing import

* shader: remove post factor LUT.

* shader: move post factor LUT to function and fix incorrect order.

* clang-format

* shader: FMUL: add static to post factor LUT

* nit: typo

Co-authored-by: Mat M. <mathew1800@gmail.com>
2020-02-27 11:14:25 -05:00
bunnei a17214baea renderer_opengl: Use more concise lock syntax. 2020-02-26 18:35:35 -05:00
bunnei aef159354c renderer_opengl: Move Frame/FrameMailbox to OpenGL namespace. 2020-02-26 18:28:50 -05:00
ReinUsesLisp 0aaa69e4d7 vk_swapchain: Silence TOCTOU race condition
It's possible that the window is resized from the moment we ask for its
size to the moment a swapchain is created, causing validation issues.

To workaround this Vulkan issue request the capabilities again just
before creating the swapchain, making the race condition less likely.
2020-02-26 17:07:18 -03:00
Fernando Sahmkow f3d4d4eaa8 ARM_Interface: Cache the JITs instead of deleting/recreating.
This was a bug inherited from citra which was fixed by then at some 
time. This commit corrects such bug and ensures JITs are correctly 
recycled.
2020-02-26 15:53:47 -04:00
bunnei 1f57f679a4
Merge pull request #3440 from namkazt/patch-6
shader: implement LOP3 fast replace for old function
2020-02-26 10:24:35 -05:00
bunnei 01a05b48b7
Merge pull request #3431 from CJBok/npad-fix
InputCommon: analog_from_button get direction implementation
2020-02-25 21:39:26 -05:00
bunnei 795893a9a5 renderer_opengl: Create gl_framebuffer_data if empty. 2020-02-25 21:23:02 -05:00