Commit graph

109 commits

Author SHA1 Message Date
gdk
03955d6b04 Allow null samplers (samplers are not required when only using texelFetch to access the texture) 2022-06-17 22:42:57 +01:00
gdk
3b444f0ea3 SPIR-V: Geometry shader passthrough support 2022-06-17 22:42:54 +01:00
gdk
2ef7622126 SPIR-V: Fix SwizzleAdd and some validation errors 2022-06-17 22:42:52 +01:00
riperiperi
90ae2dbf69 Fix validation error for query reset
Need to think of a better way to do this.
2022-06-17 22:42:52 +01:00
riperiperi
05a736b6d3 Remove unnecessary lines
Was for testing
2022-06-17 22:42:51 +01:00
riperiperi
4cc0c2132c Rework Query stuff a bit to avoid render pass end
Tries to reset returned queries in background when possible, rather than ending the render pass.

Still ends render pass when resetting a counter after draws, but maybe that can be solved too. (by just pulling an empty object off the pool?)
2022-06-17 22:42:51 +01:00
riperiperi
eda65c8dd3 Copy query results after RP ends, rather than ending to copy
We need to end the render pass to get the data (submit command buffer) anyways...

Reduces render passes created in games that use queries.
2022-06-17 22:42:51 +01:00
riperiperi
af4aae7951 Use a bitmap to do granular tracking for buffer uploads.
This path is only taken if the much faster check of "is the buffer rented at all" is triggered, so it doesn't actually end up costing too much, and the time saved by not ending render passes (and on gpu for not waiting on barriers) is probably helpful.

Avoids ending render passes to update buffer data (not all the time)
- 140-180 to 35-45 in SMO metro kingdom (these updates are in the UI)
- Very variable 60-150(!) to 16-25 in mario kart 8 (these updates are in the UI)

As well as allowing more data to be preloaded persistently, this will also allow more data to be loaded in the preload buffer, which should be faster as it doesn't need to insert barriers between draws. (and on tbdr, does not need to flush and reload tile memory)

Improves performance in GPU limited scenarios. Should notably improve performance on TBDR gpus. Still a lot more to do here.
2022-06-17 22:42:51 +01:00
riperiperi
9c696fc2e1 Fix Multisampling 2022-06-17 22:42:50 +01:00
riperiperi
089fa6bd54 Make more robust to shader compilation failure
- Don't freeze when GLSL compilation fails
- Background SPIR-V pipeline compile failure results in skipped draws, similar to GLSL compilation failure.
2022-06-17 22:42:50 +01:00
riperiperi
d45b28f6b7 Cleanup for merge (note: disables spir-v) 2022-06-17 22:42:50 +01:00
riperiperi
c75860e627 Address some feedback 2022-06-17 22:42:49 +01:00
riperiperi
f6196fe07b Multithreaded Pipeline Compilation 2022-06-17 22:42:49 +01:00
gdk
51d986da35 Multisampling: We can only resolve for unscaled copies 2022-06-17 22:42:47 +01:00
gdk
5efe0167ea Multisampling: Use resolve if src samples count > dst samples count 2022-06-17 22:42:47 +01:00
gdk
6810796638 Multisampling support 2022-06-17 22:42:46 +01:00
riperiperi
fb20e5b371 Don't pass depth clip state right now (fix decals)
Explicitly disabling it is incorrect. OpenGL currently automatically disables based on depth clamp, which is the behaviour if this state is omitted.
2022-06-17 22:42:45 +01:00
gdk
f1a1f477ef Allow custom aspect ratio on Vulkan 2022-06-17 22:42:40 +01:00
gdk
9b779adf57 Better workaround for AMD vertex buffer size alignment issue 2022-06-17 22:42:39 +01:00
gdk
522e7933e8 Workaround for wrong last attribute on AMD (affects FFVII, STRIKERS1945, probably more) 2022-06-17 22:42:39 +01:00
gdk
36b3ab0741 Fix draw outside of render pass and missing capability 2022-06-17 22:42:39 +01:00
gdk
5a3695c968 Don't pause transform feedback for multi draw 2022-06-17 22:42:39 +01:00
gdk
52249e50dd Fix transform feedback on Intel, gl_Position feedback and clears to inexistent depth buffers 2022-06-17 22:42:38 +01:00
riperiperi
0fe19f51c0 Insert barriers around vkCmdBlitImage (may fix some amd flicker) 2022-06-17 22:42:38 +01:00
riperiperi
3f38a8526c Port #3019 2022-06-17 22:42:38 +01:00
riperiperi
2f066d1d6d Force device local storage for textures (fixes linux performance) 2022-06-17 22:42:38 +01:00
riperiperi
1e167788d4 Fix counter queue leak when game decides to use host conditional rendering 2022-06-17 22:42:38 +01:00
riperiperi
d14dbb0cff Use SupportBufferUpdater, add single layer flush 2022-06-17 22:42:38 +01:00
riperiperi
db5ac3488a Use circular queue for checking consumption on command buffers
Speeds up games that spam command buffers a little. Avoids checking multiple command buffers if multiple are active at once.
2022-06-17 22:42:38 +01:00
gdk
64d11d3574 Remove Intel bug workaround, it was fixed on the latest driver 2022-06-17 22:42:37 +01:00
gdk
f6a4fe8f5f Fix some validation errors around extended dynamic state 2022-06-17 22:42:37 +01:00
riperiperi
4d94b03622 Add single queue support
Multiqueue seems to be a bit more responsive on NVIDIA. Should fix texture flush on intel. AMD has been forced to single queue for an experiment.
2022-06-17 22:42:37 +01:00
riperiperi
dc0d0f49b1 Cleanup, disable device local buffers for now. 2022-06-17 22:42:36 +01:00
riperiperi
4994e50d1c Device local mapping for all buffers
May avoid issues with drivers with NVIDIA on linux/older gpus on windows when using large buffers (?)
Also some performance things and fixes issues with opengl games loading textures weird.
2022-06-17 22:42:36 +01:00
riperiperi
74f8ef93c7 Be a bit more careful with texture access flags, since it can be used for anything 2022-06-17 22:42:36 +01:00
riperiperi
066094241a Add barriers around vkCmdCopyImage
Write->Read barrier for src image (we want to wait for a write to read it)
Write->Read barrier for dst image (we want to wait for the copy to complete before use)
2022-06-17 22:42:36 +01:00
gdk
d3e7606a74 Validation layers should be enabled for any log level other than None 2022-06-17 22:42:35 +01:00
gdk
0dc5a48e6f Fix R4G4B4A4Unorm texture format permutation 2022-06-17 22:42:35 +01:00
gdk
adfba37a3f Fix samplers with MinFilter Linear or Nearest (fixes New Super Mario Bros U Deluxe black borders) 2022-06-17 22:42:34 +01:00
gdk
5738b66b75 Don't make Intel Mesa pay for Intel Windows bugs 2022-06-17 22:42:34 +01:00
gdk
cd01a2f74a Fix triangle overlay on SMO, Captain Toad, maybe others? 2022-06-17 22:42:34 +01:00
riperiperi
5590811ea3 Don't throw when ending conditional rendering for now
This should be re-enabled when conditional rendering is enabled on nvidia etc.
2022-06-17 22:42:34 +01:00
riperiperi
23b8bd8642 Update counter queue to be similar to the OGL one
Fixes softlocks when games had to flush counters.
2022-06-17 22:42:33 +01:00
riperiperi
d55f664908 Fix PrimitivesGenerated query, disable Transform Feedback queries for now
Lets Splatoon 2 work on nvidia. (mostly)
2022-06-17 22:42:33 +01:00
riperiperi
51bd7454bd Update Silk.NET to version 2.10.1
Somehow, massive performance boost. Seems like their vtable for looking up vulkan methods was really slow before.
2022-06-17 22:42:33 +01:00
riperiperi
d4e4ae60d5 Update to .net6 2022-06-17 22:42:33 +01:00
riperiperi
76a5beeb70 Use current command buffer for unscaled copy (perf)
Avoids flushing commands and renting a command buffer when fulfilling copy dependencies and when games do unscaled copies.
2022-06-17 22:42:33 +01:00
riperiperi
f6c2f7a8d6 Fix storage buffers being lost when bindings are out of order
(also avoid allocations when changing bindings)
2022-06-17 22:42:33 +01:00
gdk
db3a28f731 Fix uniform buffers being lost when bindings are out of order 2022-06-17 22:42:32 +01:00
gdk
a9afcdfa10 Support format aliasing on SetImage 2022-06-17 22:42:32 +01:00
gdk
5fbfa9a9bd DrawTexture support 2022-06-17 22:42:32 +01:00
riperiperi
e9222a426a Submit command buffer before Texture GetData. (UE4 fix) 2022-06-17 22:42:32 +01:00
gdk
fa24c41d32 Fix some tessellation related issues (still doesn't work?) 2022-06-17 22:42:32 +01:00
gdkchan
b7bf95c754 Workaround for AMD driver bug 2022-06-17 22:42:31 +01:00
gdkchan
c109410ccd New depth-stencil blit method for AMD 2022-06-17 22:42:31 +01:00
gdkchan
ceeb70a996 TextureStorage should hold a ref of the foreign storage, otherwise it might be freed while in use 2022-06-17 22:42:31 +01:00
riperiperi
c31dda3c1b Support multiple levels/layers for blit.
Fixes MK8D when scaled, maybe a few other games. AMD software "safe" blit not supported right now.
2022-06-17 22:42:31 +01:00
riperiperi
e0edaa177e Allow multithreading shaderc and vkCreateShaderModule
You'll only really see the benefit here with threaded-gal or parallel shader cache compile.

Fix shaderc multithreaded changes

Thread safety for shaderc Options constructor

Dunno how they managed to make a constructor not thread safe, but you do you. May avoid some freezes.
2022-06-17 22:42:31 +01:00
gdkchan
4513e8b226 WIP Vulkan implementation 2022-06-17 22:42:30 +01:00