summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_shader_decompiler.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-07-23spirv: Initial SPIR-V supportReinUsesLisp1-99/+0
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp1-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.
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp1-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.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp1-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.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash1-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.
2020-11-26vk_shader_decompiler: Implement force early fragment testsReinUsesLisp1-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.
2020-11-25Address PR feedback from Reinameerj1-2/+1
2020-11-25vulkan_renderer: Alpha Test Culling Implementationameerj1-0/+3
Used by various textures in many titles, e.g. SSBU menu.
2020-06-02vk_rasterizer: Implement storage texelsReinUsesLisp1-3/+6
This is the equivalent of an image buffer on OpenGL. - Used by Octopath Traveler
2020-05-13vk_rasterizer: Implement constant attributesReinUsesLisp1-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
2020-04-29vulkan: Remove unnecessary includesLioncash1-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.
2020-03-13vk_shader_decompiler: Use registry for specializationReinUsesLisp1-9/+4
2020-01-24vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp1-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.
2019-12-19vk_shader_decompiler: Skip NDC correction when it is nativeReinUsesLisp1-0/+1
Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
2019-12-19vk_shader_decompiler: Normalize output fragment attachmentsReinUsesLisp1-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.
2019-12-10vk_shader_decompiler: Misc changesReinUsesLisp1-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.
2019-11-23video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp1-1/+1
2019-05-26vk_shader_decompiler: Misc fixesReinUsesLisp1-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.
2019-04-10vk_shader_decompiler: Declare and stub interface for a SPIR-V decompilerReinUsesLisp1-16/+25
2019-04-08Unify both sampler types.Fernando Sahmkow1-1/+2
2019-04-04video_core/renderer_opengl: Remove unnecessary includesLioncash1-1/+0
Quite a few unused includes have built up over time, particularly on core/memory.h. Removing these includes means the source files including those files will no longer need to be rebuilt if they're changed, making compilation slightly faster in this scenario.
2019-02-07gl_shader_disk_cache: Address miscellaneous feedbackReinUsesLisp1-4/+4
2019-02-07gl_shader_disk_cache: Save GLSL and entries into the precompiled fileReinUsesLisp1-60/+5
2019-02-07gl_shader_decompiler: Remove name entriesReinUsesLisp1-23/+7
2019-02-07shader_decode: Implement LDG and basic cbuf trackingReinUsesLisp1-0/+33
2019-01-30gl_shader_cache: Use explicit bindingsReinUsesLisp1-12/+0
2019-01-30shader_decode: Implement LDG and basic cbuf trackingReinUsesLisp1-0/+34
2019-01-15video_core: Rename glsl_decompiler to gl_shader_decompilerReinUsesLisp1-0/+0
2019-01-15video_core: Address feedbackReinUsesLisp1-1/+1
2019-01-15glsl_decompiler: ImplementationReinUsesLisp1-0/+88