summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_texture_cache.h (unfollow)
Commit message (Collapse)AuthorFilesLines
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.