summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_texture_cache.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* shader: Implement SULD and SUSTReinUsesLisp2021-07-231-22/+90
|
* shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq2021-07-231-1/+1
| | | | | | | | | | | | | | | | | Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
* shader: Interact texture buffers with buffer cacheReinUsesLisp2021-07-231-53/+10
|
* shader: Add partial rasterizer integrationReinUsesLisp2021-07-231-64/+4
|
* vk_texture_cache: Use VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL when possibleReinUsesLisp2021-07-201-21/+35
| | | | Silences performance warnings generated from validation layers on each frame.
* Merge pull request #6679 from yzct12345/fix-lets-goFernando S2021-07-191-1/+4
|\ | | | | Fix Pokemon Let's Go on Vulkan
| * Update src/video_core/renderer_vulkan/vk_texture_cache.cppyzct123452021-07-191-1/+1
| | | | | | Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
| * Update src/video_core/renderer_vulkan/vk_texture_cache.cppyzct123452021-07-191-1/+1
| | | | | | Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
| * Ignore wrong blit formatyzct123452021-07-181-1/+4
| |
* | vk_texture_cache: Finalize renderpass when downloading imagesReinUsesLisp2021-07-181-0/+1
|/
* Reaper: Guarantee correct deletion.Fernando Sahmkow2021-06-201-0/+2
|
* Reaper: Change memory restrictions on TC depending on host memory on VK.Fernando Sahmkow2021-06-171-0/+4
|
* configure_graphics: Add Accelerate ASTC decoding settingameerj2021-06-161-1/+6
|
* texture_cache: Handle out of bound texture blitsameerj2021-05-081-20/+18
| | | | 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.
* vk_texture_cache: Swap R and B channels of color flipped formatameerj2021-04-251-1/+24
| | | | Swaps the Red and Blue channels of the A1B5G5R5_UNORM texture format, which was being incorrectly rendered.
* vk_texture_cache: Make use of Common::BitCast where applicableLioncash2021-04-121-5/+6
| | | | | Also clarify the TODO comment a little more on the lacking implementations for std::bit_cast.
* astc_decoder: Reimplement LayersRodrigo Locatti2021-03-131-21/+25
| | | | Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
* renderer_vulkan: Accelerate ASTC decodingameerj2021-03-131-4/+41
| | | | Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
* vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp2021-02-131-8/+6
| | | | | | | | 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-131-48/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #5363 from ReinUsesLisp/vk-image-usageRodrigo Locatti2021-01-241-26/+47
|\ | | | | vk_texture_cache: Support image store on sRGB images with VkImageViewUsageCreateInfo
| * vk_texture_cache: Support image store on sRGB images with VkImageViewUsageCreateInfoReinUsesLisp2021-01-241-26/+47
| | | | | | | | | | | | | | | | | | | | Vulkan 1.0 didn't support creating sRGB image views on an ABGR8 VkImage with storage usage bits. VK_KHR_maintenance2 addressed this allowing to reduce the usage bits on a VkImageView. To allow image store on non-sRGB image views when the VkImage is created with sRGB, always create VkImages without sRGB and add the sRGB format on the view.
* | vk_texture_cache: Use Download memory types for texture flushesReinUsesLisp2021-01-151-1/+9
| | | | | | | | Use the Download memory type where it matters.
* | vulkan_memory_allocator: Add "download" memory usage hintReinUsesLisp2021-01-151-3/+3
| | | | | | | | | | | | | | Allow users of the allocator to hint memory usage for downloads. This removes the non-descriptive boolean passed for "host visible" or not host visible memory commits, and uses an enum to hint device local, upload and download usages.
* | vulkan_common: Move allocator to the common directoryReinUsesLisp2021-01-151-1/+1
| | | | | | | | Allow using the abstraction from the OpenGL backend.
* | renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp2021-01-151-2/+2
| | | | | | | | | | "Memory manager" collides with the guest GPU memory manager, and a memory allocator sounds closer to what the abstraction aims to be.
* | vk_memory_manager: Improve memory manager and its APIReinUsesLisp2021-01-151-3/+3
|/ | | | | | | | | 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.
* renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp2021-01-041-1/+3
|
* renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp2021-01-031-4/+4
| | | | | | | 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.
* vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.hReinUsesLisp2020-12-311-1/+1
| | | | Allows sharing Vulkan wrapper code between different rendering backends.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-492/+981
| | | | | | | | | | | | | | 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: Remove unnecessary enum class casting in logging messagesLioncash2020-12-071-2/+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.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-4/+4
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* video_core: Resolve more variable shadowing scenarios pt.2Lioncash2020-12-051-30/+31
| | | | | | | Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
* renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp2020-09-191-11/+8
| | | | | | | | | | | | | | | | | | | | | | | 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.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-16/+18
| | | | | | | | | 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.
* vulkan: Silence more -Wmissing-field-initializer warningsLioncash2020-08-031-0/+2
|
* vulkan: Resolve -Wmissing-field-initializer warningsLioncash2020-07-251-0/+2
|
* Merge pull request #4324 from ReinUsesLisp/formatsbunnei2020-07-211-5/+5
|\ | | | | video_core: Fix, add and rename pixel formats
| * video_core: Rearrange pixel format namesReinUsesLisp2020-07-131-5/+5
| | | | | | | | | | | | Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs.
* | Merge pull request #4364 from lioncash/desig5bunnei2020-07-181-96/+135
|\ \ | | | | | | vulkan: Make use of designated initializers where applicable
| * | vk_texture_cache: Make use of designated initializers where applicableLioncash2020-07-171-96/+135
| |/
* / vk_texture_cache: Amend mismatched access masks and indices in UploadBufferLioncash2020-07-171-6/+4
|/ | | | | Discovered while converting relevant parts of the codebase over to designated initializers.
* texture_cache: Implement rendering to 3D texturesReinUsesLisp2020-06-081-14/+62
| | | | | | | | | | | | | | 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.
* vk_rasterizer: Implement storage texelsReinUsesLisp2020-06-021-2/+2
| | | | | | This is the equivalent of an image buffer on OpenGL. - Used by Octopath Traveler
* texture_cache: Implement depth stencil texture swizzlesReinUsesLisp2020-05-261-16/+13
| | | | | | | | Stop ignoring image swizzles on depth and stencil images. This doesn't fix a known issue on Xenoblade Chronicles 2 where an OpenGL texture changes swizzles twice before being used. A proper fix would be having a small texture view cache for this like we do on Vulkan.
* vulkan: Remove unnecessary includesLioncash2020-04-291-3/+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.
* renderer_vulkan: Drop Vulkan-HppReinUsesLisp2020-04-111-152/+210
|
* video_core: Use native ASTC when availableReinUsesLisp2020-04-011-17/+17
|
* vk_texture_cache: Silence misc warningsReinUsesLisp2020-03-191-3/+3
|
* vk_state_tracker: Initial implementationReinUsesLisp2020-02-281-0/+1
| | | | Add support for render targets and viewports.
* vk_texture_cache: Address feedbackReinUsesLisp2020-01-161-13/+4
|
* vk_texture_cache: Fix typo in commentaryRodrigo Locatti2020-01-161-1/+1
| | | Co-Authored-By: MysticExile <30736337+MysticExile@users.noreply.github.com>
* vk_texture_cache: Implement generic texture cache on VulkanReinUsesLisp2020-01-141-0/+484
It currently ignores PBO linearizations since these should be dropped as soon as possible on OpenGL.