Commit graph

190 commits

Author SHA1 Message Date
Liam
2956a33463 Vulkan: update initialization
Co-authored-by: bylaws <bylaws@users.noreply.github.com>
2022-11-27 14:58:28 -05:00
Liam
9737615948 general: fix compile for Apple Clang 2022-11-22 22:22:28 -05:00
Byte
df6dffa30b vulkan_blitter: Fix pool allocation double free. 2022-10-06 21:00:54 +02:00
Liam
c40cec5e58 renderer_vulkan: add format fallbacks for R16G16B16_SFLOAT, R16G16B16_SSCALED, R8G8B8_SSCALED 2022-08-02 18:39:33 -04:00
lat9nq
d41ffb592c
Revert "vulkan_device: Block AMDVLK's VK_KHR_push_descriptor" 2022-06-29 16:35:06 -04:00
Liam
084d7d6b01 common: Change semantics of UNREACHABLE to unconditionally crash 2022-06-13 20:09:00 -04:00
lat9nq
b43ae9d5ed vulkan_library: Add debug logging 2022-05-30 10:57:59 -04:00
bunnei
a9beb4746e
Merge pull request #8379 from lat9nq/amd-push-desc-workaround
vulkan_device: Block AMDVLK's VK_KHR_push_descriptor
2022-05-25 13:07:39 -07:00
lat9nq
3a8c2ae328 vulkan_device: Workaround extension bug
A bug occurs in yuzu when VK_KHR_workgroup_memory_explicit_layout is
available but 16-bit integers are not supported in the host driver.

Disable usage of the extension when this case arises.
2022-05-25 01:22:15 -04:00
lat9nq
7f53cd1e96 vulkan_device: Block AMDVLK's VK_KHR_push_descriptor
Recent AMD Vulkan drivers (22.5.2 or 2.0.226 for specifically Vulkan)
have a broken VK_KHR_push_descriptor implementation that causes a crash
in yuzu. Disable it for the time being.
2022-05-25 01:17:48 -04:00
Alexandre Bouvier
020982508d video_core: Support new VkResult 2022-05-17 17:37:10 +02:00
Morph
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
Fernando Sahmkow
f783883bf8 video_core: implement formats for N64 emulation 2022-04-14 11:06:27 -04:00
Andrea Pappacoda
0c214cb5b9
fix: typos 2022-04-02 16:34:07 +02:00
bunnei
9b52ee4558
Merge pull request #8076 from ameerj/nv-vk-msaa-scale
Vulkan: Use 3D helpers for MSAA scaling on NV drivers 510+
2022-03-30 23:00:44 -07:00
Fernando Sahmkow
9872d4bc4f GC: Address Feedback. 2022-03-25 03:05:56 +01:00
Fernando Sahmkow
ecb3342145 Garbage Collection: Redesign the algorithm to do a better use of memory. 2022-03-25 01:51:51 +01:00
ameerj
8d45dd3b73 Vulkan: Use 3D helpers for MSAA scaling on NV drivers 510+
Nvidia Vulkan drivers 510+ crash when blitting MSAA images. Fall-back to 3D scale helpers for MSAA image scaling.
2022-03-23 23:30:17 -04:00
ameerj
1bc7d61b57 video_core: Reduce unused includes 2022-03-19 15:01:31 -04:00
Ameer J
5f8d6bc504 vulkan_device: Blacklist RADV on RDNA2 from VK_EXT_vertex_input_dynamic_state
RDNA2 devices running under the RADV driver were crashing when VK_EXT_vertex_input_dynamic_state was enabled.

Blacklisting these devices until a proper fix is established.
2022-02-25 23:09:03 -05:00
voidanix
7712e46d64
vulkan_device: fix missing format in ANV
Currently Mesa's ANV driver does not support
VK_FORMAT_B5G6R5_UNORM_PACK16, implement an alternative for it.
2022-02-21 09:21:41 +01:00
Georg Lehmann
d15814d39f vulkan_device: Fix sType for VkPhysicalDeviceShaderAtomicInt64Features 2022-01-19 19:48:46 +01:00
ameerj
f9e0681d59 vk_texture_cache: Use 3D scale helpers for MSAA texture scaling on Intel Windows drivers
Fixes a crash when scaling MSAA textures in titles such as Sonic Colors Ultimate.
2021-12-23 22:35:19 -05:00
Fernando Sahmkow
6c00151d17 Vulkan: Fix the checks for primitive restart extension. 2021-12-18 07:17:08 +01:00
Fernando Sahmkow
14d2c77f91 Vulkan: implement Logical Operations. 2021-12-18 06:52:28 +01:00
Fernando Sahmkow
6430fc29a9 Vulkan: Implement VK_EXT_primitive_topology_list_restart 2021-12-18 05:47:48 +01:00
Morph
47a724780f renderer_vulkan: Add R16G16_UINT
- Used by Immortals Fenyx Rising
2021-12-08 10:55:11 -05:00
Morph
dc61b7045b renderer_vulkan: Implement S8_UINT stencil format
It should be noted that on Windows, only nvidia gpus support this format natively as of this commit.
2021-11-18 00:05:51 -05:00
ameerj
89a7e566c7 vk_texture_cache: Fix unsupported blit format error checking 2021-11-16 22:11:30 +01:00
70d51f72ec
vulkan_device: Add missing vulkan image format R5G6B5 in GetFormatProperties
- Used by Dragon Quest Builders
2021-11-05 10:31:40 -04:00
Ameer J
494e34af6a
Merge pull request #7070 from FernandoS27/want-you-bad
Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan.
2021-10-23 18:02:23 -04:00
ameerj
1e1ecca691 vk_texture_cache: Disable cube compatibility flag on non-mesa AMD GCN4 and earlier
Fixes rainbow textures on BOTW.
2021-09-23 19:40:53 -04:00
Fernando Sahmkow
60a3980561 Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan. 2021-09-23 03:49:10 +02:00
bunnei
ff54d9615f
Merge pull request #7011 from ameerj/vk-validation-0x0
vulkan_debug_callback: Ignore InvalidCommandBuffer-VkDescriptorSet errors
2021-09-16 17:17:04 -07:00
ameerj
e3c153efa4 vulkan_device: Reorder Float16Int8 declaration
This variable was going out of scope before its usage in the vulkan device creation, causing a crash on very specific drivers.
2021-09-16 00:54:24 -04:00
ameerj
5601e1cb00 Revert "Merge pull request #7006 from FernandoS27/a-motherfucking-driver"
This reverts commit 62e88d0e74, reversing
changes made to edf3da346f.
2021-09-16 00:51:22 -04:00
ameerj
db1c4b125f vulkan_debug_callback: Ignore InvalidCommandBuffer-VkDescriptorSet errors
This validation error is spammed on some titles, asserting that VkDescriptorSet 0x0[] was destroyed.

This is likely a validation layer bug when using VK_KHR_push_descriptor, which can avoid using traditional VkDescriptorSet. It should be safe to ignore for now.
2021-09-13 23:08:59 -04:00
Morph
d86a9b9a4b
Merge pull request #6943 from FernandoS27/omae-wa-mou-shindeiru
Vulkan: Disable VK_EXT_SAMPLER_FILTER_MINMAX in GCN AMD
2021-09-13 17:33:15 -04:00
Fernando Sahmkow
7a712da2b3 Vulkan: Disable VK_EXT_SAMPLER_FILTER_MINMAX in GCN AMD since it's broken. 2021-09-13 23:29:57 +02:00
Morph
62e88d0e74
Merge pull request #7006 from FernandoS27/a-motherfucking-driver
Vulkan: Blacklist Int8Float16 Extension on AMD on driver 21.9.1
2021-09-13 17:25:56 -04:00
Morph
fde9b84b21
Merge pull request #6944 from FernandoS27/dear-drunk-me
Vulkan/Descriptors: Increase sets per pool on AMD propietary driver.
2021-09-13 17:20:07 -04:00
Fernando Sahmkow
e7c8a0bb23 Vulkan: Blacklist Int8Float16 Extension on AMD on driver 21.9.1 2021-09-13 23:17:37 +02:00
Fernando Sahmkow
e7ca37b1e5 Vulkan/Descriptors: Increase sets per pool on AMFD propietary driver. 2021-09-13 23:09:18 +02:00
ameerj
27f8f3333f vulkan_device: Enable VK_KHR_swapchain_mutable_format if available
Silences validation errors when creating sRGB image views of linear swapchain images
2021-08-29 02:03:36 -04:00
ameerj
4d535799eb vulkan_device: Add a check for int8 support
Silences validation errors when shaders use int8 without specifying its support to the API
2021-08-24 21:22:41 -04:00
Robin Kertels
bb29dcb7f2
vulkan_memory_allocator: Respect bufferImageGranularity 2021-08-07 15:28:05 +02:00
ReinUsesLisp
3b006f4fe2 renderer_vulkan: Add setting to log pipeline statistics
Use VK_KHR_pipeline_executable_properties when enabled and available to
log statistics about the pipeline cache in a game.

For example, this is on Turing GPUs when generating a pipeline cache
from Super Smash Bros. Ultimate:

Average pipeline statistics
==========================================
Code size:       6433.167
Register count:    32.939

More advanced results could be presented, at the moment it's just an
average of all 3D and compute pipelines.
2021-07-27 21:29:24 -03:00
Lioncash
8c82c594f0 vulkan_wrapper: Fix SetObjectName() always indicating objects as images
We should be using the passed in object type instead.
2021-07-27 07:19:15 -04:00
ReinUsesLisp
f6796cad9c vulkan_device: Blacklist Volta and older from VK_KHR_push_descriptor
Causes crashes on Link's Awakening intro. It's hard to debug if it's our
fault due to bugs in validation layers.
2021-07-22 21:51:40 -04:00
ReinUsesLisp
be54aad1c4 maxwell_to_vk: Add R16_SNORM 2021-07-22 21:51:40 -04:00
lat9nq
55233c2861 vulkan_device: Add missing include algorithm 2021-07-22 21:51:40 -04:00
ameerj
7277d7fe96 vulkan_device: Blacklist ampere devices from float16 math 2021-07-22 21:51:40 -04:00
ReinUsesLisp
57171b23f9 vulkan_device: Enable VK_EXT_extended_dynamic_state on RADV 21.2 onward 2021-07-22 21:51:40 -04:00
ReinUsesLisp
f94f0be521 vk_graphics_pipeline: Implement smooth lines 2021-07-22 21:51:39 -04:00
ReinUsesLisp
57a8921e01 vk_graphics_pipeline: Implement line width 2021-07-22 21:51:39 -04:00
ReinUsesLisp
7dafa96ab5 shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
4f052a1f39 vk_graphics_pipeline: Implement conservative rendering 2021-07-22 21:51:39 -04:00
ReinUsesLisp
fb166b5ff4 shader: Emulate 64-bit integers when not supported
Useful for mobile and Intel Xe devices.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
ca67077ca8 vk_graphics_pipeline: Use VK_KHR_push_descriptor when available
~51% faster on Nvidia compared to previous method.
2021-07-22 21:51:38 -04:00
ReinUsesLisp
cbbca26d18 shader: Add support for native 16-bit floats 2021-07-22 21:51:38 -04:00
ReinUsesLisp
69f9b97e7e vulkan_device: Blacklist VK_EXT_vertex_input_dynamic_state on Intel 2021-07-22 21:51:38 -04:00
lat9nq
373f75d944 shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
2021-07-22 21:51:35 -04:00
ReinUsesLisp
ba3bdf1d41 vulkan_device: Enable VK_EXT_vertex_input_dynamic_state 2021-07-22 21:51:35 -04:00
ReinUsesLisp
ea038d6653 vulkan: Add VK_EXT_vertex_input_dynamic_state support
Reduces the number of total pipelines generated on Vulkan.
Tested on Super Smash Bros. Ultimate.
2021-07-22 21:51:35 -04:00
ReinUsesLisp
d554778311 vulkan: Use VK_EXT_provoking_vertex when available 2021-07-22 21:51:35 -04:00
ReinUsesLisp
8f099af6a8 nsight_aftermath_tracker: Fix SPIR-V module writes 2021-07-22 21:51:34 -04:00
ReinUsesLisp
1148a4eac7 vulkan: Conditionally use shaderInt16
Add support for Polaris AMD devices.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
77372443c3 vulkan: Enable depth bounds and use it conditionally
Intel devices pre-Xe don't support this.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
99f2c31b64 vulkan_device: Enable float64 and int64 conditionally
Add Intel Xe support.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
d621e96d0d shader: Initial OpenGL implementation 2021-07-22 21:51:30 -04:00
ReinUsesLisp
0c0ee9d897 vulkan_device: Require shaderClipDistance and shaderCullDistance features 2021-07-22 21:51:29 -04:00
Rodrigo Locatti
2dc86372c7 shader: Fix bugs and build issues on GCC 2021-07-22 21:51:29 -04:00
ReinUsesLisp
0ace34575c shader: Require dual source blending 2021-07-22 21:51:29 -04:00
ReinUsesLisp
95815a3883 shader: Implement PIXLD.MY_INDEX 2021-07-22 21:51:28 -04:00
ReinUsesLisp
e3514bcd6b spirv: Implement ViewportMask with NV_viewport_array2 2021-07-22 21:51:28 -04:00
ReinUsesLisp
183855e396 shader: Implement tessellation shaders, polygon mode and invocation id 2021-07-22 21:51:27 -04:00
ReinUsesLisp
fa75b9b062 spirv: Rework storage buffers and shader memory 2021-07-22 21:51:27 -04:00
ameerj
3db2b3effa shader: Implement ATOM/S and RED 2021-07-22 21:51:27 -04:00
ReinUsesLisp
479ca00071 nsight_aftermath_tracker: Report used shaders to Nsight Aftermath 2021-07-22 21:51:27 -04:00
ReinUsesLisp
e860870dd2 shader: Implement LDS, STS, LDL, and STS and use SPIR-V 1.4 when available 2021-07-22 21:51:25 -04:00
ameerj
3d07cef009 shader: Implement VOTE 2021-07-22 21:51:24 -04:00
ReinUsesLisp
260743f371 shader: Add partial rasterizer integration 2021-07-22 21:51:23 -04:00
ReinUsesLisp
e2bc05b17d shader: Add denorm flush support 2021-07-22 21:51:22 -04:00
ReinUsesLisp
6db69990da spirv: Add lower fp16 to fp32 pass 2021-07-22 21:51:22 -04:00
Morph
ec68cba440
Merge pull request #6502 from ameerj/vendor-title
main: Add GPU Vendor name to running title bar
2021-06-28 14:51:49 -04:00
ReinUsesLisp
99b859db55 vulkan_device: Make device memory match the rest of the file
Match the style in the file.
2021-06-25 02:38:58 -03:00
Mai M
17fff10e06
Merge pull request #6465 from FernandoS27/sex-on-the-beach
GPU: Implement a garbage collector for GPU Caches (project Reaper+)
2021-06-23 08:03:01 -04:00
Morph
81b1b71993 common: fs: Remove [[nodiscard]] attribute on Remove* functions
There are a lot of scenarios where we don't particularly care whether or not the removal operation and just simply attempt a removal.

As such, removing the [[nodiscard]] attribute is best for these functions.
2021-06-22 13:36:24 -04:00
ameerj
fb16cbb17e video_core: Add GPU vendor name to window title bar 2021-06-20 23:04:07 -04:00
ameerj
0b172d12c0 vulkan_debug_callback: Skip logging known false-positive validation errors
Avoids overwhelming the log with validation errors that are not applicable
2021-06-17 22:16:32 -04:00
Fernando Sahmkow
719a6dd5a1 Reaper: Correct size calculation on Vulkan. 2021-06-17 08:48:41 +02:00
Fernando Sahmkow
ca6f47c686 Reaper: Change memory restrictions on TC depending on host memory on VK. 2021-06-17 00:29:48 +02:00
ReinUsesLisp
5b1efe522e vulkan_memory_allocator: Release allocations with no commits 2021-06-16 21:35:01 +02:00
ReinUsesLisp
19454e71d8 vulkan_memory_allocator: Allow textures to be allocated in host memory
Allow Vulkan's allocator to use host memory when there's no more device
local memory. This delays OOM, but it will eventually still happen.
2021-05-27 05:50:48 -03:00
Morph
065867e2c2
common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)
* common: fs: fs_types: Create filesystem types

Contains various filesystem types used by the Common::FS library

* common: fs: fs_util: Add std::string to std::u8string conversion utility

* common: fs: path_util: Add utlity functions for paths

Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library

* common: fs: file: Rewrite the IOFile implementation

* common: fs: Reimplement Common::FS library using std::filesystem

* common: fs: fs_paths: Add fs_paths to replace common_paths

* common: fs: path_util: Add the rest of the path functions

* common: Remove the previous Common::FS implementation

* general: Remove unused fs includes

* string_util: Remove unused function and include

* nvidia_flags: Migrate to the new Common::FS library

* settings: Migrate to the new Common::FS library

* logging: backend: Migrate to the new Common::FS library

* core: Migrate to the new Common::FS library

* perf_stats: Migrate to the new Common::FS library

* reporter: Migrate to the new Common::FS library

* telemetry_session: Migrate to the new Common::FS library

* key_manager: Migrate to the new Common::FS library

* bis_factory: Migrate to the new Common::FS library

* registered_cache: Migrate to the new Common::FS library

* xts_archive: Migrate to the new Common::FS library

* service: acc: Migrate to the new Common::FS library

* applets/profile: Migrate to the new Common::FS library

* applets/web: Migrate to the new Common::FS library

* service: filesystem: Migrate to the new Common::FS library

* loader: Migrate to the new Common::FS library

* gl_shader_disk_cache: Migrate to the new Common::FS library

* nsight_aftermath_tracker: Migrate to the new Common::FS library

* vulkan_library: Migrate to the new Common::FS library

* configure_debug: Migrate to the new Common::FS library

* game_list_worker: Migrate to the new Common::FS library

* config: Migrate to the new Common::FS library

* configure_filesystem: Migrate to the new Common::FS library

* configure_per_game_addons: Migrate to the new Common::FS library

* configure_profile_manager: Migrate to the new Common::FS library

* configure_ui: Migrate to the new Common::FS library

* input_profiles: Migrate to the new Common::FS library

* yuzu_cmd: config: Migrate to the new Common::FS library

* yuzu_cmd: Migrate to the new Common::FS library

* vfs_real: Migrate to the new Common::FS library

* vfs: Migrate to the new Common::FS library

* vfs_libzip: Migrate to the new Common::FS library

* service: bcat: Migrate to the new Common::FS library

* yuzu: main: Migrate to the new Common::FS library

* vfs_real: Delete the contents of an existing file in CreateFile

Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now.

* input_profiles: Don't iterate the input profile dir if it does not exist

Silences an error produced in the log if the directory does not exist.

* game_list_worker: Skip parsing file if the returned VfsFile is nullptr

Prevents crashes in GetLoader when the virtual file is nullptr

* common: fs: Validate paths for path length

* service: filesystem: Open the mod load directory as read only
2021-05-25 19:32:56 -04:00
bunnei
a4c6712a4b common: Move settings to common from core.
- Removes a dependency on core and input_common from common.
2021-04-14 16:24:03 -07:00
Joshua Ashton
08337a492d
vulkan_device: Enable EXT_robustness2 features
When this was being made mandatory, these enablement of these features was removed, but this is still needed.

Fixes: 757fd1e917 ("vulkan_device: Require VK_EXT_robustness2")
2021-04-11 09:48:38 +01:00
Jan Beich
9b50b23a50 vulkan_common: enable OpenGL interop on other Unices 2021-03-30 00:25:25 +00:00
ReinUsesLisp
757fd1e917 vulkan_device: Require VK_EXT_robustness2
We are already using robustness2 features without requiring it
explicitly, causing potential crashes on drivers without the extension.
Requiring this at boot allows better diagnostics for it and formalizes
our usage on the extension.
2021-02-13 03:31:50 -03:00
ReinUsesLisp
35df1d1864 vk_staging_buffer_pool: Add stream buffer for small uploads
This uses a ring buffer similar to OpenGL's stream buffer for small
uploads. This stops us from allocating several small buffers, reducing
memory fragmentation and cache locality.

It uses dedicated allocations when possible.
2021-02-13 02:17:24 -03:00