summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/texture_cache_base.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-06-17video_core: add samples check when find render targetFengChen1-6/+4
2023-06-16video_core: Use sampler IDs instead pointers in the pipeline configWollnashorn1-0/+12
The previous approach of storing pointers returned by `GetGraphicsSampler`/`GetComputeSampler` caused UB, as these functions can cause reallocation of the sampler slot vector and therefore invalidate the pointers
2023-05-25video_core: don't garbage collect during configurationLiam1-1/+0
2023-05-24texture_cache: process aliases and overlaps in the correct orderFernando Sahmkow1-0/+16
2023-05-23renderer_vulkan: barrier attachment feedback loopsLiam1-0/+3
2023-05-07Texture cache: Only force flush the dma downloadsFernando Sahmkow1-1/+1
2023-05-07GPU: Add Reactive flushingFernando Sahmkow1-0/+2
2023-04-29Texture Cache: Release stagging buffers on tick frameFernando Sahmkow1-0/+1
2023-04-29Address Feedback & Clang FormatFernando Sahmkow1-5/+0
2023-04-29Accelerate DMA: Use texture cache async downloads to perform the copiesFernando Sahmkow1-4/+19
to host. WIP
2023-04-29TextureCache: refactor DMA downloads to allow multiple buffers.Fernando Sahmkow1-1/+5
2023-03-07Refactor AccelerateDMA codeameerj1-2/+8
2023-03-05Engines: Implement Accelerate DMA Texture.Fernando Sahmkow1-0/+5
2023-02-22texture_cache: Add async texture decodingameerj1-0/+16
2023-01-05video_core: Implement opengl/vulkan draw_textureFeng Chen1-0/+3
2023-01-04Texture Cache: Implement async texture downloads.Fernando Sahmkow1-1/+5
2023-01-01RasterizerMemory: Add filtering for flushing/invalidation operations.Fernando Sahmkow1-1/+1
2022-12-25texture_cache: Use Common::ScratchBuffer for swizzle buffersameerj1-2/+3
2022-12-25texture_cache: Use pre-allocated buffer for texture uploadsameerj1-1/+4
2022-11-24Fermi2D: Rework blit engine and add a software blitter.Fernando Sahmkow1-4/+4
2022-11-23general: fix compile for Apple ClangLiam1-2/+1
2022-10-06general: Format licenses as per SPDX guidelinesMorph1-4/+2
2022-10-06Texture cache: Fix the remaining issues with memory mnagement and unmapping.Fernando Sahmkow1-2/+2
2022-10-06Refactor VideoCore to use AS sepparate from Channel.Fernando Sahmkow1-56/+40
2022-10-06VideoCore: implement channels on gpu caches.Fernando Sahmkow1-18/+55
2022-08-20code: dodge PAGE_SIZE #defineKyle Kienapfel1-5/+5
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
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
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.
2022-03-26Revert "Memory GPU <-> CPU: reduce infighting in the texture cache by adding CPU Cached memory."bunnei1-11/+0
2022-03-25Texture Cache: Add Cached CPU system.Fernando Sahmkow1-0/+11
2022-03-25Buffer Cache: Tune to the levels of the new GC.Fernando Sahmkow1-2/+0
2022-03-25Garbage Collection: Redesign the algorithm to do a better use of memory.Fernando Sahmkow1-2/+7
2022-03-19video_core: Reduce unused includesameerj1-1/+0
2021-11-27Texture Cache: Redesigning the blitting system (again).Fernando Sahmkow1-1/+2
2021-11-20TextureCache: Implement buffer copies on Vulkan.Fernando Sahmkow1-2/+0
2021-11-17texture_cache: Use pixel format conversion when supported by the runtimeameerj1-0/+2
2021-11-16texture_cache: Refactor Render Target scaling functionameerj1-0/+5
2021-11-16TextureCache: Improve Reaper.FernandoS271-1/+1
2021-11-16Texture Cache: ease the requirements of textures being blacklisted.Fernando Sahmkow1-2/+0
2021-11-16Texture Cache: Fix downscaling and correct memory comsumption.Fernando Sahmkow1-1/+1
2021-11-16texture_cache_base: Remove unused function declarationsameerj1-8/+0
2021-11-16texture_cache: Refactor scaled image size calculationameerj1-0/+1
2021-11-16shader, video_core: Fix GCC build errorsameerj1-7/+3
2021-11-16texture_cache: Add getter to query if image view is rescaledReinUsesLisp1-6/+3
2021-11-16texture_cache: Simplify image view queries and blacklistingReinUsesLisp1-12/+18
2021-11-16Texture Cache: Implement Blacklisting.Fernando Sahmkow1-0/+2
2021-11-16texture_cache: Add image gettersReinUsesLisp1-0/+6
2021-11-16TextureCache: Fix rescaling of ImageCopiesFernando Sahmkow1-1/+1
2021-11-16TextureCache: Modify Viewports/Scissors according to Rescale.Fernando Sahmkow1-0/+3
2021-11-16Texture Cache: More rescaling fixes.Fernando Sahmkow1-3/+3
2021-11-16Texture Cache: Implement Vulkan UpScaling & DownScalingFernando Sahmkow1-0/+3
2021-11-16VideoCore: Initial Setup for the Resolution Scaler.Fernando Sahmkow1-0/+10
2021-10-03gpu: Migrate implementation to the cpp fileameerj1-7/+1
2021-08-28VideoCore: Rework Garbage Collection.Fernando Sahmkow1-1/+7
2021-08-08texture_cache: Address ameerj's reviewyzct123451-7/+0
2021-08-07texture_cache: Address ameerj's reviewyzct123451-10/+0
2021-08-05texture_cache: Don't change copyright yearyzct123451-1/+1
2021-08-05texture_cache: Address ameerj's reviewyzct123451-0/+0
2021-08-05texture_cache: Split templates outyzct123451-1527/+1
2021-07-23texture_cache: Reduce invalid image/sampler error severityReinUsesLisp1-7/+7
2021-07-23shader: Implement SULD and SUSTReinUsesLisp1-0/+8
2021-07-23shader: Interact texture buffers with buffer cacheReinUsesLisp1-4/+9
2021-07-18texture_cache: Always prepare image views on render targetsReinUsesLisp1-0/+6
Images used as render targets were not being "prepared", causing desynchronizations on the texture cache. Needs #6669 to avoid performance regressions on certain cooking titles. - Fixes black shadows on Age of Calamity.
2021-07-08Out of bound blit (#6531)Feng Chen1-56/+15
* Fix out of bound blit error * Fix code read * Fix ci error Co-authored-by: Feng Chen <chen.feng@gloritysolutions.com>
2021-07-04Texture Cache: Fix collision with multiple overlaps of the same sparse texture.Fernando Sahmkow1-1/+6
2021-07-04Texture Cache: Fix GCC & Clang.Fernando Sahmkow1-7/+7
2021-07-04Texture Cache: Address feedback.Fernando Sahmkow1-9/+7
2021-07-04Texture Cache: Improve accuracy of sparse texture detection.Fernando Sahmkow1-98/+212
2021-07-04Texture Cache: Initial Implementation of Sparse Textures.Fernando Sahmkow1-17/+231
2021-07-03TextureCache: Fix 1D to 2D overlapps.Fernando Sahmkow1-3/+0
2021-06-26buffer_cache/texture_cache: Make GC functions privateReinUsesLisp1-3/+3
2021-06-24common: Replace common_sizes into user-literalsWunkolo1-6/+6
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.
2021-06-22Reaper: Set minimum cleaning limit on OGL.Fernando Sahmkow1-1/+4
2021-06-20Reaper: Guarantee correct deletion.Fernando Sahmkow1-2/+3
2021-06-17Reaper: Change memory restrictions on TC depending on host memory on VK.Fernando Sahmkow1-15/+31
2021-06-16Reaper: Address Feedback.Fernando Sahmkow1-13/+25
2021-06-16Reaper: Setup settings and final tuning.Fernando Sahmkow1-25/+30
2021-06-16Reaper: Tune it up to be an smart GC.Fernando Sahmkow1-8/+76
2021-06-16Initial Reaper SetupReinUsesLisp1-11/+33
WIP
2021-05-08texture_cache: Handle out of bound texture blitsameerj1-8/+49
Some games interleave a texture blit using regions which are out-of-bounds. This addresses the interleaving to avoid oob reads from the src texture.
2021-03-04texture_cache: Blacklist BGRA8 copies and views on OpenGLameerj1-6/+9
In order to force the BGRA8 conversion on Nvidia using OpenGL, we need to forbid texture copies and views with other formats. This commit also adds a boolean relating to this, as this needs to be done only for the OpenGL api, Vulkan must remain unchanged.
2021-02-13vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp1-19/+19
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.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp1-18/+10
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.
2021-01-07texture_cache: Replace PAGE_SHIFT with PAGE_BITSMerryMage1-6/+6
PAGE_SHIFT is a #define in system headers that leaks into user code on some systems
2021-01-04gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp1-5/+10
Intel and AMD proprietary drivers are incapable of rendering to texture views of different formats than the original texture. Avoid creating these at a cache level. This will consume more memory, emulating them with copies.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-1123/+1274
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.
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash1-3/+2
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp1-28/+23
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.
2020-07-13video_core: Rearrange pixel format namesReinUsesLisp1-4/+4
Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs.
2020-07-10configuration: implement per-game configurations (#4098)lat9nq1-1/+1
* 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>
2020-06-27texture_cache: Test format compatibility before copyingReinUsesLisp1-5/+20
Avoid illegal copies. This intercepts the last step of a copy to avoid generating validation errors or corrupting the driver on some instances. We can create views and emit copies accordingly in future commits and remove this last-step validation.
2020-06-20texture_cache: Fix incorrect address used in a DeduceSurface() callLioncash1-1/+1
Previously the source was being deduced twice in a row.
2020-06-08texture_cache: Port original code management for 2D vs 3D texturesReinUsesLisp1-15/+34
Handle blits to images as 2D, even when they have block depth. - Fixes rendering issues on Luigi's Mansion 3
2020-06-08texture_cache: Simplify blit codeReinUsesLisp1-9/+7
2020-06-08texture_cache: Handle 3D texture blits with one layerReinUsesLisp1-1/+6
2020-06-08texture_cache: Implement rendering to 3D texturesReinUsesLisp1-68/+51
This allows rendering to 3D textures with more than one slice. Applications are allowed to render to more than one slice of a texture using gl_Layer from a VTG shader. This also requires reworking how 3D texture collisions are handled, for now, this commit allows rendering to slices but not to miplevels. When a render target attempts to write to a mipmap, we fallback to the previous implementation (copying or flushing as needed). - Fixes color correction 3D textures on UE4 games (rainbow effects). - Allows Xenoblade games to render to 3D textures directly.
2020-05-30texture_cache: More relaxed reconstructionReinUsesLisp1-13/+9
Only reupload textures when they've not been modified from the GPU.
2020-05-30texture_cache: Only copy textures that were modified from hostReinUsesLisp1-2/+6
2020-05-30texture_cache: Reload textures when number of resources mismatchReinUsesLisp1-0/+9
2020-05-29texture_cache: Handle overlaps with multiple subresourcesReinUsesLisp1-27/+33
Implement more surface reconstruct cases. Allow overlaps with more than one layer and mipmap and copies all of them to the new texture. - Fixes textures moving around objects on Xenoblade games
2020-05-27texture_cache: Use unordered_map::find instead of operator[] on hot codeReinUsesLisp1-15/+19
2020-05-27texture_cache: Use small vector for surface vectorsReinUsesLisp1-9/+10
This avoids most heap allocations when collecting surfaces into a vector.
2020-05-26texture_cache: Fix layered null surfacesReinUsesLisp1-1/+3
Null texture cubes were not considered arrays, causing issues on Vulkan and OpenGL when creating views.
2020-04-27texture_cache: Reintroduce preserve_contents accuratelyReinUsesLisp1-25/+41
This reverts commit 94b0e2e5dae4e0bd0021ac2d8fe1ff904a93ee69. preserve_contents proved to be a meaningful optimization. This commit reintroduces it but properly implemented on OpenGL. We have to make sure the clear removes all the previous contents of the image. It's not currently implemented on Vulkan because we can do smart things there that's preferred to be introduced in a separate commit.
2020-04-23shader_ir: Turn classes into data structuresReinUsesLisp1-2/+2
2020-04-22Address Feedback.Fernando Sahmkow1-9/+6
2020-04-22Address Feedback.Fernando Sahmkow1-32/+18
2020-04-22FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow1-0/+7
2020-04-22Rasterizer: Disable fence managing in synchronous gpu.Fernando Sahmkow1-1/+1
2020-04-22ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow1-0/+15
2020-04-22FenceManager: Implement should wait.Fernando Sahmkow1-0/+11
2020-04-22OpenGL: Implement Fencing backend.Fernando Sahmkow1-1/+31
2020-04-22TextureCache: Flush linear textures after finishing rendering.Fernando Sahmkow1-2/+8
2020-04-22GPU: Refactor synchronization on Async GPUFernando Sahmkow1-2/+2
2020-04-22Texture Cache: Implement OnCPUWrite and SyncGuestHostFernando Sahmkow1-3/+45
2020-04-22UI: Replasce accurate GPU option for GPU Accuracy LevelFernando Sahmkow1-4/+4
2020-04-16video_core: Amend doxygen comment referencesLioncash1-4/+4
Fixes broken documentation references.
2020-04-16CMakeLists: Specify -Wextra on linux buildsLioncash1-1/+2
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
2020-04-15Texture Cache: Only do buffer copies on accurate GPU. (#3634)Fernando Sahmkow1-1/+3
This is a simple optimization as Buffer Copies are mostly used for texture recycling. They are, however, useful when games abuse undefined behavior but most 3D APIs forbid it.
2020-04-11texture_cache: Remove preserve_contentsReinUsesLisp1-41/+25
preserve_contents was always true. We can't assume we don't have to preserve clears because scissored and color masked clears exist. This removes preserve_contents and assumes it as true at all times.
2020-04-06Texture Cache: Use vAddr instead of physical memory for caching.Fernando Sahmkow1-64/+57
2020-04-01video_core: Use native ASTC when availableReinUsesLisp1-2/+4
2020-03-12texture_cache: Report incompatible textures as blackReinUsesLisp1-2/+39
Some games bind incompatible texture types to certain types. For example Astral Chain binds a 2D texture with 1 layer (non-array) to a cubemap slot (that's how it's used in the shader). After testing this in hardware, the expected "undefined behavior" is to report all pixels as black. We already have a path for reporting black textures in the texture cache. When textures types are incompatible, this commit binds these kind of textures. This is done on the API agnostic texture cache so no extra code has to be inserted on OpenGL or Vulkan. As a side effect, this fixes invalidations of ASTC textures on Astral Chain. This happened because yuzu detected a cube texture and forced 6 faces, generating a texture larger than what the TIC reported.
2020-02-28renderer_opengl: Reintroduce dirty flags for render targetsReinUsesLisp1-1/+19
2020-02-28gl_rasterizer: Remove dirty flagsReinUsesLisp1-19/+1
2020-02-16texture_cache: Implement layered framebuffer attachmentsReinUsesLisp1-4/+1
Layered framebuffer attachments is a feature that allows applications to write attach layered textures to a single attachment. What layer the fragments are written to is decided from the shader using gl_Layer.
2020-02-16texture_cache: Avoid matches in 3D texturesReinUsesLisp1-8/+11
Code before this commit was trying to match 3D textures with another target. Fix that.
2019-12-22Texture Cache: Improve documentationFernando Sahmkow1-3/+4
2019-12-22Texture Cache: Address FeedbackFernando Sahmkow1-8/+8
2019-12-22Texture Cache: Add HLE methods for building 3D textures within the GPU in certain scenarios.Fernando Sahmkow1-0/+88
This commit adds a series of HLE methods for handling 3D textures in general. This helps games that generate 3D textures on every frame and may reduce loading times for certain games.
2019-11-20Texture_Cache: Redo invalid Surfaces handling.Fernando Sahmkow1-32/+83
This commit aims to redo the full setup of invalid textures and guarantee correct behavior across backends in the case of finding one by using black dummy textures that match the target of the expected texture.
2019-11-15texture_cache: Use a table instead of switch for texture formatsReinUsesLisp1-2/+5
Use a large flat array to look up texture formats. This allows us to properly implement formats with different component types. It should also be faster.
2019-11-14texture_cache: Drop abstracted ComponentTypeReinUsesLisp1-6/+3
Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour.
2019-10-16texture_cache: Avoid unnecessary surface copies within PickStrategy() and TryReconstructSurface()Lioncash1-2/+2
We can take these by const reference and avoid making unnecessary copies, preventing some atomic reference count increments and decrements.
2019-10-15video_core/texture_cache: Amend Doxygen referencesLioncash1-57/+78
Amends the doxygen comments so that they properly resolve. While we're at it, we can correct some typos and fix up some of the comments' formatting in order to make them slightly nicer to read.
2019-10-05Texture_Cache: Blit Deduction corrections and simplifications.Fernando Sahmkow1-18/+20
2019-10-05TextureCache: Add the ability to deduce if two textures are depth on blit.Fernando Sahmkow1-2/+142
2019-09-06gl_rasterizer: Implement image bindingsReinUsesLisp1-1/+16
2019-09-06texture_cache: Pass TIC to texture cacheReinUsesLisp1-4/+4
2019-08-30video_core: Silent miscellaneous warnings (#2820)Rodrigo Locatti1-2/+0
* 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
2019-07-17Texture_Cache: Rebase FixesFernando Sahmkow1-6/+0
2019-07-17Maxwell3D: Rework the dirty system to be more consistant and scaleableFernando Sahmkow1-5/+12
2019-07-14Texture_Cache: Address FeedbackFernando Sahmkow1-7/+10
2019-07-14Texture_Cache: Remove some unprecise fallback case and clang formatFernando Sahmkow1-9/+0
2019-07-14Texture_Cache: Force Framebuffer reset if an active render target is unregistered.Fernando Sahmkow1-6/+19
2019-06-30texture_cache: Pack sibling queries inside a methodReinUsesLisp1-6/+8
2019-06-30texture_cache: Use std::vector reservation for sampled_texturesReinUsesLisp1-17/+10
2019-06-30texture_cache: Style changesReinUsesLisp1-2/+1
2019-06-29texture_cache: Use std::array for siblings_tableReinUsesLisp1-10/+13
2019-06-29texture_cache: Address feedbackReinUsesLisp1-10/+11
2019-06-26texture_cache: Correct variable naming.Fernando Sahmkow1-3/+3
2019-06-26texture_cache: Corrections, documentation and assertsFernando Sahmkow1-42/+42
2019-06-25texture_cache: Query MemoryManager from the systemFernando Sahmkow1-11/+7
2019-06-24texture_cache: Include "core/core.h"ReinUsesLisp1-4/+1
2019-06-21texture_cache: Style and CorrectionsFernando Sahmkow1-0/+1
2019-06-21texture_cache: Eliminate linear textures fallthroughFernando Sahmkow1-4/+0
2019-06-21texture_cache: Correct format R16U as siblingFernando Sahmkow1-1/+1
2019-06-21texture_cache: Implement texception detection and texture barriers.Fernando Sahmkow1-5/+32
2019-06-21surface: Correct format S8Z24Fernando Sahmkow1-4/+0
2019-06-21texture_cache: Initialize all siblings to invalid pixel format.Fernando Sahmkow1-6/+15
2019-06-21decoders: correct block calculationFernando Sahmkow1-0/+16
2019-06-21texture_cache: Use siblings textures on Rebuild and fix possible error on blittingFernando Sahmkow1-10/+23
2019-06-21texture_cache: Implement siblings texture formats.Fernando Sahmkow1-12/+27
2019-06-21texture_cache: eliminate accelerated depth->color/color->depth copies due to driver instability.Fernando Sahmkow1-8/+1
2019-06-21texture_cache: correct mutex locksFernando Sahmkow1-4/+4
2019-06-21texture_cache: Don't Image Copy if component types differFernando Sahmkow1-1/+2
2019-06-21texture_cache: Optimize GetSurface and use references on functions that don't change a surface.Fernando Sahmkow1-6/+6
2019-06-21texture_cache: Implement Buffer Copy and detect Turing GPUs Image CopiesFernando Sahmkow1-9/+31
2019-06-21texture_cache uncompress-compress is untopological.Fernando Sahmkow1-12/+14
This makes conflicts between non compress and compress textures to be auto recycled. It also limits the amount of mipmaps a texture can have if it goes above it's limit.
2019-06-21texture_cache: Correct copying between compressed and uncompressed formatsFernando Sahmkow1-5/+3
2019-06-21texture_cache: Only load on recycle with accurate GPU.Fernando Sahmkow1-2/+3
Testing so far has proven this to be quite safe as texture memory read added a 2-5ms load to the current cache.
2019-06-21texture_cache: Handle uncontinuous surfaces.Fernando Sahmkow1-7/+10
2019-06-21texture_cache: return null surface on invalid addressFernando Sahmkow1-0/+12
2019-06-21texture_cache: Fermi2D reform and implement View MirageFernando Sahmkow1-15/+25
This also does some fixes on compressed textures reinterpret and on the Fermi2D engine in general.
2019-06-21texture_cache: loose TryReconstructSurface when accurate GPU is not on.Fernando Sahmkow1-2/+18
Also corrects some asserts.
2019-06-21texture_cache: Document the most important methods.Fernando Sahmkow1-8/+87
2019-06-21texture_cache: Try to Reconstruct Surface on bigger than overlap.Fernando Sahmkow1-4/+11
This fixes clouds in SMO Cap Kingdom and lens on Cloud Kingdom. Also moved accurate_gpu setting check to Pick Strategy
2019-06-21texture_cache: Implement Guard mechanismFernando Sahmkow1-1/+8
2019-06-21gl_framebuffer_cache: Use a hashed struct to cache framebuffersReinUsesLisp1-1/+1
2019-06-21texture_cache return invalid buffer on deactivated color_maskFernando Sahmkow1-0/+5
2019-06-21texture_cache: Add ASync ProtectionsFernando Sahmkow1-0/+10
2019-06-21Remove Framebuffer reconfiguration and restrict rendertarget protectionFernando Sahmkow1-21/+9
2019-06-21texture_cache: Implement GPU Dirty FlagsFernando Sahmkow1-15/+22
2019-06-21texture_cache: Implement L1_Inner_cacheFernando Sahmkow1-13/+30
2019-06-21video_core: Use un-shifted block sizes to avoid integer divisionsReinUsesLisp1-0/+3
Instead of storing all block width, height and depths in their shifted form: block_width = 1U << block_shift; Store them like they are provided by the emulated hardware (their block_shift form). This way we can avoid doing the costly Common::AlignUp operation to align texture sizes and drop CPU integer divisions with bitwise logic (defined in Common::AlignBits).
2019-06-21texture_cache: Change internal cache from lists to vectorsReinUsesLisp1-6/+7
2019-06-21Reduce amount of size calculations.Fernando Sahmkow1-20/+20
2019-06-21texture_cache: Correct premature texceptionsFernando Sahmkow1-4/+22
Due to our current infrastructure, it is possible for a mipmap to be set on as a render target before a texception of that mipmap's superset be set afterwards. This is problematic as we rely on texture views to set up texceptions and protecting render targets targets for 3D texture rendering. One simple solution is to configure framebuffers after texture setup but this brings other problems. This solution, forces a reconfiguration of the framebuffers after such event happens.
2019-06-21texture_cache: Implement guest flushingFernando Sahmkow1-0/+14
2019-06-21Fixes to mipmap's process and reconstruct processFernando Sahmkow1-1/+1
2019-06-21Texture Cache: Implement Blitting and Fermi CopiesFernando Sahmkow1-4/+15
2019-06-21copy_params: Use constructor instead of C-like initializationReinUsesLisp1-14/+9
2019-06-21Change texture_cache chaching from GPUAddr to CacheAddrFernando Sahmkow1-61/+41
This also reverses the changes to make invalidation and flushing through the GPU address.
2019-06-21Corrections to Structural MatchingFernando Sahmkow1-3/+8
The texture will now be reconstructed if the width only matches on GoB alignment.
2019-06-21Implement Texture Cache V2Fernando Sahmkow1-88/+366
2019-06-21texture_cache: Remove execution context copies from the texture cacheReinUsesLisp1-49/+34
This is done to simplify the OpenGL implementation, it is needed for Vulkan.
2019-06-21texture_cache: Split texture cache into different filesReinUsesLisp1-0/+282