Commit Graph

2504 Commits

Author SHA1 Message Date
iwubcode b6d321bfb1 VideoBackends / VideoCommon: add new uniform buffer object for custom shader materials (slot 3, geometry shader buffer moves to slot 4 if available) 2023-10-06 02:17:42 -05:00
OatmealDome 3e9c9a3e8d
Merge pull request #12004 from TellowKrinkle/MetalMultiTarget
VideoBackends:Metal: Multi render target support
2023-09-03 23:31:38 -04:00
iwubcode 89e2fc1dd3 VideoBackends: update SRVDescriptorTable size in DX12 to use pixel sampler constant 2023-08-13 17:23:26 -05:00
JMC47 5512d19d4b
Merge pull request #12061 from iwubcode/cubemap_backends_only
VideoBackends: add support for cube maps for OGL, Vulkan, and D3D
2023-08-10 18:36:48 -04:00
Dentomologist 83f307ec7e D3D12: Only use framebuffer integer descriptor if allocated
Verify that DXFramebuffer's integer RTV descriptor's cpu_handle has been
allocated before using it, and if it hasn't use the non-integer RTV
descriptor instead. This fixes a Dolphin crash in Twilight Princess, and
possibly other games (Issue 13312).

As an optimization to save space in the descriptor heap, DXFramebuffer's
integer descriptor is only initialized if the given abstract texture
format has different integer and non-integer RTV formats. This
previously wasn't accounted for by GetIntRTVDescriptorArray, which could
cause DX12::Gfx::BindFramebuffer to call OMSetRenderTargets with an
invalid descriptor which would lead to a crash.

Triggering the bug was fortunately rare because integer formats are only
used when blending is disabled and logic ops are enabled. Furthermore,
the standard integer abstract format is RGBA8 which has different
integer and non-integer RTV formats, causing the integer descriptor to
be initialized and avoiding the bug.

The crash started appearing in a2702c6 because it changed the
swapchain's abstract texture format from RGBA8 to RGB10_A2. Unlike
RGBA8, RGB10_A2 has the same integer and non-integer RTV formats and so
the bug can be triggered if the other requirements are met.
2023-08-04 13:17:33 -07:00
iwubcode e892b7f1ac VideoBackends: add support for cube maps for OGL, Vulkan, and D3D 2023-07-21 19:09:40 -05:00
OatmealDome 423c7c58cd
Merge pull request #12042 from JosJuice/logic-op-no-win7
D3D: Remove Windows 7 mention in logic ops warning
2023-07-11 20:23:16 -04:00
JosJuice 5acebc71c4 D3D: Remove Windows 7 mention in logic ops warning
Dolphin no longer supports Windows 7, so the fact that there are (were?)
more people who use Windows 7 than who use a GPU that doesn't support
the required feature is no longer relevant.
2023-07-11 22:41:51 +02:00
Admiral H. Curtiss eedc1144c1
Merge pull request #11923 from iwubcode/multi-texture-compute-support
VideoBackends: support multiple compute images for some backends
2023-07-01 17:47:55 +02:00
Admiral H. Curtiss 4774fe3445
VKGfx: Add parentheses around ambiguous if statements. 2023-06-29 03:59:18 +02:00
iwubcode 3627398cf5 VideoBackends: support multiple compute images for some backends (D3D, OGL, Vulkan) 2023-06-28 17:15:31 -05:00
TellowKrinkle fc4036af80 VideoBackends:Metal: Multi render target support 2023-06-28 00:11:37 -05:00
Admiral H. Curtiss 02909bd1a5
Merge pull request #11850 from Filoppi/post_process_fixes
Video: implement color correction to match the Wii/GC NTSC/PAL color spaces (and gamma)
2023-06-23 18:08:23 +02:00
Filoppi a2702c6e27 Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.

Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).

Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.

This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.

Fixes: https://bugs.dolphin-emu.org/issues/8941

Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-19 01:34:42 +03:00
Admiral H. Curtiss 9e06b6964b
Merge pull request #11963 from iwubcode/d3d12_fix
VideoBackends: fix d3d12 error when validation layers enabled
2023-06-19 00:33:40 +02:00
Filoppi 0584f8ae2a Video: fix Vulkan RGBA10_2 format to the actual most common one (used as swapchain format) 2023-06-18 12:58:40 +03:00
get 07ad75f34f EnumUtils: Add Common::ToUnderlying
Mirrors the C++23 <utility> function, std::to_underlying
2023-06-17 07:15:33 -05:00
iwubcode ba74902bca VideoBackends: fix d3d12 validation layer error introduced by multi-output texture breaking logic ops support 2023-06-17 01:48:59 -05:00
Robin Kertels 23bebc5270
VideoBackends:Vulkan: Allow loading custom drivers on Android
... using libadrenotools
2023-06-11 13:52:34 +02:00
OatmealDome 7752e247f7
Merge pull request #11911 from TellowKrinkle/MTLParallelCompilation
VideoBackends:Metal: Enable shouldMaximizeConcurrentCompilation when available
2023-06-10 19:39:24 +02:00
Admiral H. Curtiss 8f51a9d2d8
Merge pull request #11699 from Pokechu22/gl-check-maximum-samples
OpenGL: Check the list of supported AA modes instead of hardcoding
2023-06-09 15:07:07 +02:00
Admiral H. Curtiss 092773ad0c
Merge pull request #11859 from iwubcode/backend-multi-output
VideoBackends: add support to allow rendering to multiple output targets
2023-06-09 13:40:21 +02:00
Pokechu22 b246a634d4 OpenGL: Check the list of supported AA modes instead of hardcoding 2023-06-08 22:07:41 -07:00
Pokechu22 c63f0f37cd VideoCommon: Pass WindowSystemInfo to InitBackendInfo 2023-06-08 22:07:39 -07:00
TellowKrinkle e7f4b7679b VideoBackends:Metal: Enable shouldMaximizeConcurrentCompilation when available 2023-06-08 18:57:41 -05:00
Admiral H. Curtiss 3dbdf0472d
Merge pull request #11901 from Filoppi/add_texture_types
Video: add R10B10G10A2 and R16G16B16A16F texture types
2023-06-08 15:28:15 +02:00
Filoppi cdc53c046b Video: add R10B10G10A2 and R16G16B16A16F texture types (needed by PR 11850) 2023-06-08 03:17:20 +03:00
Filippo Tarpini 80d12e3e88
Video: Fix crash when getting the AA modes
DX12 would often crash when starting and stopping the emulation many times, due to the device enumerator failing for some reason. Checking for success fixes it.
2023-06-08 02:46:08 +03:00
iwubcode 834f8f7b5c VideoBackends: add support to allow rendering to multiple output textures 2023-06-03 14:52:31 -05:00
TellowKrinkle 0ee12b6164 VideoBackends:Metal: Allocate bounding box uploads on a cpu buffer
AMD Metal drivers have a goofy bug where the bbox buffer stops being coherent with the cpu if you copy to it from a private (gpu) buffer and don't do anything else with it in that command buffer.
2023-05-28 17:08:08 -05:00
OatmealDome 28f1a4cec1
Merge pull request #11757 from TellowKrinkle/BCniOS
Enable BCn texture support on iOS where available
2023-04-29 08:54:18 +02:00
TellowKrinkle 9cc3ba6fc6 VideoBackends:Metal: Enable BCn support on iOS 2023-04-28 20:35:54 -05:00
Admiral H. Curtiss 653be9e45d
Merge pull request #11628 from Pokechu22/gles-32-only-multisample
OGL: Only specify precision for sampler2DMSArray when it is defined
2023-04-23 16:02:15 +02:00
Lioncash 07ed932a09 Common/LinearDiskCache: Move interface into Common namespace
Gets the interface out of the global namespace.
2023-04-19 09:14:39 -04:00
OatmealDome 8aae296d4e
Merge pull request #11759 from TellowKrinkle/MTLPerfQueryFixes
VideoBackends:Metal: Fix perf queries
2023-04-18 22:15:50 +02:00
Admiral H. Curtiss 2e7f0d002e
Merge pull request #11760 from Minty-Meeo/embracing-nullptr
Embrace nullptr over NULL and 0
2023-04-18 22:14:11 +02:00
OatmealDome 8a355dbbd7
Merge pull request #11708 from TellowKrinkle/MetalMaxPixSamplers
VideoBackends:Metal: Use max pixel samplers constant
2023-04-18 22:11:06 +02:00
get a5d06fde4b Embrace nullptr over NULL and 0 2023-04-15 16:07:05 -05:00
Lioncash 784a216927 Common/MathUtil: Move IntLog2 into MathUtil namespace
Gets this out of the global namespace.
2023-04-15 03:35:05 -04:00
TellowKrinkle 09c80513cd VideoBackends:Metal: Fix perf queries
Fixes an issue where perf queries could end up including counts from previous queries
2023-04-14 00:25:31 -05:00
Pokechu22 8b0bd31e72 OGL: Use GL_OES_texture_storage_multisample_2d_array when supported
See https://bugs.dolphin-emu.org/issues/13198
2023-04-08 15:32:27 -07:00
Pokechu22 3f143d1bc9 OGL: Only specify precision for sampler2DMSArray when it is defined
See https://bugs.dolphin-emu.org/issues/13198
2023-04-08 15:32:27 -07:00
Pokechu22 53beda526b OGL: Remove bSupports2DTextureStorageMultisample and bSupports3DTextureStorageMultisample
bSupports2DTextureStorageMultisample is completely unused, while bSupports3DTextureStorageMultisample is practically unused. In the past, these were checked and fell back to sampler2DMS instead of sampler2DMSArray on GLES 3.1, but this path was removed in f039149198 and Dolphin always uses array textures now.
2023-04-08 15:32:27 -07:00
Pokechu22 c68d484a65 OGL: Convert SupportedESPointSize to an enum class 2023-04-08 15:32:27 -07:00
TellowKrinkle ed177bdbd7 VideoBackends:Metal: Use max pixel samplers constant 2023-04-08 02:12:31 +02:00
Pokechu22 56fcc97f6d CMake: Check `WIN32` instead of `CMAKE_SYSTEM_NAME STREQUAL Windows` 2023-04-06 18:37:45 -07:00
Pierre Bourdon d8fabd37fb
Merge pull request #11417 from K0bin/vk-submit-thread-cleanup
VideoBackends:Vulkan: Clean up submission thread using WorkQueueThread
2023-04-04 22:02:39 +02:00
degasus 196c684ac1 Vulkan: Enable subgroupShuffle.
It is used as workaround for the missing subgroupBroadcastDynamicId flag on SPIR-V < 1.5.
2023-03-24 21:53:23 +01:00
Robin Kertels c1be9628fc
VideoBackends:Vulkan: Use WorkQueueThread 2023-03-20 16:40:32 +01:00
Robin Kertels 9186050daa
VideoBackends:Vulkan: Clean up submission thread BlockingLoop usage 2023-03-20 16:23:35 +01:00
Admiral H. Curtiss aac9647ba2
Divide by MSAA for PerfQuery in all backends. 2023-03-14 02:13:25 +01:00
Admiral H. Curtiss ddd2b598da
Return quarter value for PerfQuery in all backends. 2023-03-14 02:08:20 +01:00
Pokechu22 4a2d3c83c7 Software: Implement GetSurfaceInfo()
Before, it used a fallback where it returned a default object, where the width and height were set to 0. Presenter::Initialize() used GetSurfaceInfo to set the backbuffer size, then used that size when initializing the on-screen UI (even for the software renderer, where the on-screen UI isn't currently present), which meant that ImGui got a window size of 0 and thus resulted in a failed assertion.

Although BindBackbuffer checks for size changes, it doesn't help because ImGui has already been initialized, and the size hasn't actually changed since initialization occured.

Fixes one aspect of https://bugs.dolphin-emu.org/issues/13172.
2023-03-02 11:08:49 -08:00
iwubcode 5d571b068f VideoBackends: rework d3d11 to specify samplers/bound textures using a bitset with a constant size, instead of hardcoding each individual enumeration value 2023-02-24 11:32:48 -06:00
Markus Wick b381df700c
Merge pull request #11577 from JosJuice/android-armeabi-v7a
Android: Fix armeabi-v7a build
2023-02-17 17:57:38 +01:00
JosJuice 90b676d368 Android: Fix armeabi-v7a build
This very much isn't a build configuration that we're going to ship,
but I want to be able to tell people that they can build it on their
own if they really want to see how terribly it performs :)

Just like before, you'll need to edit two lines in app/build.gradle to
define ENABLE_GENERIC=ON and actually enable armeabi-v7a if you want an
armeabi-v7a build. This commit just fixes some compilations errors that
crop up if you do so.
2023-02-17 16:58:24 +01:00
Robin Kertels 2695666e6d
VideoBackends:Vulkan: Fix printing validation errors 2023-02-16 17:53:15 +01:00
Pokechu22 8802f96b7e Fix uninitialized variable warnings (C26495) 2023-02-15 19:18:39 -08:00
TellowKrinkle f25a0b43b6 VideoCommon: Fix stereoscopic 3D on OpenGL < 4.3 (macOS) 2023-02-14 18:25:33 +01:00
Scott Mansell f37113204f
Merge pull request #11550 from iwubcode/set_common_samplers_count
VideoCommon: add constant value for maximum number of pixel samplers
2023-02-13 16:05:51 +13:00
JMC47 258151fe5a
Merge pull request #11523 from degasus/OGL_KHR_subgroup
VideoBackend/OGL: Prefer KHR_shader_subgroup over NV_shader_thread.
2023-02-10 04:47:20 -05:00
iwubcode af313f8419 VideoCommon: add constant value to set the allowed maximum number of pixel samplers 2023-02-10 00:46:11 -06:00
Pokechu22 2288ba28ae Software/Tev: Fix member shadowing warnings 2023-02-09 16:23:01 -08:00
JMC47 a88e5ef390
Merge pull request #11498 from iwubcode/save_pipeline_config
VideoCommon: store the configuration used to create the AbstractPipeline
2023-02-09 18:38:49 -05:00
JosJuice 6dfd582de6 OGL: Fix GLES crashing on initialization
Fixes a regression from PR 11522 ("Kill Renderer").
2023-02-09 18:09:03 +01:00
degasus 4b2aa948e6 VideoBackend/OGL: Prefer KHR_subgroup over NV_shader_thread.
While the NV extension is totally fine, the KHR extension should be able to support more hardware.

For NVIDIA, the hardware either supports both or neither, it just needs a driver from the last two years.
For AMD, the drivers from late 2022-12 seems to bring support for the KHR extension.
For Intel, the KHR is also supported for some years.
2023-02-09 13:27:02 +01:00
iwubcode d0c6b6c9ed VideoCommon: store the configuration used to create the AbstractPipeline on the pipeline itself, so that it's easy to duplicate pipelines with slightly altered configuration 2023-02-09 02:13:53 -06:00
Scott Mansell ccf92a3e56
Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
2023-02-09 19:59:16 +13:00
Scott Mansell 60f2b5af7b Apply suggestions from code review
Co-authored-by: Mai <mathew1800@gmail.com>
Co-authored-by: BhaaL <bhaalsen@gmail.com>
Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
2023-02-09 18:36:20 +13:00
Scott Mansell cf9a6f8477 Lint fixes 2023-02-09 18:36:20 +13:00
Scott Mansell 4422af1272 Cleanup headers 2023-02-09 18:36:20 +13:00
Scott Mansell 31cfe8250d Lint fixes 2023-02-09 18:36:20 +13:00
Scott Mansell 11de923dcb Move xfb tracking and IR scaling out of RenderBase 2023-02-09 18:36:20 +13:00
Scott Mansell e009002411 Refactor ClearRegion
And fix bug where opengl was getting the wrong coordinates
2023-02-09 18:36:20 +13:00
Pierre Bourdon c92de420ef
lint: update to clang-format-13 2023-02-02 04:56:08 +01:00
Scott Mansell e98ab0784d
Merge pull request #11501 from iwubcode/abstract_texture_load_specify_layer
VideoBackends: add a way to load data into a specific level AND layer
2023-02-01 00:03:59 +13:00
Scott Mansell abfc75f362 Cleanup headers 2023-01-31 19:41:24 +13:00
Scott Mansell 3ae78b8e76 Also use events for config changed 2023-01-31 19:41:24 +13:00
Scott Mansell 9d125a6e43 Move ConfigChanged out of RenderBase
There is this nice VideoConfig file that's perfect for it
2023-01-31 19:41:24 +13:00
Scott Mansell 99d3e489ea Move BoundingBox out of RenderBase
They were essentially just pass-though methods
2023-01-31 19:41:24 +13:00
Scott Mansell 8ad59f8ccf Add AbstractGfx for DX12 2023-01-31 19:41:24 +13:00
Scott Mansell 5a2d119bda Implement AbstractGfx for Dx11 2023-01-31 19:41:24 +13:00
Scott Mansell 8bc8e43dd6 Add virtual Initialize() to PerfQueryBase
Both DX12 and Vulkan already had one.
2023-01-31 19:41:24 +13:00
Scott Mansell eaae5b4a45 Implement AbstactGfx for Metal 2023-01-31 19:41:24 +13:00
Scott Mansell 06ae08ca8b Fix misnamed local variable 2023-01-31 19:41:24 +13:00
Scott Mansell f158ff300b Handle VideoSoftware's present fallback better
Not a good idea to abuse bSupportsPostProcessing
2023-01-31 19:41:24 +13:00
Scott Mansell 2a2014af09 Implement AbstractGfx for Vulkan 2023-01-31 19:41:23 +13:00
Scott Mansell 58b70b2fb2 Don't set common globals from Video Backends 2023-01-31 19:41:23 +13:00
Scott Mansell d37f83ffeb Implement AbstractGfx for Software & Null 2023-01-31 19:41:23 +13:00
Scott Mansell f0336a3129 Implement AbstractGfx for OpenGL
Mostly involves moving contents of OGLRender
to OGLGfx and OGLConfig
2023-01-31 18:46:04 +13:00
Scott Mansell 0d4537d60f Move Presenting, Dumping and ImGui out of Renderer 2023-01-31 18:45:21 +13:00
Scott Mansell c38c76abad Refactor to remove virtual from RenderXFBToScreen
Slightly simplifies the upcoming refactor
2023-01-31 18:29:47 +13:00
Scott Mansell 606c18210d TextureCache: Refactor with smart pointers
The whole ownership model was getting a bit of a mess, with a some
of special cases to deal with. And I'm planning to make it even more
complex in the future.
So here is some upfront work to convert it over to reference counted
pointers.
2023-01-31 18:29:47 +13:00
Admiral H. Curtiss df9ba70c35
Merge pull request #11507 from phire/Wnullablitly-completeness
Ignore nullability-completeness warnings in VMA
2023-01-30 10:03:49 +01:00
Admiral H. Curtiss ae712c61c2
Merge pull request #11500 from iwubcode/vulkan_copy_rectangle_one_layer
VideoBackends: update Vulkan's 'CopyRectangleFromTexture' to copy one layer
2023-01-30 10:03:33 +01:00
Pierre Bourdon a2f4606d33
Merge pull request #11205 from TellowKrinkle/AutoPresent
VideoBackends:Metal: Default to presentDrawable when vsync is on
2023-01-30 09:01:18 +01:00
TellowKrinkle e4e425b930 VideoBackends:Metal: Assert on pipelines with no render targets
This only actually fails on specific Metal drivers, this way doing it will actually fail the CI and we'll notice
2023-01-29 14:36:28 -06:00
Scott Mansell 6ad182edd9 Ignore nullability-completeness warnings in VMA
These cause a lot of warnings when compiling with clang.
And the example VmaUsage.h appears to disable them
2023-01-30 03:11:51 +13:00
iwubcode 7bea39b39e VideoBackends: add a way to load data into a specific level AND layer, default to layer 0 2023-01-27 18:46:53 -06:00
iwubcode 271c60781b VideoBackends: update Vulkan's 'CopyRectangleFromTexture' to copy one layer, copying more than one layer doesn't make sense given that we provide both the source/destination layer 2023-01-27 18:41:52 -06:00