summaryrefslogtreecommitdiffstats
path: root/src/video_core/buffer_cache (follow)
Commit message (Collapse)AuthorAgeFilesLines
* svc: Fix type consistency (exposed on macOS)Merry2023-02-211-1/+1
|
* Merge pull request #9588 from liamwhite/bylaws-revertsliamwhite2023-02-191-10/+3
|\ | | | | Revert "shader_recompiler: Align SSBO offsets to meet host requirements"
| * Revert "Vulkan, OpenGL: Hook up storage buffer alignment code"Liam2023-01-071-10/+3
| | | | | | | | This reverts commit 9e2997c4b6456031622602002924617690e32a13.
* | buffer_base: Partially revert changes from #9559ameerj2023-02-091-6/+8
|/ | | | This fixes a regression where Yoshi's Crafted World (and potentially other titles) would enter an infinite loop when GPU Accuracy was set to "Normal"
* Merge pull request #9535 from bylaws/masterFernando S2023-01-061-3/+10
|\ | | | | Port over several shader-compiler fixes from skyline
| * Run clang-formatBilly Laws2023-01-051-1/+2
| |
| * Vulkan, OpenGL: Hook up storage buffer alignment codeBilly Laws2023-01-051-3/+9
| |
* | BufferBase: Don't ignore GPU pages.Fernando Sahmkow2023-01-051-8/+6
|/
* MacroHLE: Final cleanup and fixes.Fernando Sahmkow2023-01-011-1/+2
|
* RasterizerMemory: Add filtering for flushing/invalidation operations.Fernando Sahmkow2023-01-011-1/+1
|
* Revert Buffer cache changes and setup additional macros.Fernando Sahmkow2023-01-011-95/+18
|
* MacroHLE: Refactor MacroHLE system.Fernando Sahmkow2023-01-011-1/+5
|
* MacroHLE: Implement DrawIndexedIndirect & DrawArraysIndirect.Fernando Sahmkow2023-01-011-20/+140
|
* MacroHLE: Add MultidrawIndirect HLE Macro.Fernando Sahmkow2023-01-011-0/+22
|
* Merge pull request #9423 from vonchenplus/vulkan_quad_stripliamwhite2022-12-291-3/+4
|\ | | | | video_core: Implement all vulkan topology
| * video_core: Implement vulkan QuadStrip topologyFengChen2022-12-261-3/+4
| |
* | scratch_buffer: Explicitly defing resize and resize_destructive functionsameerj2022-12-201-1/+1
| | | | | | | | | | resize keeps previous data intact when the buffer grows resize_destructive destroys the previous data when the buffer grows
* | buffer_cache: Use Common::ScratchBuffer for ImmediateBuffer usageameerj2022-12-201-7/+4
|/
* video_core: Implement maxwell3d draw manager and split draw logicFeng Chen2022-12-081-14/+18
|
* Merge pull request #9289 from liamwhite/fruit-companyliamwhite2022-12-032-1/+2
|\ | | | | general: fix compile for Apple Clang
| * general: fix compile for Apple ClangLiam2022-11-232-1/+2
| |
* | GPU: Fix buffer cache issue, engine upload not inlining memory in multiline and pessismistic invalidation.Fernando Sahmkow2022-11-241-2/+2
|/
* video_core: Reimplement inline index buffer bindingFeng Chen2022-11-151-2/+31
|
* Update 3D regsKelebek12022-10-071-17/+17
|
* General: Fix compilation for GCCLiam White2022-10-061-1/+2
|
* Buffer Cache: Deduce vertex array limit from memory layout when limit is the highest possible.Fernando Sahmkow2022-10-061-3/+7
|
* Buffer Cache: Basic fixes.Fernando Sahmkow2022-10-061-15/+22
|
* DMA & InlineToMemory Engines Rework.bunnei2022-10-061-2/+2
|
* VideoCore: Refactor fencing system.Fernando Sahmkow2022-10-061-0/+13
|
* VideoCore: implement channels on gpu caches.Fernando Sahmkow2022-10-061-63/+40
|
* video_core: add option for pessimistic flushingLiam2022-08-251-1/+4
|
* code: dodge PAGE_SIZE #defineKyle Kienapfel2022-08-202-25/+26
| | | | | | | | | | | | | | | | | | | | | Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number This is great except in yuzu we're using PAGE_SIZE as a variable Specific example `static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;` PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables. Simply deleted the underscores, and then added YUZU_ prefix Might be worth noting that there are multiple uses in different classes/namespaces This list may not be exhaustive Core::Memory 12 bits (4096) QueryCacheBase 12 bits ShaderCache 14 bits (16384) TextureCache 20 bits (1048576, or 1MB) Fixes #8779
* general: Convert source file copyright comments over to SPDXMorph2022-04-233-9/+6
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* buffer_cache: cap vertex buffer sizesLiam2022-04-141-1/+14
|
* Garbage Collection: Final tuning.Fernando Sahmkow2022-03-251-3/+3
|
* Buffer Cache: Tune to the levels of the new GC.Fernando Sahmkow2022-03-251-4/+30
|
* buffer_cache: reset cached write bits after flushing invalidationsLiam2022-03-241-1/+2
|
* Merge pull request #8048 from ameerj/include-purgebunnei2022-03-221-2/+0
|\ | | | | general: Reduce unused includes across the project
| * video_core: Reduce unused includesameerj2022-03-191-2/+0
| |
* | Merge pull request #7812 from FernandoS27/made-straight-from-the-nutbunnei2022-03-201-6/+14
|\ \ | |/ |/| BufferCache: Find direction of the stream buffer increase.
| * BufferCache: Find direction of the stream buffer increase.Fernando Sahmkow2022-03-201-6/+14
| |
* | Rasterizer: Refactor inlineToMemory.Fernando Sahmkow2022-02-011-1/+2
| |
* | Rasterizer: Implement Inline2Memory Acceleration.Fernando Sahmkow2022-01-291-3/+43
|/
* buffer_cache: Reduce stream buffer allocations when expanding from the leftameerj2022-01-271-0/+2
| | | | | The existing stream buffer optimization accounts for size increases at the end of the allocated buffer. This adds the same optimization, increasing the size from the beginning of the buffer as well to reduce buffer allocations when expanding the same buffer from the left.
* VulkanBufferCache: Avoid adding barriers between multiple copies.Fernando Sahmkow2021-11-161-1/+3
|
* buffer_cache: Minor fixesameerj2021-09-201-4/+3
| | | | Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
* Garbage Collection: Make it more agressive on high priority mode.Fernando Sahmkow2021-08-292-3/+3
|
* Garbage Collection: Adress Feedback.Fernando Sahmkow2021-08-292-4/+11
|
* Garbage Collection: enable as default, eliminate option.Fernando Sahmkow2021-08-281-1/+1
|
* VideoCore: Rework Garbage Collection.Fernando Sahmkow2021-08-282-39/+35
|
* buffer_cache: Remove unused small_vector in CommitAsyncFlushesHigh()Lioncash2021-07-271-1/+0
| | | | | Given this is non-trivial, the constructor is required to execute, so this removes a bit of redundant codegen.
* Merge pull request #6585 from ameerj/hadesbunnei2021-07-251-32/+237
|\ | | | | Shader Decompiler Rewrite
| * buffer_cache: Fix debugging leftoverReinUsesLisp2021-07-231-1/+1
| |
| * buffer_cache: Fix size reductions not having in mind bind sizesReinUsesLisp2021-07-231-7/+23
| | | | | | | | | | A buffer binding can change between shaders without changing the shaders. This lead to outdated bindings on OpenGL.
| * buffer_cache: Invalidate fast buffers on computeReinUsesLisp2021-07-231-0/+1
| |
| * buffer_cache: Fix copy based uniform bindings trackingReinUsesLisp2021-07-231-4/+15
| |
| * buffer_cache: Reduce uniform buffer size from shader usageReinUsesLisp2021-07-231-16/+26
| | | | | | | | Increases performance significantly on certain titles.
| * buffer_cache: Mark uniform buffers as dirty if any enable bit changesReinUsesLisp2021-07-231-5/+5
| |
| * shader: Initial OpenGL implementationReinUsesLisp2021-07-231-19/+34
| |
| * spirv: Implement image buffersReinUsesLisp2021-07-231-5/+19
| |
| * shader: Interact texture buffers with buffer cacheReinUsesLisp2021-07-231-0/+138
| |
* | buffer_cache: Simplify clear logicReinUsesLisp2021-07-201-6/+2
|/ | | | | Use existing helper functions and avoid looping when only one buffer has to be active.
* Buffer cache: Fixes, Clang and Feedback.Fernando Sahmkow2021-07-151-10/+4
|
* Buffer Cache: Fixes to DMA Copy.Fernando Sahmkow2021-07-141-6/+7
|
* BufferCache: fix clearing on forced download.Fernando Sahmkow2021-07-141-10/+20
|
* DMAEngine: Accelerate BufferClearFernando Sahmkow2021-07-131-4/+61
|
* accelerateDMA: Fixes and feedback.Fernando Sahmkow2021-07-121-83/+54
|
* accelerateDMA: Accelerate Buffer Copies.Fernando Sahmkow2021-07-111-1/+80
|
* Buffer Cache: Address Feedback.Fernando Sahmkow2021-07-102-4/+9
|
* Buffer Cache: Fix GCC copmpile errorFernando Sahmkow2021-07-091-1/+0
|
* BufferCache: Additional download fixes.Fernando Sahmkow2021-07-091-21/+99
|
* Buffer Cache: Revert unnecessary range reduction.Fernando Sahmkow2021-07-091-29/+13
|
* Fence Manager: Force ordering on WFI.Fernando Sahmkow2021-07-091-38/+57
|
* Buffer Cache: Eliminate the AC Hack as the base game is fixed in Hades.Fernando Sahmkow2021-07-091-14/+4
|
* Fence Manager: Add fences on Reference Count.Fernando Sahmkow2021-07-091-3/+13
|
* Videocore: Address Feedback & CLANG Format.Fernando Sahmkow2021-07-092-78/+75
|
* Buffer Cache: Fix High Downloads and don't predownload on Extreme.Fernando Sahmkow2021-07-092-89/+120
|
* buffer_cache: Only flush downloaded sizeReinUsesLisp2021-06-261-2/+3
| | | | | | | Fixes a regression unintentionally introduced by the garbage collector. This makes regular memory downloads only flush the requested sizes. This negatively affected Koei Tecmo games.
* buffer_cache/texture_cache: Make GC functions privateReinUsesLisp2021-06-261-2/+2
|
* buffer_cache: Silence implicit cast warningReinUsesLisp2021-06-261-1/+1
|
* common: Replace common_sizes into user-literalsWunkolo2021-06-241-4/+7
| | | | | | | | | | | | | Removes common_sizes.h in favor of having `_KiB`, `_MiB`, `_GiB`, etc user-literals within literals.h. To keep the global namespace clean, users will have to use: ``` using namespace Common::Literals; ``` to access these literals.
* Reaper: Change memory restrictions on TC depending on host memory on VK.Fernando Sahmkow2021-06-171-23/+25
|
* Reaper: Address Feedback.Fernando Sahmkow2021-06-161-6/+7
|
* Reaper: Setup settings and final tuning.Fernando Sahmkow2021-06-161-3/+4
|
* Reaper: Tune it up to be an smart GC.Fernando Sahmkow2021-06-161-5/+22
|
* Initial Reaper SetupReinUsesLisp2021-06-162-44/+105
| | | | WIP
* Fix GCC undefined behavior sanitizer.Markus Wick2021-06-101-0/+3
| | | | | | | | | * Wrong alignment in u64 LOG_DEBUG -> memcpy. * Huge shift exponent in stride calculation for linear buffer, unused result -> skipped. * Large shift in buffer cache if word = 0, skip checking for set bits. Non of those were critical, so this should not change any behavior. At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
* buffer_cache: Simplify uniform disabling logicameerj2021-06-011-4/+7
|
* Fix two GCC 11 warnings: Unneeded copies.Markus Wick2021-05-291-2/+2
| | | | | std::move created an unneeded copy. iterating without reference also created copies.
* buffer_cache: Ensure null buffers cannot take the fast uniform bind pathameerj2021-05-161-1/+4
| | | | Fixes a crash in New Pokemon Snap
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* buffer_cache: Heuristically decide to skip cache on uniform buffersReinUsesLisp2021-03-021-10/+35
| | | | | | | | | Some games benefit from skipping caches (Pokémon Sword), and others don't (Animal Crossing: New Horizons). Add an heuristic to decide this at runtime. The cache hit ratio has to be ~98% or better to not skip the cache. There are 16 frames of buffer.
* buffer_cache: Add extra bytes to guest SSBOsReinUsesLisp2021-02-131-1/+7
| | | | | | | Bind extra bytes beyond the guest API's bound range. This is due to some games like Astral Chain operating out of bounds. Binding the whole map range would be technically correct, but games have large maps that make this approach unaffordable for now.
* gl_buffer_cache: Drop interop based parameter buffer workaroundsReinUsesLisp2021-02-131-2/+2
| | | | | Sacrify runtime performance to avoid generating kernel exceptions on Windows due to our abusive aliasing of interop buffer objects.
* buffer_cache: Heuristically detect stream buffersReinUsesLisp2021-02-132-6/+33
| | | | | | | Detect when a memory region has been joined several times and increase the size of the created buffer on those instances. The buffer is assumed to be a "stream buffer", increasing its size should stop us from constantly recreating it and fragmenting memory.
* buffer_cache: Split CreateBuffer in separate functionsReinUsesLisp2021-02-131-29/+52
| | | | | Allow adding functionality to each function without making CreateBuffer more complex.
* buffer_cache: Skip cache on small uploads on VulkanReinUsesLisp2021-02-131-8/+9
| | | | | | | | Ports from OpenGL the optimization to skip small 3D uniform buffer uploads. This will take advantage of the previously introduced stream buffer. Fixes instances where the staging buffer offset was being ignored.
* vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp2021-02-131-8/+20
| | | | | | | | This uses a ring buffer similar to OpenGL's stream buffer for small uploads. This stops us from allocating several small buffers, reducing memory fragmentation and cache locality. It uses dedicated allocations when possible.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-135-667/+1132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
* buffer_base: Add support for cached CPU writesReinUsesLisp2021-02-131-61/+145
| | | | | | | | | | | | | | | | Some games usually write memory pages currently used by the GPU, causing rendering issues (e.g. flashing geometry and shadows on Link's Awakening). To workaround this issue, Guest CPU writes are delayed until the command buffer finishes processing, but the pages are updated immediately. The overall behavior is: - CPU writes are cached until they are flushed, they update the page state, but don't change the modification state. Cached writes stop pages from being flushed, in case games have meaningful data in it. - Command processing writes (e.g. push constants) update the page state and are marked to the command processor as dirty. They don't remove the state of cached writes.
* video_core: Resolve -Wdocumentation warningsLioncash2021-01-171-1/+1
| | | | Silences some -Wdocumentation warnings on Clang.
* buffer_cache/buffer_base: Add a range tracking buffer containerReinUsesLisp2021-01-131-0/+495
| | | | | | | | | It keeps track of the modified CPU and GPU ranges on a CPU page granularity, notifying the given rasterizer about state changes in the tracking behavior of the buffer. Use a small vector optimization to store buffers smaller than 256 KiB locally instead of using free store memory allocations.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-12/+7
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* video_core: Make use of ordered container contains() where applicableLioncash2020-12-071-1/+1
| | | | | | With C++20, we can use the more concise contains() member function instead of comparing the result of the find() call with the end iterator.
* Merge pull request #5149 from comex/xx-map-intervalbunnei2020-12-071-1/+2
|\ | | | | map_interval: Change field order to address uninitialized field warning
| * map_interval: Change field order to address uninitialized field warningcomex2020-12-071-1/+2
| | | | | | | | | | | | Clang complains about `new_chunk`'s constructor using the then-uninitialized `first_chunk` (even though it's just to get a pointer into it).
* | buffer_block: Mark interface as nodiscard where applicableLioncash2020-12-071-7/+7
| | | | | | | | Prevents logic errors from occurring from unused values.
* | buffer_block: Remove unnecessary includesLioncash2020-12-071-5/+0
|/ | | | Reduces the amount of dependencies the header pulls in.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-26/+25
| | | | | | | | | Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
* buffer_cache: Eliminate redundant map lookup in MarkRegionAsWritten()Lioncash2020-07-201-6/+3
| | | | | | | | We can make use of emplace()'s return value to determine whether or not we need to perform an increment. emplace() performs no insertion if an element already exist, so this can eliminate a find() call.
* configuration: implement per-game configurations (#4098)lat9nq2020-07-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Switch game settings to use a pointer In order to add full per-game settings, we need to be able to tell yuzu to switch to using either the global or game configuration. Using a pointer makes it easier to switch. * configuration: add new UI without changing existing funcitonality The new UI also adds General, System, Graphics, Advanced Graphics, and Audio tabs, but as yet they do nothing. This commit keeps yuzu to the same functionality as originally branched. * configuration: Rename files These weren't included in the last commit. Now they are. * configuration: setup global configuration checkbox Global config checkbox now enables/disables the appropriate tabs in the game properties dialog. The use global configuration setting is now saved to the config, defaulting to true. This also addresses some changes requested in the PR. * configuration: swap to per-game config memory for properties dialog Does not set memory going in-game. Swaps to game values when opening the properties dialog, then swaps back when closing it. Uses a `memcpy` to swap. Also implements saving config files, limited to certain groups of configurations so as to not risk setting unsafe configurations. * configuration: change config interfaces to use config-specific pointers When a game is booted, we need to be able to open the configuration dialogs without changing the settings pointer in the game's emualtion. A new pointer specific to just the configuration dialogs can be used to separate changes to just those config dialogs without affecting the emulation. * configuration: boot a game using per-game settings Swaps values where needed to boot a game. * configuration: user correct config during emulation Creates a new pointer specifically for modifying the configuration while emulation is in progress. Both the regular configuration dialog and the game properties dialog now use the pointer Settings::config_values to focus edits to the correct struct. * settings: split Settings::values into two different structs By splitting the settings into two mutually exclusive structs, it becomes easier, as a developer, to determine how to use the Settings structs after per-game configurations is merged. Other benefits include only duplicating the required settings in memory. * settings: move use_docked_mode to Controls group `use_docked_mode` is set in the input settings and cannot be accessed from the system settings. Grouping it with system settings causes it to be saved with per-game settings, which may make transferring configs more difficult later on, especially since docked mode cannot be set from within the game properties dialog. * configuration: Fix the other yuzu executables and a regression In main.cpp, we have to get the title ID before the ROM is loaded, else the renderer will reflect only the global settings and now the user's game specific settings. * settings: use a template to duplicate memory for each setting Replaces the type of each variable in the Settings::Values struct with a new class that allows basic data reading and writing. The new struct Settings::Setting duplicates the data in memory and can manage global overrides per each setting. * configuration: correct add-ons config and swap settings when apropriate Any add-ons interaction happens directly through the global values struct. Swapping bewteen structs now also includes copying the necessary global configs that cannot be changed nor saved in per-game settings. General and System config menus now update based on whether it is viewing the global or per-game settings. * settings: restore old values struct No longer needed with the Settings::Setting class template. * configuration: implement hierarchical game properties dialog This sets the apropriate global or local data in each setting. * clang format * clang format take 2 can the docker container save this? * address comments and style issues * config: read and write settings with global awareness Adds new functions to read and write settings while keeping the global state in focus. Files now generated per-game are much smaller since often they only need address the global state. * settings: restore global state when necessary Upon closing a game or the game properties dialog, we need to restore all global settings to the original global state so that we can properly open the configuration dialog or boot a different game. * configuration: guard setting values incorrectly This disables setting values while a game is running if the setting is overwritten by a per game setting. * config: don't write local settings in the global config Simple guards to prevent writing the wrong settings in the wrong files. * configuration: add comments, assume less, and clang format No longer assumes that a disabled UI element means the global state is turned off, instead opting to directly answer that question. Still however assumes a game is running if it is in that state. * configuration: fix a logic error Should not be negated * restore settings' global state regardless of accept/cancel Fixes loading a properties dialog and causing the global config dialog to show local settings. * fix more logic errors Fixed the frame limit would set the global setting from the game properties dialog. Also strengthened the Settings::Setting member variables and simplified the logic in config reading (ReadSettingGlobal). * fix another logic error In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered condition. * configure_audio: set toggle_stretched_audio to tristate * fixed custom rtc and rng seed overwriting the global value * clang format * rebased * clang format take 4 * address my own review Basically revert unintended changes * settings: literal instead of casting "No need to cast, use 1U instead" Thanks, Morph! Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> * Revert "settings: literal instead of casting " This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f. * main: fix status buttons reporting wrong settings after stop emulation * settings: Log UseDockedMode in the Controls group This should have happened when use_docked_mode was moved over to the controls group internally. This just reflects this in the log. * main: load settings if the file has a title id In other words, don't exit if the loader has trouble getting a title id. * use a zero * settings: initalize resolution factor with constructor instead of casting * Revert "settings: initalize resolution factor with constructor instead of casting" This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8. * configure_graphics: guard device selector when Vulkan is global Prevents the user from editing the device selector if Vulkan is the global renderer backend. Also resets the vulkan_device variable when the users switches back-and-forth between global and Vulkan. * address reviewer concerns Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static. Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com> * main: load per-game settings after LoadROM This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug. * Revert "main: load per-game settings after LoadROM" This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804. * main: only restore global settings when necessary Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug. * configuration_shared: address reviewer concerns except operator overrides Dropping operator override usage in next commit. Co-Authored-By: LC <lioncash@users.noreply.github.com> * settings: Drop operator overrides from Setting template Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog. * complete rebase * configuration_shared: translate "Use global configuration" Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared. * configure_per_game: address reviewer concern As far as I understand, it prevents the program from unnecessarily copying strings. Co-Authored-By: LC <lioncash@users.noreply.github.com> Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> Co-authored-by: VolcaEM <volcaem@users.noreply.github.com> Co-authored-by: LC <lioncash@users.noreply.github.com>
* gl_buffer_cache: Copy to buffers created as STREAM_READ before downloadingReinUsesLisp2020-06-261-4/+2
| | | | | | | | After marking buffers as resident, Nvidia's driver seems to take a slow path. To workaround this issue, copy to a STREAM_READ buffer and then call GetNamedBufferSubData on it. This is a temporary solution until we have asynchronous flushing.
* buffer_cache: Use buffer methods instead of cache virtual methodsReinUsesLisp2020-06-241-16/+7
|
* gl_buffer_cache: Mark buffers as residentReinUsesLisp2020-06-241-9/+12
| | | | | | Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
* buffer_cache: Eliminate local variable shadowingLioncash2020-06-201-2/+1
| | | | We can just make use of the instance in the scope above this one.
* Merge pull request #4066 from ReinUsesLisp/shared-ptr-bufRodrigo Locatti2020-06-162-114/+112
|\ | | | | buffer_cache: Avoid passing references of shared pointers and misc style changes
| * buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp2020-06-092-114/+112
| | | | | | | | | | | | | | | | | | Instead of using as template argument a shared pointer, use the underlying type and manage shared pointers explicitly. This can make removing shared pointers from the cache more easy. While we are at it, make some misc style changes and general improvements (like insert_or_assign instead of operator[] + operator=).
* | buffer_cache: Return stream buffer invalidation in Map instead of UnmapReinUsesLisp2020-06-091-7/+9
|/ | | | | We have to invalidate whatever cache is being used before uploading the data, hence it makes more sense to return this on Map instead of Unmap.
* buffer_cache: Avoid copying twice on certain casesReinUsesLisp2020-05-281-17/+23
| | | | | | Avoid copying to a staging buffer on non-granular memory addresses. Add a callable argument to StreamBufferUpload to be able to copy to the staging buffer directly from ReadBlockUnsafe.
* buffer_cache: Remove unused boost headersReinUsesLisp2020-05-211-2/+0
|
* map_interval: Add interval allocator and drop hackReinUsesLisp2020-05-213-3/+78
| | | | | | | | | | Drop the std::list hack to allocate memory indefinitely. Instead use a custom allocator that keeps references valid until destruction. This allocates fixed chunks of memory and puts pointers in a free list. When an allocation is no longer used put it back to the free list, this doesn't heap allocate because std::vector doesn't change the capacity. If the free list is empty, allocate a new chunk.
* buffer_cache: Use boost::container::small_vector for maps in rangeReinUsesLisp2020-05-211-13/+15
| | | | | | Most overlaps in the buffer cache only contain one mapped address. We can avoid close to all heap allocations once the buffer cache is warmed up by using a small_vector with a stack size of one.
* buffer_cache: Use boost::intrusive::set for cachingReinUsesLisp2020-05-212-30/+44
| | | | | | | | Instead of using boost::icl::interval_map for caching, use boost::intrusive::set. interval_map is intended as a container where the keys can overlap with one another; we don't need this for caching buffers and a std::set-like data structure that allows us to search with lower_bound is enough.
* buffer_cache: Remove shared pointersReinUsesLisp2020-05-212-70/+72
| | | | | Removing shared pointers is a first step to be able to use intrusive objects and keep allocations close to one another in memory.
* buffer_cache: Minor style changesReinUsesLisp2020-05-212-129/+65
| | | | | Minor style changes. Mostly done so I avoid editing it while doing other changes.
* Merge pull request #3808 from ReinUsesLisp/wait-for-idlebunnei2020-05-031-6/+0
|\ | | | | {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registers
| * {maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp2020-04-281-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
* | vulkan: Remove unnecessary includesLioncash2020-04-291-1/+0
|/ | | | | | | Reduces some header churn and reduces rebuilds when some header internals change. While we're at it we can also resolve a missing include in buffer_cache.
* Address Feedback.Fernando Sahmkow2020-04-221-9/+6
|
* Address Feedback.Fernando Sahmkow2020-04-221-33/+23
|
* vk_fence_manager: Initial implementationReinUsesLisp2020-04-221-0/+1
|
* FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow2020-04-221-0/+7
|
* BufferCache: Refactor async managing.Fernando Sahmkow2020-04-221-7/+24
|
* FenceManager: Implement async buffer cache flushes on High settingsFernando Sahmkow2020-04-221-0/+50
|
* ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow2020-04-221-0/+12
|
* BufferCache: Implement OnCPUWrite and SyncGuestHostFernando Sahmkow2020-04-222-2/+61
|
* buffer_cache: Return handles instead of pointer to handlesReinUsesLisp2020-04-161-25/+22
| | | | | | | | | | | The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
* Memory: Correct GCC errors.Fernando Sahmkow2020-04-091-0/+1
|
* GPUMemoryManager: Improve safety of memory reads.Fernando Sahmkow2020-04-081-3/+3
|
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-063-90/+108
|
* buffer_cache: Delay buffer destructionsReinUsesLisp2020-01-291-1/+4
| | | | | | Delay buffer destruction some extra frames to avoid destroying buffers that are still being used from older frames. This happens on Nvidia's driver with mailbox.
* buffer_cache: Remove brace initialized for objects with default constructorReinUsesLisp2019-11-201-10/+10
|
* buffer_cache: Add missing includes (#3079)Morph2019-11-071-0/+4
| | | | `boost::make_iterator_range` is available when `boost/range/iterator_range.hpp` is included. Also include `boost/icl/interval_map.hpp` and `boost/icl/interval_set.hpp`.
* gl_rasterizer: Upload constant buffers with glNamedBufferSubDataReinUsesLisp2019-11-021-3/+11
| | | | | | | | | | | | | | | | Nvidia's OpenGL driver maps gl(Named)BufferSubData with some requirements to a fast. This path has an extra memcpy but updates the buffer without orphaning or waiting for previous calls. It can be seen as a better model for "push constants" that can upload a whole UBO instead of 256 bytes. This path has some requirements established here: http://on-demand.gputechconf.com/gtc/2014/presentations/S4379-opengl-44-scene-rendering-techniques.pdf#page=24 Instead of using the stream buffer, this commits moves constant buffers uploads to calls of glNamedBufferSubData and from my testing it brings a performance improvement. This is disabled when the vendor is not Nvidia since it brings performance regressions.
* video_core: Silent miscellaneous warnings (#2820)Rodrigo Locatti2019-08-302-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | * texture_cache/surface_params: Remove unused local variable * rasterizer_interface: Add missing documentation commentary * maxwell_dma: Remove unused rasterizer reference * video_core/gpu: Sort member declaration order to silent -Wreorder warning * fermi_2d: Remove unused MemoryManager reference * video_core: Silent unused variable warnings * buffer_cache: Silent -Wreorder warnings * kepler_memory: Remove unused MemoryManager reference * gl_texture_cache: Add missing override * buffer_cache: Add missing include * shader/decode: Remove unused variables
* Buffer Cache: Adress Feedback.Fernando Sahmkow2019-08-211-4/+3
|
* Buffer_Cache: Implement flushing.Fernando Sahmkow2019-08-211-1/+26
|
* Buffer_Cache: Implement barriers.Fernando Sahmkow2019-08-211-0/+4
|
* Buffer_Cache: Optimize and track written areas.Fernando Sahmkow2019-08-212-12/+104
|
* BufferCache: Rework mapping caching.Fernando Sahmkow2019-08-212-49/+76
|
* Buffer_Cache: Fixes and optimizations.Fernando Sahmkow2019-08-212-68/+38
|
* Video_Core: Implement a new Buffer CacheFernando Sahmkow2019-08-213-0/+498