Commit Graph

4691 Commits

Author SHA1 Message Date
Sam Belliveau 673f81c18a New FrameTime/VBlank Analyzer + Graph 2022-12-23 19:52:53 -05:00
Minty-Meeo 05bebee802 Replace BitUtils with C++20: Counting Zeroes
With the upgrade to C++20, std::countl_zero and std::countr_zero can replace these home-spun implementations from the BitUtil.h library.
2022-12-21 04:17:00 -06:00
JosJuice 547d956278 Common: Use C++20 <bit> header in BitSet.h 2022-12-18 16:51:32 +01:00
Admiral H. Curtiss c486baffe6
VideoCommon/PixelEngine: Pass Core::System to methods. 2022-12-11 21:57:30 +01:00
Admiral H. Curtiss ec8aaf1f30
VideoCommon/PixelEngine: Refactor to class, move to Core::System. 2022-12-11 21:57:19 +01:00
Admiral H. Curtiss ceae4242fc
VideoCommon/Fifo: Pass Core::System to methods. 2022-12-10 17:16:26 +01:00
Admiral H. Curtiss 5624dd6d39
VideoCommon/Fifo: Refactor to class, move to Core::System. 2022-12-10 17:16:19 +01:00
Admiral H. Curtiss 8a3b8a925e
Core: Add option to force linear texture filtering. 2022-12-09 02:02:16 +01:00
Admiral H. Curtiss 839db591d9
HW/Memmap: Refactor Memory to class, move to Core::System. 2022-12-03 13:27:02 +01:00
Admiral H. Curtiss 6941d2e7e6
VideoCommon/CommandProcessor: Refactor to class, move to Core::System. 2022-11-29 08:15:01 +01:00
Admiral H. Curtiss c9558ecb4c
CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00
Mai 7be4c90f67
Merge pull request #11166 from AdmiralCurtiss/mmio-system
HW: Pass System to MMIO handlers.
2022-11-24 00:58:45 +00:00
Pokechu22 cc5640245c Fix build errors related to formatting non-scoped enums 2022-11-23 13:45:43 -08:00
Admiral H. Curtiss 545fee9c94
Core/CommandProcessor: Reformat single/dual core dependent MMIO handlers. 2022-11-23 21:58:18 +01:00
Admiral H. Curtiss 0a6fdb9c13
HW: Pass System to MMIO handlers. 2022-11-23 05:52:21 +01:00
Mai a47ed2124f
Merge pull request #11253 from AdmiralCurtiss/core-timing-events-pass-system
CoreTiming: Pass Core::System to Events.
2022-11-23 04:46:11 +00:00
Mai cb232155d9
Merge pull request #11298 from Pokechu22/vertexloader-no-DataReader
VertexLoader: Eliminate use of DataReader
2022-11-23 04:40:53 +00:00
Pokechu22 e13094766d Fix VertexLoader.cpp using the wrong size for texture matrix indices without a corresponding texture
This regressed in 0a906f553f, I think (though I haven't confirmed it). Mario Tennis and Luigi's Mansion both use these for some reason (as far as I can tell, the data isn't actually used; it's just extra data included for no reason)
2022-11-22 17:49:54 -08:00
Pokechu22 0bcd3c79bb VertexLoader: Eliminate use of DataReader
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways.

Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
2022-11-22 17:17:11 -08:00
Sam Belliveau edb2c90b38
Improve FPS/VPS Counting and Revamp Appearance 2022-11-23 00:11:47 +01:00
Pokechu22 8f5a58f8be
Merge pull request #11285 from K0bin/cp-checks
VideoCommon:VertexLoaderManager: Reduce CPConfig checks
2022-11-21 15:35:06 -08:00
Robin Kertels f179fd9c33
VideoCommon:VertexLoaderManager: Reduce CPConfig checks
A bit of a micro optimization:
CheckCPConfiguration is called 350 times instead of 35k times.
2022-11-18 01:42:30 +01:00
Pokechu22 1fdf15a1be VideoCommon/FramebufferManager: Rename m_efb_cache_tiles_wide to m_efb_cache_tile_row_stride
This also initializes it in the non-tiled case just for consistency, although it's not actually read in that case.
2022-11-15 16:04:41 -08:00
Pokechu22 55e1c3b51d VideoCommon/FramebufferManager: use !IsUsingTiledEFBCache() in GetEFBCacheTileRect
This is for readability only, and should behave identically.
2022-11-15 15:48:56 -08:00
Pokechu22 90d05fe37e VideoCommon/FramebufferManager: Always update frame access mask on depth peeks
0e02ddcf52 removed separate logic for tiled versus non-tiled EFB peek caches, and as part of that made it so that color peeks updated the frame access mask even when a non-tiled cache is in use. However, the same change was not made for depth peeks. I'm not sure if this affected anything in practice.
2022-11-15 15:34:03 -08:00
JMC47 8a1c28be63
Merge pull request #11172 from K0bin/efb-refresh
VideoCommon:FramebufferManager: Mark cache as valid after refresh
2022-11-15 16:33:46 -05:00
TellowKrinkle 37a51f1d09 VideoCommon: Add an option to disable mipmaps
Needed by M1 fifoci to work around a minor non-determinism bug
2022-11-07 22:18:56 -06:00
Admiral H. Curtiss a98df18947
VideoCommon: Hold ImGui lock while initializing and shutting down ImGui. 2022-11-06 21:48:55 +01:00
Admiral H. Curtiss c931529e7a
Merge pull request #11225 from iwubcode/graphics-mod-textureload-callable
VideoCommon: call texture load graphics mod hook when textures are loaded
2022-11-06 18:58:51 +01:00
Admiral H. Curtiss 1348337277
Merge pull request #11246 from tellowkrinkle/PVDMemset
VideoCommon: Zero PortableVertexDeclarations on initialization
2022-11-06 18:54:21 +01:00
Admiral H. Curtiss a36a5c1308
CoreTiming: Pass Core::System to Events. 2022-11-06 17:54:58 +01:00
TellowKrinkle d9ed9ae331 VideoCommon: Zero PortableVertexDeclarations on initialization
Fixes an issue where the default initializer wouldn't initialize padding, making for fun non-determinism
2022-11-05 02:02:53 -05:00
Robin Kertels 0e02ddcf52
VideoCommon:FramebufferManager: Cleanup 2022-11-04 01:18:23 +01:00
Robin Kertels 371935d61e
VideoCommon:FramebufferManager: Mark cache as valid after refresh
Otherwise we might never hit the early return
if either depth or color doesnt have any active
tiles.
2022-11-04 01:18:23 +01:00
Pokechu22 fe559f3ed3 VideoCommon/Statistics: Require semicolons after statistics macros
This is clearer and reduces IntelliSense problems.
2022-10-29 15:39:41 -07:00
iwubcode ea3e133200 VideoCommon: call texture load graphics mod hook when Dolphin loads a texture 2022-10-28 19:24:43 -05:00
Pokechu22 581a575042 VertexLoader: Remove "too many initializer values" workaround functions
I originally added these in 2b1d1038a6, for both the TPipelineFunction and the size. The size was moved into the header in fdcd2b7d00 (making the size functions obsolete), but it seems that the functions themselves are no longer needed now.

I think I didn't use this approach before because it would have required ComponentFormatTable and ComponentCountRow to be templated, which would end up resulting in lines that were too long and thus wrapped in awkward places. (I *think* they didn't get inferred properly.) Now that we only need TPipelineFunction, the templating is not needed, and this ends up being a more readable version of the version with the wrapper functions.
2022-10-25 15:29:09 -07:00
JMC47 9ef7a3b44c
Merge pull request #11207 from Pokechu22/invalid-normal-count
VideoCommon: Treat invalid normal count as NormalTangentBinormal
2022-10-25 03:17:19 -04:00
Pokechu22 574939b683 VideoCommon: Treat invalid normal count as NormalTangentBinormal
See https://bugs.dolphin-emu.org/issues/13070.
2022-10-24 22:36:43 -07:00
TellowKrinkle fa8134deda VideoBackends:Metal: Default to presentDrawable when vsync is on 2022-10-24 17:55:30 -05:00
JMC47 b66793194e
Merge pull request #11028 from tellowkrinkle/MetalFixes
Various Metal renderer improvements
2022-10-24 15:22:37 -04:00
TellowKrinkle 1e9b6f88e4 VideoCommon: Support hot reloading of VS expand 2022-10-22 20:18:02 -05:00
TellowKrinkle 3912fa7a2e VideoCommon: Add reasons for disabled VS expand 2022-10-22 20:18:02 -05:00
TellowKrinkle b567f3afcf VideoCommon: Move repeated point/line expansion code to ShaderGenCommon 2022-10-22 20:13:24 -05:00
TellowKrinkle 0a42c534c3 VideoCommon: Add configuration to prefer VS for line/point expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 68f49df0f8 VideoCommon: Add vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
JMC47 9222956acd
Merge pull request #10859 from tellowkrinkle/UniformBufferSize
VideoCommon: Increase uniform stream buffer size to 64mb
2022-10-20 17:13:31 -04:00
JMC47 9aece1810c
Merge pull request #10836 from iwubcode/d3d_uint_fix
VideoCommon: fix uint shader compiler error when using d3d
2022-10-18 12:12:08 -04:00
Pokechu22 ffed23c059 Simplify saving CP state
Rather than makring some parts of VertexLoaderManager dirty in some places and some in others, do it all in VideoState. Also, since CPState no longer contains pointers/non-CP data after d039b1bc0d, we can just use p.Do on it instead of manually saving each field.
2022-10-09 19:32:59 -07:00
Pokechu22 05f3bbfa4d Include tangent/binormal cache in savestates
This theoretically matters for RS2/RS3, although in practice these games reconfigure it each frame so it shouldn't matter for savestates.
2022-10-09 16:21:49 -07:00
iwubcode bc360584a3 VideoCommon: add structures to graphics mods to allow for future adding or removing parameters with less code overhead 2022-10-09 00:00:01 -05:00
Admiral H. Curtiss da27a3e6bc
Merge pull request #11095 from K0bin/misc-vulkan
Remove special treatment for Android in video settings
2022-10-08 22:24:30 +02:00
TellowKrinkle a13f09433c VideoBackends:Metal: Add config option to use presentDrawable 2022-10-08 04:46:07 -05:00
TellowKrinkle c08de82e90 VideoBackends:Metal: Bring back unified memory config
Turns out it was helpful.  (Most improvement in ubershaders.)  This time with much better auto mode.
2022-10-08 04:46:05 -05:00
TellowKrinkle 274d4679ca VideoBackends:Multiple: More GPUs with broken subgroup ops 2022-10-08 04:44:48 -05:00
Pokechu22 e8221d7948 Common/PointerWrap: Remove DoPOD
This was added in 385d8e2b15, but became somewhat redundant with Do in 4c7bbd96e4, and completely redundant now that std::is_trivially_copyable_v is well-supported.
2022-10-06 11:25:36 -07:00
Robin Kertels 4e204a9a1a
VideoCommon: Remove special treatment for Android in video settings 2022-10-01 20:53:02 +02:00
Robin Kertels 779fe13e62
VideoCommon: Update EFB peek cache on draw done and tokens
Massively improves performance in Mario Galaxy on Android.
2022-10-01 18:08:38 +02:00
JMC47 68eda7f887
Merge pull request #11084 from K0bin/qcom-workaround
Vulkan: Workaround slow vkCmdCopyImageToBuffer on QCom
2022-09-30 15:33:00 -04:00
Robin Kertels 81c817c54d
VideoBackends:Vulkan: Workaround slow vkCmdCopyImageToBuffer on QCom driver 2022-09-30 21:13:42 +02:00
Mai 0c19a1d87c
Merge pull request #11100 from Pokechu22/software-settings-merge
Use the same settings for the software renderer as other backends
2022-09-29 09:05:51 -04:00
Pokechu22 56fce3ba8a Software: Remove dedicated texture/frame dumping infrastructure
Texture dumping can already be done using VideoCommon's system (and in fact the same setting already enabled *both* of these). Dumping objects/TEV stages/texture fetches doesn't currently have an equivalent, but could be added to the FIFO player instead.
2022-09-26 18:25:54 -07:00
Pokechu22 39569392bd VideoCommon: Add statistics for draw done and token commands 2022-09-26 16:19:54 -07:00
Admiral H. Curtiss b7855a3a56
Merge pull request #11073 from Hibyehello/Fix-Metal-init
Add Metal as backend option with Vulkan Disabled
2022-09-23 04:21:23 +02:00
JMC47 22197c09a3
Merge pull request #10781 from tellowkrinkle/UberVertexLoader
VideoCommon: Add dynamic vertex loader for ubershaders to reduce pipeline count
2022-09-20 17:14:07 -04:00
TellowKrinkle 1eb3aaa548 VideoCommon: Use std::array in PortableVertexDeclaration 2022-09-19 16:28:24 -05:00
TellowKrinkle dae56a24b8 VideoBackends:D3D12: Dynamic vertex loader support 2022-09-19 16:28:24 -05:00
TellowKrinkle 99533d2840 VideoCommon: Add separate pipeline usage for UberShaders 2022-09-19 16:28:24 -05:00
TellowKrinkle d289e9c51c VideoCommon: Compile a few extra pipelines 2022-09-19 16:28:24 -05:00
TellowKrinkle 4c629c2bee VideoCommon: Add dynamic vertex loader to ubershaders 2022-09-19 16:28:23 -05:00
Josh ef13a54b0a
VideoBackends - Enable Metal without Vulkan 2022-09-19 11:28:34 -05:00
Pokechu22 d80201a57f VertexLoaderARM64: Fix direct normal+tangent+binormal with index3 set
Fixes https://bugs.dolphin-emu.org/issues/12952
2022-09-18 23:33:24 -07:00
Pokechu22 f148de161f VertexLoaderARM64: Specify the register to use as a parameter to ReadVertex
This also means that both a register and a vertex are always specified, though right now if the register is scratch1_reg the offset is always 0.
2022-09-18 23:33:24 -07:00
Pokechu22 ad644d5e92 VertexLoaderARM64: Merge GetAddressImm into GetVertexAddr
This way it more closely matches VertexLoaderX64, and is in general easier to understand.
2022-09-18 23:33:24 -07:00
Pokechu22 9a290c3d50 VertexLoaderARM64: Always use unscaled load/store instructions
The source and destination offsets will always be less than 255, so we can get rid of a lot of the complexity by doing this.
2022-09-18 23:33:24 -07:00
Pokechu22 afe5adb74d VertexLoaderARM64: Use EnumMap for normal scales 2022-09-18 23:33:24 -07:00
Pokechu22 200676f4e3 VertexLoaderX64: Fix direct normal+tangent+binormal with index3 set
Fixes https://bugs.dolphin-emu.org/issues/12952
2022-09-18 23:33:23 -07:00
Pokechu22 5cc2f7729e VertexLoaderX64: Use EnumMap for normal scales 2022-09-18 23:33:23 -07:00
Robin Kertels 2db74e7f21
OpcodeDecoding: Get vertex size from the loader 2022-09-19 01:14:53 +02:00
Robin Kertels a6c6ec012c
VertexLoaderManager: Clean up and slightly speed up with templates 2022-09-19 01:14:49 +02:00
Robin Kertels a31e36aeb7
VertexLoaderManager: Fix backwards preprocess check
Spotted by Pokechu22.
2022-09-15 23:56:04 +02:00
Robin Kertels fdcd2b7d00
VertexLoader: Inline GetSize 2022-09-15 12:50:15 +02:00
Robin Kertels 8aa214453a
VertexLoader: Optimize GetVertexSize
GetComponentSizes was unused, so we simplify this and get rid
of the branches.
2022-09-15 02:47:23 +02:00
Admiral H. Curtiss 85bd57df0e
Merge pull request #11007 from PEmu2/enj
Edit error message
2022-09-08 20:00:18 +02:00
Admiral H. Curtiss 45c4aa288a
Merge pull request #10881 from iwubcode/graphics-mod-draw-fb-texture-names
VideoCommon: fix graphics target texture names for efb/xfb
2022-09-08 19:56:49 +02:00
Pokechu22 2dfe91336a
Merge pull request #10549 from Pokechu22/sw-tev-enum-map
Refactor various bits of graphics code for readability
2022-09-08 09:42:12 -07:00
Merry b0717607b2 TextureInfo: Reorder members in constructor
m_stage is initialized last
2022-08-29 21:16:21 +01:00
Merry 3323375efb GraphicsModManager: Reorder DecoratedAction members to initialization order
m_action_impl is initialized before m_mod in constructor
2022-08-29 21:15:49 +01:00
Pokechu22 698def66ff Fifo analyzer: Fix various XF mistakes
* 'hangle' was a typo
* Light colors include an alpha value, so they should be 8 characters, not 6
* The XF command format adds 1 to the count internally (so 0 is one word), but we need to subtract that back to produce a valid command
* XFMEM_POSTMATRICES was calculating the row by subtracting XFMEM_POSMATRICES (POS vs POST), resulting in incorrect row numbering
2022-08-29 11:10:05 -07:00
Pokechu22 3fb09e3297 Fifo analyzer: Improve some BP descriptions
Mainly, the improvements are passing in the current command ID so that e.g. stage numbers can be directly included, instead of saying 0/1 or even/odd.
2022-08-29 11:10:05 -07:00
Pokechu22 546f9952a2 UberShaderPixel: Fix typo 2022-08-29 11:10:05 -07:00
Pokechu22 5ef8a7973e BPMemory: Make TevKSel more clear
It stores both the konst selection value for alpha and color channels (for two tev stages per ksel), and half of a swap table row (there are 4 total swap tables, which can be used for swizzling the rasterized color and the texture color, and indices selecting which tables to use are stored per tev stage in the alpha combiner).  Since these are indexed very differently, the old code was hard to follow.
2022-08-29 11:10:05 -07:00
Pokechu22 f21798b9b6 BPMemory: Use even/odd in TwoTevStageOrders instead of 0/1 2022-08-29 11:10:05 -07:00
Pokechu22 e43f02c752 BPMemory: Improve consistency of hex offset comments
I search for these somewhat often with control+f, but tend to default to adding a 0x prefix, which means I don't find them until I remove it.
2022-08-29 11:10:05 -07:00
Pokechu22 0cced44142 Use `__VA_OPT__(, ) __VA_ARGS__` instead of `##__VA_ARGS__`
Per https://en.cppreference.com/w/cpp/preprocessor/replace#.23_and_.23.23_operators the `##` behavior is a nonstandard extension; this extension seems to be supported by all compilers we care about, but IntelliSense in visual studio doesn't correctly handle it, resulting in false errors in the IDE (but not when compiling).

Per https://en.cppreference.com/w/cpp/preprocessor/replace#Function-like_macros C++20 introduced a workaround, where `__VA_OPT__(, )` generates a comma if and only if `__VA_ARGS__` is non-empty.

This PR replaces all occurrences, with the exception of Externals, DSPSpy (which is not likely to be edited in MSVC and does not target C++20 currently), and JitArm64_Integer.cpp (which uses `Function(__VA_ARGS__)`, and thus does not ever need a comma).
2022-08-23 12:09:57 -07:00
PEmu2 b516ae12ca
Edit error message
Edit error message to be less sarcastic. I doubt many users appreciate this when Dolphin has just crashed.
2022-08-22 19:52:13 -07:00
JosJuice 724bd3e597 VideoCommon: Fix OpenGL ES GPU texture decoding 2022-08-20 23:21:23 +02:00
CasualPokePlayer ab8a8e6f84 Fix crashes in dual core mode on a PI_FIFO_RESET 2022-08-18 13:38:37 -07:00
iwubcode 637dca680c VideoCommon: update ubershader pixel to not enforce d3d when writing color output that has been defined as uints 2022-08-06 16:08:58 -05:00
iwubcode 05135b4f43 VideoCommon: fix uint shader compiler error in specialized shaders. This error is in renderers that use uint for their color output (for logic ops). Remove D3D check for uint output since other backends could use uint output as well. 2022-08-06 16:08:58 -05:00