summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_texture_cache.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-03-07Refactor AccelerateDMA codeameerj1-0/+6
2023-02-14remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistencyarades791-1/+1
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-11texture_cache: OpenGL: Implement MSAA uploads and copiesameerj1-0/+7
2023-01-04Texture Cache: Implement async texture downloads.Fernando Sahmkow1-1/+5
2022-10-20video_core: don't build ASTC decoder shader unless requestedLiam1-4/+7
2022-10-06Vulkan Texture Cache: Limit render area to the max width/height of the targets.Fernando Sahmkow1-2/+3
2022-06-27video_core: Replace VKScheduler with Schedulergerman771-4/+4
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-25Garbage Collection: Redesign the algorithm to do a better use of memory.Fernando Sahmkow1-0/+4
2021-12-24vk_texture_cache: Use 3D scale helpers for MSAA texture scaling on Intel Windows driversameerj1-0/+2
Fixes a crash when scaling MSAA textures in titles such as Sonic Colors Ultimate.
2021-12-24vk_texture_cache: Fix invalidated pointer accessameerj1-1/+4
The vulkan ImageView held a reference to its source image for rescale status checking. This pointer is sometimes invalidated when the texture cache slot_images container is resized. To avoid an invalid pointer dereference, the ImageView now holds a reference to the container itself.
2021-12-05blit_image: Refactor upscale factors usageameerj1-3/+3
The image view itself can be queried to see if it is being rescaled or not, removing the need to pass the upscale/down shift factors from the texture cache.
2021-12-05vk_texture_cache: Add a function to ImageView to check if src image is rescaledameerj1-0/+6
2021-11-22TextureCache: Simplify blitting of D24S8 formats and fix bugs.Fernando Sahmkow1-0/+3
2021-11-20TextureCache: Implement buffer copies on Vulkan.Fernando Sahmkow1-1/+10
2021-11-17texture_cache: Use pixel format conversion when supported by the runtimeameerj1-0/+1
2021-11-17TextureCache: Fix OGL cleaningFernando Sahmkow1-0/+16
2021-11-16vk_texture_cache: Refactor 3D scaling helpersameerj1-0/+2
2021-11-16Texture Cache: fix memory managment and optimize scaled downloads, uploads.Fernando Sahmkow1-2/+2
2021-11-16Texture Cache: Fix downscaling and correct memory comsumption.Fernando Sahmkow1-0/+3
2021-11-16Texture Cache: Rescale conversions between depth and colorFernandoS271-1/+1
2021-11-16vk_texture_cache: Use 3D to scale images when blit is unsupportedameerj1-1/+10
2021-11-16video_core: Misc resolution scaling related refactoringameerj1-2/+5
2021-11-16vk_texture_cache: Simplify scaled image managementameerj1-20/+10
2021-11-16vk_texture_cache: Minor cleanupameerj1-1/+0
2021-11-16texture_cache: Simplify image view queries and blacklistingReinUsesLisp1-16/+25
2021-11-16Texture Cache: Implement Vulkan UpScaling & DownScalingFernando Sahmkow1-3/+7
2021-11-16VideoCore: Initial Setup for the Resolution Scaler.Fernando Sahmkow1-0/+19
2021-10-03gpu: Migrate implementation to the cpp fileameerj1-1/+1
2021-08-21vk_rasterizer: Only clear depth and stencil buffers when set in attachment aspect maskameerj1-0/+14
Silences validation errors for clearing the depth/stencil buffers of framebuffer attachments that were not specified to have depth/stencil usage.
2021-08-05texture_cache: Address ameerj's reviewyzct123451-1/+1
2021-07-23shader: Implement SULD and SUSTReinUsesLisp1-9/+14
2021-07-23shader: Interact texture buffers with buffer cacheReinUsesLisp1-15/+15
2021-07-23shader: Add partial rasterizer integrationReinUsesLisp1-27/+2
2021-06-20Reaper: Guarantee correct deletion.Fernando Sahmkow1-0/+8
2021-06-17Reaper: Change memory restrictions on TC depending on host memory on VK.Fernando Sahmkow1-0/+3
2021-05-08texture_cache: Handle out of bound texture blitsameerj1-3/+2
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-13astc_decoder: Reimplement LayersRodrigo Locatti1-4/+9
Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
2021-03-13renderer_vulkan: Accelerate ASTC decodingameerj1-3/+9
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2021-03-04texture_cache: Blacklist BGRA8 copies and views on OpenGLameerj1-0/+5
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-5/+4
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-19/+7
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-24video_core: Silence -Wmissing-field-initializers warningsReinUsesLisp1-1/+1
2021-01-15vk_texture_cache: Use Download memory types for texture flushesReinUsesLisp1-4/+1
Use the Download memory type where it matters.
2021-01-15vulkan_common: Move allocator to the common directoryReinUsesLisp1-1/+1
Allow using the abstraction from the OpenGL backend.
2021-01-15renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp1-1/+1
"Memory manager" collides with the guest GPU memory manager, and a memory allocator sounds closer to what the abstraction aims to be.
2021-01-15vk_memory_manager: Improve memory manager and its APIReinUsesLisp1-7/+6
Fix a bug where the memory allocator could leave gaps between commits. To fix this the allocation algorithm was reworked, although it's still short in number of lines of code. Rework the allocation API to self-contained movable objects instead of naively using an unique_ptr to do the job for us. Remove the VK prefix.
2021-01-04gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp1-0/+5
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.
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp1-3/+3
The "VK" prefix predates the "Vulkan" namespace. It was carried around the codebase for consistency. "VKDevice" currently is a bad alias with "VkDevice" (only an upcase character of difference) that can cause confusion. Rename all instances of it.
2020-12-31vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.hReinUsesLisp1-1/+1
Allows sharing Vulkan wrapper code between different rendering backends.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-140/+188
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-07renderer_vulkan: Add missing `override` specifiercomex1-1/+1
2020-12-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash1-4/+5
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash1-9/+9
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-09-19renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp1-10/+5
This reworks how host<->device synchronization works on the Vulkan backend. Instead of "protecting" resources with a fence and signalling these as free when the fence is known to be signalled by the host GPU, use timeline semaphores. Vulkan timeline semaphores allow use to work on a subset of D3D12 fences. As far as we are concerned, timeline semaphores are a value set by the host or the device that can be waited by either of them. Taking advantange of this, we can have a monolithically increasing atomic value for each submission to the graphics queue. Instead of protecting resources with a fence, we simply store the current logical tick (the atomic value stored in CPU memory). When we want to know if a resource is free, it can be compared to the current GPU tick. This greatly simplifies resource management code and the free status of resources should have less false negatives. To workaround bugs in validation layers, when these are attached there's a thread waiting for timeline semaphores.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp1-10/+6
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-06-08texture_cache: Implement rendering to 3D texturesReinUsesLisp1-21/+12
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-04-29vulkan: Remove unnecessary includesLioncash1-6/+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.
2020-04-11renderer_vulkan: Drop Vulkan-HppReinUsesLisp1-32/+32
2020-02-16texture_cache: Implement layered framebuffer attachmentsReinUsesLisp1-0/+4
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-01-16vk_texture_cache: Address feedbackReinUsesLisp1-9/+4
2020-01-14vk_texture_cache: Implement generic texture cache on VulkanReinUsesLisp1-0/+244
It currently ignores PBO linearizations since these should be dropped as soon as possible on OpenGL.