Commit Graph

2512 Commits

Author SHA1 Message Date
JMC47 e10821a847
Merge pull request #13104 from TellowKrinkle/MTLLogging
VideoBackends:Metal: Log file on failed pipeline compile
2024-10-19 13:03:52 -04:00
JosJuice 07605bf67c
Merge pull request #13090 from mitaclaw/ranges-modernization-1-trivial
Ranges Algorithms Modernization - Trivial
2024-10-15 17:08:55 +02:00
Pokechu22 937bb2aa2e Cache normals in addition to binormals and tangents
Fixes LIT (https://bugs.dolphin-emu.org/issues/13635). The text does not include normals, but has lighting enabled. With the previous default of (0, 0, 0), lighting was always black (as dot(X, (0, 0, 0)) is always 0). It seems like the normal from the map in the background (0, 0, 1) is re-used.

LIT also has the vertex color enabled while vertex color is not specified, the same as SMS's debug cubes; the default MissingColorValue GameINI value of solid white seems to work correctly in this case.
2024-10-12 10:32:41 -07:00
Tilka c1832d17f6
Merge pull request #13117 from mitaclaw/ranges-modernization-9-trivial-find
Ranges Algorithms Modernization - Find
2024-10-11 20:27:18 +01:00
mitaclaw e8d5fb89e4 C++20: Synthesize `operator!=` From `operator==`
The inequality operator is automatically generated by the compiler if `operator==` is defined.
2024-10-10 20:23:55 -07:00
mitaclaw e4fb837f4b Modernize `std::find_if` with ranges
In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
2024-10-10 15:28:11 -07:00
mitaclaw 88a1a5b4f2 Modernize `std::set_intersection` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 01d0bdf1bb Modernize `std::is_sorted` with ranges
In OGLConfig.cpp, `std::views::reverse` is used rather than sorting using `std::ranges::greater` in order to parallel other instances of reverse iteration in the function.
2024-10-10 00:53:48 -07:00
mitaclaw 78440ca335 Modernize `std::reverse` with ranges 2024-10-10 00:53:48 -07:00
TellowKrinkle 1454934a07 VideoBackends:Metal: Use standardized C++ features over clang builtins 2024-10-06 02:13:48 -05:00
TellowKrinkle 32fd10bd08 VideoBackends:Metal: Log file on failed pipeline compile 2024-10-06 02:13:48 -05:00
TellowKrinkle 9244cded9f VideoBackends:Vulkan: Increase VMA Vulkan Version to 1.2
We now use Vulkan 1.2 if available
2024-10-05 16:51:14 -05:00
JMC47 2d9f789940
Merge pull request #13050 from TellowKrinkle/HKIsNotMVK
Vulkan: Don't do MoltenVK things on Asahi Linux
2024-10-05 00:51:27 -04:00
OatmealDome ae14abb2fa
Merge pull request #13088 from TellowKrinkle/iOSFixes
VideoBackends:Metal: Fix bbox on newer iOS devices
2024-10-04 17:32:44 -04:00
TellowKrinkle a267c56412 VideoBackends:Vulkan: Wait until we've confirmed a successful AcquireNextImage before marking semaphores used 2024-10-02 19:22:16 -05:00
TellowKrinkle 7e1a9490c0 VideoBackends:Vulkan: Don't try to present if swapchain acquire failed 2024-10-02 19:22:16 -05:00
TellowKrinkle 70f69c3213 VideoBackends:Metal: subgroup_ops requires Apple7, not Apple6
SIMD-scoped permute operations are Apple6, but reduction operations are Apple7
2024-09-30 23:38:23 -05:00
TellowKrinkle 14feaf4ba8 VideoBackends:Metal: Use ios_use_simdgroup_functions with SPIRV-Cross
It defaults to trying to emulate simdgroup functions on iOS
2024-09-29 23:58:54 -05:00
Tillmann Karras 0a299a4e1e Sw/Tev: drop unused macro 2024-09-24 22:00:03 +01:00
Tillmann Karras 98add9faf0 Sw/Rasterizer: fix two elder typos, AD 2009 2024-09-24 22:00:03 +01:00
TellowKrinkle dc6ccfb2ab VideoBackends:Vulkan: Use Vulkan 1.2 driverID to detect MoltenVK
Previously we'd assume all Apple GPUs were MoltenVK, including those running on Asahi Linux with open source Honeykrisp drivers.
2024-09-05 22:15:30 -05:00
TellowKrinkle 1416dc7e6a VideoBackends:Vulkan: Consolidate feature checking into one struct 2024-09-05 22:15:29 -05:00
Admiral H. Curtiss e1b1e4b4cf
Merge pull request #13031 from parona-source/libfmt-11
Add support for libfmt-11
2024-08-31 15:34:48 +02:00
Ali Homafar 02e9a8feaf vulkan: Add line number to vulkan error logger
This is a minor improvement to add line numbers to the LOG_VULKAN_ERROR
define. Basically error logs for Vulkan will now look like:

```
// This
25:03:347 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion:278) vkWaitForFences failed:  (2: VK_TIMEOUT)

// Instead of
15:45:154 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion) vkWaitForFences failed:  (2: VK_TIMEOUT)
```
2024-08-28 17:42:54 -04:00
Alfred Wingate d7c93d87be
Add support for libfmt-11
fmt::join was moved into fmt/ranges.h

Signed-off-by: Alfred Wingate <parona@protonmail.com>
2024-08-22 16:54:35 +03:00
Dr. Dystopia 9602f36248 Remove redundant semicolons 2024-08-20 14:59:54 +02:00
TellowKrinkle cab6e7c12e Properly link against xxhash
Things using dolphin_find_optional_system_library need to link against the name used there or they won't work with both the system and bundled cases
2024-07-06 16:56:44 -05:00
Luis Condes Diaz 3f64031cbb Migrate Vulkan-Headers to submodule and update to v1.3.288 2024-06-22 08:03:20 +02:00
Admiral H. Curtiss 5c2f73986a
Merge pull request #12537 from TellowKrinkle/MTLSubgroup
VideoCommon: More specific subgroup op bugs
2024-05-21 22:17:22 +02:00
Guilherme Janczak 50dc0ffbce
port to OpenBSD 2024-04-22 20:50:47 +00:00
JosJuice 3cfa233b63 VideoCommon: Use GetSpanForAddress safely in texture decoding
Now only VertexLoader remains... But that one might be tricky.
2024-04-20 18:31:08 +02:00
JosJuice 5c9bb80638 Memmap: Replace GetPointer with GetSpanForAddress
To ensure memory safety, callers of GetPointer have to perform a bounds
check. But how is this bounds check supposed to be performed?
GetPointerForRange contained one implementation of a bounds check, but
it was cumbersome, and it also isn't obvious why it's correct.

To make doing the right thing easier, this commit changes GetPointer to
return a span that tells the caller how many bytes it's allowed to
access.
2024-04-20 18:31:08 +02:00
Pokechu22 a3951dc2d7 Fix out of bounds accesses for invalid vertex component formats
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice.

This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected.

I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice.

The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
2024-04-04 12:50:34 -07:00
Sam Belliveau 153d0201a8 Add HDR to Metal 2024-03-10 03:25:33 -04:00
TellowKrinkle b7a451fc87 VideoCommon: Post to analytics when bug is overridden 2024-01-28 23:24:23 -06:00
TellowKrinkle 99f0c3fa01 VideoCommon: Add ability for backends to override bugs 2024-01-28 23:24:22 -06:00
TellowKrinkle 463269f704 VideoBackends:Multiple: Split up BUG_BROKEN_SUBGROUP_OPS
We now use subgroup ops for more than just a minor performance optimization
2024-01-28 23:20:39 -06:00
TellowKrinkle 6243e50b21 VideoBackends:MTL: Use SPIRV 1.5
Allows non-constant simd broadcast, which is used by the ascii art shader
2024-01-27 18:47:13 -06:00
Martino Fontana 58f5bf5496 VKGfx: Don't panic for VK_SUBOPTIMAL_KHR 2024-01-05 11:20:35 +01:00
iwubcode 1073722cdf Revert "VideoCommon: revert max pixel shader samplers back to 8 for Android devices."
This reverts commit 79648e1c24.
2024-01-03 18:43:44 -06:00
iwubcode 79648e1c24 VideoCommon: revert max pixel shader samplers back to 8 for Android devices.
It was reported that some games (Zelda Wind Waker and Zelda Twilight Princess but others may also exhibit the issue) have graphical issues with the max pixel samplers set to 16 on some Android devices (ex: Pixel6); since this was increased for a performance heavy feature (custom shaders) just disable it for now.  In the future, this could be handled more elegantly
2023-12-21 00:36:44 -06:00
Mai bcd74a81a9
Merge pull request #12370 from iwubcode/more_samplers
VideoBackends / VideoCommon: update max pixel shader samplers from 8 to 16
2023-12-17 14:50:23 -05:00
Mai f589c04aa7
Merge pull request #12372 from iwubcode/texture_usage_flag
VideoBackends / VideoCommon: add type enum to dictate how the texture is used; support texture 2d
2023-12-17 14:40:39 -05:00
iwubcode 12dd15c8dd VideoBackends / VideoCommon: add type enum to dictate whether a texture is a 2D texture, a texture array, or a cube map; support 2D texture type across backends
Co-authored-by: TellowKrinkle <tellowkrinkle@gmail.com>
2023-12-15 11:06:02 -06:00
OatmealDome 438c48912b MTLStateTracker: Increase fragment buffer array size to 3 2023-12-14 14:17:07 -05:00
Lioncash e06480a8ab Software/SWGfx: Default destructor in cpp file
Fixes a build failure with clang 17.

The destructor needs to be in the cpp file, since we have a forward
declared std::unique_ptr type as part of the class. So technically the
default inline destructor could invoke without seeing the full data type
definition.
2023-12-12 20:33:43 -05:00
iwubcode ac862b04ab VideoBackends / VideoCommon: update max pixel shader samplers from 8 to 16, this allows us to support more samplers than the native Wii/GC 2023-12-10 18:14:02 -06:00
Lioncash 5f6c76af51 VideoCommon: Use std::span for BoundingBox::Write()
Crosses off a lingering TODO.

Also amends a few nearby cases where a u32 cast was being repromoted to
size_t.
2023-12-09 16:33:21 -05:00
timetravelthree 3b8737d2d7
Fix out of bound write in EfbCopy::ClearEfb 2023-12-09 02:15:42 +01:00
TellowKrinkle 394dd02d0a VideoBackends:Metal: Support multiple compute textures 2023-11-29 18:45:11 -06:00