summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_shader_decompiler.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spirv: Initial SPIR-V supportReinUsesLisp2021-07-231-99/+0
|
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp2021-01-031-4/+2
| | | | | | | 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.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-4/+4
| | | | | | | | | | | | | | 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: Resolve more variable shadowing scenarios pt.2Lioncash2020-12-051-4/+4
| | | | | | | Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
* vk_shader_decompiler: Implement force early fragment testsReinUsesLisp2020-11-261-0/+1
| | | | | | | | Force early fragment tests when the 3D method is enabled. The established pipeline cache takes care of recompiling if needed. This is implemented only on Vulkan to avoid invalidating the shader cache on OpenGL.
* Address PR feedback from Reinameerj2020-11-251-2/+1
|
* vulkan_renderer: Alpha Test Culling Implementationameerj2020-11-251-0/+3
| | | | Used by various textures in many titles, e.g. SSBU menu.
* vk_rasterizer: Implement storage texelsReinUsesLisp2020-06-021-3/+6
| | | | | | This is the equivalent of an image buffer on OpenGL. - Used by Octopath Traveler
* vk_rasterizer: Implement constant attributesReinUsesLisp2020-05-131-1/+2
| | | | | | | | | | Constant attributes (in OpenGL known disabled attributes) are not supported on Vulkan, even with extensions. To emulate this behavior we return zero on reads from disabled vertex attributes in shader code. This has no caching cost because attribute formats are not dynamic state on Vulkan and we have to store it in the pipeline cache anyway. - Fixes Animal Crossing: New Horizons terrain borders
* vulkan: Remove unnecessary includesLioncash2020-04-291-4/+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.
* vk_shader_decompiler: Use registry for specializationReinUsesLisp2020-03-131-9/+4
|
* vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp2020-01-241-3/+0
| | | | | | | | | Some games like The Legend of Zelda: Breath of the Wild assign render targets without writing them from the fragment shader. This generates Vulkan validation errors, so silence these I previously introduced a commit to set "vec4(0, 0, 0, 1)" for these attachments. The problem is that this is not what games expect. This commit reverts that change.
* vk_shader_decompiler: Skip NDC correction when it is nativeReinUsesLisp2019-12-191-0/+1
| | | | | Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
* vk_shader_decompiler: Normalize output fragment attachmentsReinUsesLisp2019-12-191-0/+3
| | | | | | Some games write from fragment shaders to an unexistant framebuffer attachment or they don't write to one when it exists in the framebuffer. Fix this by skipping writes or adding zeroes.
* vk_shader_decompiler: Misc changesReinUsesLisp2019-12-101-20/+54
| | | | | | | | Update Sirit and its usage in vk_shader_decompiler. Highlights: - Implement tessellation shaders - Implement geometry shaders - Implement some missing features - Use native half float instructions when available.
* video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp2019-11-231-1/+1
|
* vk_shader_decompiler: Misc fixesReinUsesLisp2019-05-261-2/+6
| | | | | | | | | | | | Fix missing OpSelectionMerge instruction. This caused devices loses on most hardware, Intel didn't care. Fix [-1;1] -> [0;1] depth conversions. Conditionally use VK_EXT_scalar_block_layout. This allows us to use non-std140 layouts on UBOs. Update external Vulkan headers.
* vk_shader_decompiler: Declare and stub interface for a SPIR-V decompilerReinUsesLisp2019-04-101-0/+80