aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
AgeCommit message (Collapse)Author
2021-03-25astc_decoder: Refactor for style and more efficient memory useameerj
2021-03-13astc_decoder: Reimplement LayersRodrigo Locatti
Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
2021-03-13renderer_vulkan: Accelerate ASTC decodingameerj
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2021-03-09Merge pull request #5891 from ameerj/bgra-oglRodrigo Locatti
renderer_opengl: Use compute shaders to swizzle BGR textures on copy
2021-03-04texture_cache: Blacklist BGRA8 copies and views on OpenGLameerj
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-23vk_command_pool: Reduce the command pool size from 4096 to 4ReinUsesLisp
This allows drivers to reuse memory more easily and preallocate less. The optimal number has been measured booting Pokémon Sword.
2021-02-21Merge pull request #5936 from Kelebek1/Offsetsbunnei
Offsets for TexelFetch and TextureGather in Vulkan
2021-02-19Merge pull request #5924 from ReinUsesLisp/inline-bindingsbunnei
vk_update_descriptor: Inline and improve code for binding buffers
2021-02-15vk_rasterizer: Fix loading shader addresses twiceReinUsesLisp
This was recently introduced on a wrongly rebased commit.
2021-02-15Merge pull request #5923 from ReinUsesLisp/vk-dirty-pipelinebunnei
fixed_pipeline_cache: Use dirty flags to lazily update key
2021-02-15Review 1Kelebek1
2021-02-15Implement texture offset support for TexelFetch and TextureGather and add ↵Kelebek1
offsets for Tlds Formatting
2021-02-13vk_resource_pool: Load GPU tick once and compare with itReinUsesLisp
Other minor style improvements. Rename free_iterator to hint_iterator, to describe better what it does.
2021-02-13vk_update_descriptor: Inline and improve code for binding buffersReinUsesLisp
Allow compilers with our settings inline hot code.
2021-02-13fixed_pipeline_cache: Use dirty flags to lazily update keyReinUsesLisp
Use dirty flags to avoid building pipeline key from scratch on each draw call. This saves a bit of unnecesary work on each draw call.
2021-02-13vk_master_semaphore: Mark gpu_tick atomic operations with relaxed orderReinUsesLisp
2021-02-13vk_staging_buffer_pool: Inline tick testsReinUsesLisp
Load the current tick to a local variable, moving it out of an atomic and allowing us to compare the value without going through a pointer each time. This should make the loop more optimizable.
2021-02-13gl_stream_buffer/vk_staging_buffer_pool: Fix size checkReinUsesLisp
Fix a tragic off-by-one condition that causes Vulkan's stream buffer to think it's always full, using fallback memory. The OpenGL was also affected by this bug to a lesser extent.
2021-02-13video_core: Fix clang build issuesReinUsesLisp
2021-02-13vk_staging_buffer_pool: Fix softlock when stream buffer overflowsReinUsesLisp
There was still a code path that could wait on a timeline semaphore tick that would never be signalled. While we are at it, make use of more STL algorithms.
2021-02-13vk_buffer_cache: Add support for null index buffersReinUsesLisp
Games can bind a null index buffer (size=0) where all indices are evaluated as zero. VK_EXT_robustness2 doesn't support this and all drivers segfault when a null index buffer is passed to vkCmdBindIndexBuffer. Workaround this by creating a 4 byte buffer and filling it with zeroes. If it's read out of bounds, robustness takes care of returning zeroes as indices.
2021-02-13vk_staging_buffer_pool: Get a staging buffer instead of waitingReinUsesLisp
Avoids waiting idle while the GPU finishes to do work, and fixes an issue where we'd wait forever if a single command buffer (logic tick) all the data.
2021-02-13buffer_cache: Skip cache on small uploads on VulkanReinUsesLisp
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.
2021-02-13vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp
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 cacheReinUsesLisp
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-02-13gpu: Report renderer errors with exceptionsReinUsesLisp
Instead of using a two step initialization to report errors, initialize the GPU renderer and rasterizer on the constructor and report errors through std::runtime_error.
2021-01-27vk_scheduler: Fix unaligned placement new expressionsReinUsesLisp
We were accidentaly creating an object in an unaligned memory address. Fix this by manually aligning the offset.
2021-01-24vk_graphics_pipeline: Fix narrowing conversion on MSVCReinUsesLisp
2021-01-24Merge pull request #5807 from ReinUsesLisp/vc-warningsLC
video_core: Silence the remaining gcc warnings and enforce them
2021-01-24Merge pull request #5363 from ReinUsesLisp/vk-image-usageRodrigo Locatti
vk_texture_cache: Support image store on sRGB images with VkImageViewUsageCreateInfo
2021-01-24vk_texture_cache: Support image store on sRGB images with ↵ReinUsesLisp
VkImageViewUsageCreateInfo 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.
2021-01-24video_core: Silence -Wmissing-field-initializers warningsReinUsesLisp
2021-01-24maxwell_to_vk: Silence -Wextra warnings about using different enum typesReinUsesLisp
2021-01-23vk_pipeline_cache: Properly bypass VertexA shadersReinUsesLisp
The VertexA stage is not yet implemented, but Vulkan is adding its descriptors, causing a discrepancy in the pushed descriptors and the template. This generally ends up in a driver side crash. Bypass the VertexA stage for now.
2021-01-20Merge pull request #5361 from ReinUsesLisp/vk-shader-commentbunnei
vk_shader_decompiler: Show comments as OpUndef with a type
2021-01-15vk_shader_decompiler: Show comments as OpUndef with a typeReinUsesLisp
Silence the new validation layer error about SPIR-V not allowing OpUndef on a OpTypeVoid, even when the SPIR-V spec doesn't say anything against it. They will be inserted as an undefined int to avoid SPIRV-Cross and validation errors, but only when a debugging tool is attached.
2021-01-15vk_texture_cache: Use Download memory types for texture flushesReinUsesLisp
Use the Download memory type where it matters.
2021-01-15vulkan_memory_allocator: Add "download" memory usage hintReinUsesLisp
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.
2021-01-15vulkan_common: Move allocator to the common directoryReinUsesLisp
Allow using the abstraction from the OpenGL backend.
2021-01-15renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp
"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 APIReinUsesLisp
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-15vk_buffer_cache: Remove unused functionReinUsesLisp
2021-01-12Merge pull request #5311 from ReinUsesLisp/fence-waitbunnei
vk_fence_manager: Use timeline semaphores instead of spin waits
2021-01-08Merge pull request #5231 from ReinUsesLisp/dyn-bindingsbunnei
renderer_vulkan/fixed_pipeline_state: Move enabled bindings to static state
2021-01-08vk_fence_manager: Use timeline semaphores instead of spin waitsReinUsesLisp
With timeline semaphores we can avoid creating objects. Instead of creating an event, grab the current tick from the scheduler and flush the current command buffer. When the fence has to be queried/waited, we can do so against the master semaphore instead of spinning on an event. If Vulkan supported NVN like events or fences, we could signal from the command buffer and wait for that without splitting things in two separate command buffers.
2021-01-06Merge pull request #5288 from ReinUsesLisp/workaround-garbageMorph
gl_texture_cache: Avoid format views on Intel and AMD
2021-01-05Merge pull request #5289 from ReinUsesLisp/vulkan-devicebunnei
vulkan_common: Move device abstraction to the common directory and allow surfaceless devices
2021-01-04Merge pull request #5292 from ReinUsesLisp/empty-setLC
vk_rasterizer: Skip binding empty descriptor sets on compute
2021-01-04vk_rasterizer: Skip binding empty descriptor sets on computeReinUsesLisp
Fixes unit tests where compute shaders had no descriptors in the set, making Vulkan drivers crash when binding an empty set.
2021-01-04renderer_vulkan/nsight_aftermath_tracker: Move to vulkan_commonReinUsesLisp