Commit Graph

4796 Commits

Author SHA1 Message Date
Admiral H. Curtiss 3c2933cad2
Merge pull request #11549 from Pokechu22/texturecachebase-bitset-include
TextureCacheBase: Remove unused bitset include
2023-02-10 10:55:07 +01: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 3024ca2146 Suppress memcpy writing to an object with no trivial copy-assignment warnings
We need to copy padding in most of these cases, and the objects are trivially copyable; however, BitField prevents trivial copy-assignment.
2023-02-09 16:23:49 -08:00
Pokechu22 470115fd4f TextureDecoder: Fix warning: array subscript has type ‘char’ [-Wchar-subscripts] 2023-02-09 16:23:02 -08:00
Pokechu22 9559c45cae CommandProcessor: Fix shadowing warnings 2023-02-09 16:23:02 -08:00
Pokechu22 39c5d55f03 VertexLoaderBase: Fix shadowing warning 2023-02-09 16:23:02 -08:00
Pokechu22 95bee485c9 GraphicsModManager: Fix shadowing warning 2023-02-09 16:23:02 -08:00
Pokechu22 5283a85205 TextureCacheBase: Remove unused bitset include
It was used for valid_bind_points, which was removed in 88bd10cd30 (and the declaration was more recently removed in 606c18210d).
2023-02-09 16:04:48 -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
Markus Wick 17d7b75a9b
Merge pull request #11544 from jmallach/spng
Allow building against system libspng
2023-02-09 14:47:58 +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 5c1b3ac61d Hook up Presenter's ConfigChanged function
Fixes issue with post-processing not working
2023-02-09 18:36:20 +13:00
Scott Mansell 9c1fe59cc9 Insert a more solid abstraction between Qt and Imgui 2023-02-09 18:36:20 +13:00
Scott Mansell b2a31103b4 Presenter: Handle blanked frames correctly 2023-02-09 18:36:20 +13:00
Scott Mansell 83b7b01265 Fix XFB duplicate detection
Frame duplicate detection was inverted. Huge problem for 60fps games
where it would see all frames as "duplicates" and nothing would ever be
presented.
2023-02-09 18:36:20 +13:00
Scott Mansell d3ddd96cee Make sure m_prev_efb_format is initilized 2023-02-09 18:36:20 +13:00
Scott Mansell 8c8bd0e7ac Rename to HookableEvent. Because naming conflict 2023-02-09 18:36:20 +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 e0a1631659 Add comment about "end of frame" 2023-02-09 18:36:20 +13:00
Scott Mansell e2de281897 Make sure pixel shaders pick up Initial EFB Scale 2023-02-09 18:36:20 +13:00
Scott Mansell cf9a6f8477 Lint fixes 2023-02-09 18:36:20 +13:00
Scott Mansell 628af9d564 Fix builds with FFMPEG disabled 2023-02-09 18:36:20 +13:00
Scott Mansell 4422af1272 Cleanup headers 2023-02-09 18:36:20 +13:00
Scott Mansell 5803786beb Move UseVertexDepthRange() out of Renderer
There wasn't really a good place for it, but this will do
2023-02-09 18:36:20 +13:00
Scott Mansell 2cfc02a116 Move m_prev_efb_format into FramebufferManager 2023-02-09 18:36:20 +13:00
Scott Mansell 9b5397abdb Move WidescreenHeuristic to it's own class
It's about the only thing left in renderer
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
Jordi Mallach 4d164fcb77 Allow building against system libspng 2023-02-06 13:30:46 +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
OatmealDome 0f037a1af8
Merge pull request #10864 from TellowKrinkle/BetterLogicBlend
VideoCommon: Better logic op invert approximation
2023-01-31 01:55:55 -05:00
Scott Mansell b753641dd4 Add some descriptions to new classes 2023-01-31 19:41:24 +13:00
Scott Mansell abfc75f362 Cleanup headers 2023-01-31 19:41:24 +13:00
Scott Mansell ec8f46b02c Expose Renderer's Framecount
We don't want to move it, because we want to complete
this refactor without changing savestate version
2023-01-31 19:41:24 +13:00
Scott Mansell 3be63221c7 Renderer still needs to track swaps for savestates 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 0da69055d9 Split out everying remaining from Swap 2023-01-31 19:41:24 +13:00
Scott Mansell 2a18b34a73 Wire up frame before/after events 2023-01-31 19:41:24 +13:00
Scott Mansell 154cb4f722 Introduce an Event system to VideoCommon
A lot of the remaining complexity in Renderer is the massive Swap function
which tries to handle a bunch of FrameBegin/FrameEnd events.

Rather than create a new place for it. This event system will try
to distribute it all over the place
2023-01-31 19:41:24 +13:00
Scott Mansell d6cd8de1a7 Delete unused EFBHasAlphaChannel function 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 ca5ec13e13 Move GraphicsMod out of RenderBase 2023-01-31 19:41:24 +13:00
Scott Mansell 55d15bdd6e Move utiltily drawing out of RenderBase 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 8bc8e43dd6 Add virtual Initialize() to PerfQueryBase
Both DX12 and Vulkan already had one.
2023-01-31 19:41:24 +13:00
Scott Mansell 3c73707dfe Fix dead code. 2023-01-31 19:41:24 +13:00
Scott Mansell b007b8e104 Replace BeginUI/EndUI 2023-01-31 19:41:24 +13:00
Scott Mansell 18c799f0b6 Present: Set surface info before initializing ImGui
Otherwise you get subtle bugs in vulkan that take hours to track down.
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 26e00c3bb4 Fix warning about using & with bools 2023-01-31 19:41:23 +13:00
Scott Mansell 74d3b3443a Fix warning about compare sign mismatch 2023-01-31 19:41:23 +13:00
Scott Mansell 8f5b196019 Minimise include polution from RenderState 2023-01-31 19:41:23 +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 8a23629345 Split AbstractGfx out of Renderer
Almost all the virtual functions in Renderer are part of dolphin's
"graphics api abstraction layer", which has slowly formed over the
last decade or two.

Most of the work was done previously with the introduction of the
various "AbstractX" classes, associated with texture cache cleanups
and implementation of newer graphics APIs (Direct3D 12, Vulkan, Metal).
We are simply taking the last step and yeeting these functions out
of Renderer.

This "AbstractGfx" class is now completely agnostic of any details
from the flipper/hollywood GPU we are emulating, though somewhat
specialized.

(Will not build, this commit only contains changes outside VideoBackends)
2023-01-31 18:46:02 +13:00
Scott Mansell e57eb04ed3 Rename FrameDump.{cpp,h} to FrameDumpFFMpeg.{cpp,h}
The name kind of conflicts with a new FrameDumper class
2023-01-31 18:45:29 +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 a01d5283ec TextureCache: Add content locking
Texture cache occasionally mutates textures for efficiency.
Which is awkward if we want to borrow those textures from texture cache
to do something else, such as a graphics debugger, or async presentation
on another thread.

Content locking provides a way to signal that the contents of a texture
cache entry should not change. Texture cache will be forced to use
alternative strategies.
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
Scott Mansell c1fd4a2013 Move TCacheEntry out of TextureCacheBase
Allows for fowards declaration
2023-01-31 18:29:47 +13:00
TellowKrinkle 600ad5f498 VideoCommon: Better logic op invert approximation 2023-01-30 14:04:37 -06: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
Scott Mansell 6d7303993c
Merge pull request #11509 from Sam-Belliveau/improved-speed-counter
Tie Speed to CPU Speed and not VPS
2023-01-30 20:41:03 +13:00
TellowKrinkle 1119a9ba32 VideoCommon: Don't create pipelines with no render targets
Some backends don't like it when you do that
2023-01-29 14:35:23 -06:00
Sam Belliveau ebf114aef5 Tie Speed to CPU Speed and not VPS 2023-01-29 13:33:48 -05: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
Admiral H. Curtiss 0a343007cb
PowerPC: Parametrize LR macro. 2023-01-27 15:22:43 +01:00
Admiral H. Curtiss be8d0b76ca
PowerPC: Remove PC macro. 2023-01-27 15:22:41 +01:00
Pierre Bourdon 9c9310bf44
Merge pull request #11208 from TellowKrinkle/CPUCull
Cull vertices on the CPU
2023-01-26 23:15:23 +01:00
TellowKrinkle a0e6d7c173 VideoCommon: Explicitly disable fp_contract for CPUCull 2023-01-25 02:21:56 -06:00
TellowKrinkle 1be0149146 VideoCommon: Cull vertices on the CPU 2023-01-25 02:21:56 -06:00
TellowKrinkle b170ef9651 VideoCommon: Add class for quickly transforming and culling vertices on the CPU 2023-01-25 02:21:56 -06:00
Pierre Bourdon 8d5edb13a9
Merge pull request #11367 from Sam-Belliveau/lagbegone
VideoCommon: VI Skip
2023-01-19 01:20:01 +01:00
Pierre Bourdon a7d1683149
Merge pull request #11432 from Pokechu22/generic-vertex-loader-test-error
VertexLoader: Fix loading tangent/binormal caches with NormalIndex3
2023-01-17 23:30:29 +01:00
Sam Belliveau 23ad07b368 Add VISkip 2023-01-14 01:56:37 -05:00
Pokechu22 3910bdd68b VertexLoader: Don't write position_cache if vertex is skipped
This is the behavior in the x64 and ARM64 vertex loaders. I don't know if it makes sense (the whole skipped vertex system seems jank, but several games behave incorrectly without it).
2023-01-13 15:38:00 -08:00
Pokechu22 16c0593a52 VertexLoader: Fix loading tangent/binormal caches with NormalIndex3 2023-01-13 15:38:00 -08:00
Pokechu22 2d53b73643 VertexLoaderTester: Add assertions for position/binormal/tangent caches 2023-01-13 15:38:00 -08:00
Pokechu22 c681d96d46 VertexLoaderTester: Use asserts instead of logs
Logs don't show up in unit tests, and since this is debugging functionality (though not enabled for tests by default) it's better to do it this way.
2023-01-13 15:38:00 -08:00
Sam Belliveau bc1cc9eeb4 CoreTiming: Throttle Before Every Event Using Chrono 2023-01-06 17:21:17 -05:00
Sam Belliveau 588a72a4fc
PerformanceTracker: Add ownership of m_log_name. 2023-01-06 20:27:25 +01:00
Sam Belliveau bc46089ab0
PerformanceTracker: Use shared_mutex instead of mutex so multiple threads can read at the same time. 2023-01-06 20:27:25 +01:00
Sam Belliveau 9143eb00fb
PerformanceMetrics: Fix Line Width Issue on Non HiDPI Screens 2023-01-06 20:27:17 +01:00
Mai cc14d60bbb
Merge pull request #11402 from Pokechu22/too-many-indices
IndexGenerator: Fix off-by-one in GetRemainingIndices
2023-01-05 15:15:09 +00:00
Pokechu22 cefcd9c93c IndexGenerator: Fix off-by-one in GetRemainingIndices
Fixes https://bugs.dolphin-emu.org/issues/13136.
2023-01-04 10:42:00 -08:00
Pokechu22 6c58ba353c IndexGenerator: Add assertion for overflow in GetRemainingIndices
This assertion is currently triggered by Pocoyo Racing (https://bugs.dolphin-emu.org/issues/13136).
2023-01-04 10:41:14 -08:00
Admiral H. Curtiss 2fdaf0a86e
HW/ProcessorInterface: Rename member variables to fit naming convention. 2023-01-04 03:17:26 +01:00
Admiral H. Curtiss 74e1577a2c
HW/ProcessorInterface: Refactor to class, move to Core::System. 2023-01-04 03:00:10 +01:00
Pokechu22 d91f340c86 VertexManagerBase: Move free space check to after the buffer is reset
Fixes incorrect logspam when the buffer needed to be reset on flushes (which we already were doing, but 52feed04db moved it to after the check was made). This is https://bugs.dolphin-emu.org/issues/10312.

I also converted it to an assert, as if this does happen, things are going to render incorrectly, so we want to make it obvious.
2023-01-03 17:06:51 -08:00
Admiral H. Curtiss ed9915308b
Merge pull request #11386 from Pokechu22/manual-texture-sampling-stereoscopic-layer-bounds-check
PixelShaderGen: Clamp texture layer when using manual texture sampling with stereoscopic 3D
2023-01-03 18:07:06 +01:00
Admiral H. Curtiss cb0a603c72
VideoCommon: De-globalize GeometryShaderManager class. 2022-12-29 15:33:19 +01:00
Admiral H. Curtiss 7e55cc9e90
VideoCommon/VertexShaderManager: Rename private variables. 2022-12-28 16:00:15 +01:00
Admiral H. Curtiss 50625728e0
VideoCommon: De-globalize VertexShaderManager class. 2022-12-28 15:52:29 +01:00