GS: Add a Vulkan renderer#5224
GS: Add a Vulkan renderer#5224refractionpcsx2 merged 21 commits intoPCSX2:masterfrom stenzek:vulkan-pr
Conversation
|
Will sort out the linux issues tomorrow when I have time to actually boot into linux, should be fine for testing after then. |
|
Built and did some quick (~5 min) testing on Linux w/ RADV, seems to mostly work, but required a small patch: diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp
index 14d56cb1f..36ced2592 100644
--- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp
+++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp
@@ -30,6 +30,7 @@
#include "HostDisplay.h"
#include <sstream>
#include <climits>
+#include <cfloat>
#ifdef ENABLE_OGL_DEBUG
static u32 s_debug_scope_depth = 0;
diff --git a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.h b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.h
index 8c9d19b24..fd4b5e169 100644
--- a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.h
+++ b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.h
@@ -24,14 +24,8 @@ class GSTextureVK final : public GSTexture
public:
union ClearValue
{
- struct
- {
- float depth;
- };
- struct
- {
- GSVector4 color;
- };
+ float depth;
+ GSVector4 color;
};
public: |
|
Weird things I had happen in a short time testing. Edit: First two happen on the QT PR so posting there
|
|
Anything I've tested (MGS2 / MGS3 / Rayman 2R / GT4 ) that either requires high / full blending for some effects and / or has massive performance drops from enabling blending at all ( #2355 ) gets anywhere from 1.25x to 4x framerate, MGS2/3 cutscenes being on the lower end of that Rayman 2R being on the upper end of that, no graphical difference that I could see either. Performance regression on Armored Core 3 not sure why. |
|
Testing on Linux with the patches above applied: When quitting while the emulator is running, it segfaults on vkUnmapMemory(g_vulkan_context->GetDevice(), m_memory); in Vulkan::StreamBuffer::Destroy. (Line 150 of StreamBuffer.cpp). Looking at the backtrace, I'm guessing it destroys the context, then tries to call it? |
Did notice a bug when HW upscaling in Hitman Contracts - the pixels of the menu font can be seen "swimming" back and forth. Does not occur with OpenGL SW/HW. Slot_.0._.Speed_.62.37.32._.NTSC._.Limiter_.Max._.2560x1792._.Interlaced._.2021-12-28.21-11-02.mp4Maybe the same bug as Mission Impossible here - GS Dump (rename to .xz) |
|
|
You didn't post what your GPU is. |
Sorry about that. EDIT: very slight performance increase with 497.29 drivers but still below OGL |
Strange, they work fine for me on OpenGL and Vulkan with either method: Ratchet & Clank PAL SCES-50916 I get a nice performance improvement in one of the heavy areas in R&C (47FPS OGL → 52FPS VK) |
|
After the last force push, linux compiles without issues, and the segfault I listed on quit no longer happens. |
yeah it seems barriers just aren't working for me at all on my 2080Ti.. gonna try updating my drivers (I'm on like 494) |
|
Driver update fixed Ratchet |
|
Disgregard my post, my graphica issues were fixed by updating Nvidia drivers as well |
|
Snowblind Engine seems to be unhappy - graphics are fine, but performance can be halved in some scenes: Champions: Return to Arms OpenGL - 95FPS Champions: Return to Arms Vulkan - 49FPS (similar results in Baldur's Gate: Dark Alliance and Fallout: Brotherhood of Steel) i7-4770, GTX1070 Ti (driver 497.29) |
Possibly the texture uploads. I have another feature (not currently in this PR) which makes it much more efficient for vulkan, but still needs some work with handling mipmaps. |
|
Found 2 issues, those do not seem to exist in the OpenGL or DX11 Renderer. OS: Windows 10 Pro 21H2, Build 19044.1415 Game: Growlanser VI: Precarious World SLPM-66716
Issue 1 - Flickering of the screen background textures: Issue 2 - Using the PCSX2 Capture feature "Start Video Capture" seems to completely break the textures: Be aware that the games Growlanser 5 and 6 are affected by this bug: |
|
Windows 10 Home 21H1 PCSX2 seems to render only every 2 frames while FMV playing. This happens only with Vulkan. OGL, D3D11, and Software don't have this problem. gs_20211229152901.gs.zip Edit: |
Saves the expensive draw splitting/barriers when mixed software blending is used.
|
Fixes #1047 |
|
This is great, thanks to all involved for this. It's massively improved performance. |
|
I dont know if i downloaded a bad build... i am able to select Vulkan as a driver, but i see no major performance VS Open GL. I am using a R7 360 video card. |
|
it depends if you're limited by the GS/GPU. but OpenGL should be slower than Vulkan, if that's what you're limited on. But going off your GPU, I'm not expecting your CPU to be too great. |
Yeah, my PC is s**** its old and outdated, the CPU is a I3 3240, i cant expect miracles with this garbage PC, so you are right. The issue is my poor´s CPU/GPU |
|
Holy shit at the input latency reduction with Vulkan. This is the most important advancement to me. The emulator has been plagued for year and years with such high latency that made so many games near unplayable. Fighting, or action games like DMC and God Hand felt such a chore to play. The latency pretty much stripped all the fun from otherwise superb games, and didn't make the emulation route viable for anything that wasn't slower paced, like horror and RPG's. Orignal members of the team didn't seem interested in implementing exclussive fullscreen, or trying to remedy the latency issues, after so many years of users begging for it. Recent changes to the team, and some skilled fresh blood willing to help with the emualtor has started to make a big difference. Really happy with this. Thank you. |
|
@brad86m The problem you had was the windows DWM, which is mostly bypassed in the renderers now thanks to a new host window, not Vulkan specifically. We were always interested in sorted that out, several of us spent weeks if not months doing tests and dissecting where the lag was coming from and making changes to try and reduce it, so please don't say we didn't seem interested, because that's false. |
|
The renderer has nothing to do with input latency. |
|
Apologies. I didn't mean to aim that at the majority of team members. Going by what I have witnessed from mainly many years ago. On the old forum before Discord, and other modern ways of communicating on these topic. Some older team members were really arrogant to people that asked them even basic things. Sure, they owed us absolutely nothing, and their time put into the project was always appreciated, but I never understood why there was so much shitty communication between those devs and users. |
|
It is in dev builds, the PR has been merged. |












Description of Changes
What the title says :)
Been working on this for a while, but it would be nice to get some testing from a wider range of devices. Originally it was tied to the Qt PRs, but I've moved the commits around so it's qt-base-2 > vulkan -> full qt interface.
The main advantages to Vulkan over Direct3D/GL:
Scary line count is due to pulling in VulkanMemoryAllocator and the vulkan headers.
A note for anyone trying to start silly licensing drama: Yes, some of the wrapper code is originally from Dolphin and then Duckstation. In the former case, it's not the most recent code, it's based on the original code I myself contributed back in 2016, with large modifications, and I never signed a CLA. So I still have copyright over it and can re-license as I see fit (to LGPL here).
Suggested Testing Steps
Try blending games :) I've only been working on AMD for a while, hopefully the performance is still good on NVIDIA. No idea about Intel.
Currently, AMD is much slower than NVIDIA for blending. See refraction's post here: https://community.amd.com/t5/opengl-vulkan/vulkan-poor-performance-due-to-barrier-region-bit-being-ignored/td-p/501962
.. but it's still twice as fast as OpenGL on AMD :)