aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/util_shaders.cpp
AgeCommit message (Collapse)Author
2023-08-06glAmeer J
2023-05-28OpenGL: Make use of persistent buffer maps in buffer cache downloadsameerj
Persistent buffer maps were already used by the texture cache, this extends their usage for the buffer cache. In my testing, using the memory maps for uploads was slower than the existing "ImmediateUpload" path, so the memory map usage is limited to downloads for the time being.
2023-02-11texture_cache: OpenGL: Implement MSAA uploads and copiesameerj
2022-06-13common: Change semantics of UNREACHABLE to unconditionally crashLiam
2022-04-23general: Convert source file copyright comments over to SPDXMorph
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-06OpenGL: fix S8D24 to ABGR8 conversionsLiam
2021-09-16host_shaders: Remove opengl_copy_bgra.compameerj
2021-09-16gl_texture_cache: Migrate BGRCopyPass from util_shadersameerj
The BGR copies no longer use shaders.
2021-09-15util_shaders: Unify BGRA copy passesameerj
2021-08-01astc_decoder: Reduce workgroup sizeameerj
This reduces the amount of over dispatching when there are odd dimensions (i.e. ASTC 8x5), which rarely evenly divide into 32x32.
2021-08-01astc_decoder: Compute offset swizzles in-shaderameerj
Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
2021-07-31astc_decoder: Optimize the use EncodingDataameerj
This buffer was a list of EncodingData structures sorted by their bit length, with some duplication from the cpu decoder implementation. We can take advantage of its sorted property to optimize its usage in the shader. Thanks to wwylele for the optimization idea.
2021-07-22renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp
Ensures that states set for a particular stage are not attached to other stages which may not need them.
2021-07-22gl_shader_util: Move shader utility code to a separate fileReinUsesLisp
2021-07-22shader: Initial OpenGL implementationReinUsesLisp
2021-07-07util_shaders: Fix BindImageTexturelat9nq
According to https://gitlab.freedesktop.org/mesa/mesa/-/issues/3820#note_753371 we need to set these to true for use with 3D textures. Fixes BOTW teleporting on RadeonSI and iris.
2021-06-19util_shaders: Specify ASTC decoder memory barrier bitsameerj
2021-06-19astc_decoder.comp: Remove unnecessary LUT SSBOsameerj
We can move them to instead be compile time constants within the shader.
2021-06-19astc: Various robustness enhancements for the gpu decoderameerj
These changes should help in reducing crashes/drivers panics that may occur due to synchronization issues between the shader completion and later access of the decoded texture.
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-13host_shaders: Modify shader cmake integration to allow for larger shadersameerj
using a raw string to encapsulate the entire shader code limits us to shaders of size less than 2KB. This change overcomes this limitation.
2021-03-13renderer_opengl: Accelerate ASTC texture decoding with a compute shaderameerj
ASTC texture decoding is currently handled by a CPU decoder for GPU's without native ASTC decoding support (most desktop GPUs). This is the cause for noticeable performance degradation in titles which use the format extensively. This commit adds support to accelerate ASTC decoding using a compute shader on OpenGL for GPUs without native support.
2021-03-04renderer_opengl: Swizzle BGR textures on copyameerj
OpenGL does not natively support BGR internal formats, which causes many BGR textures to render incorrectly, with Red and Blue channels swapped. This commit aims to address this by swizzling the blue and red channels on texture copies when a BGR format is encountered.
2021-02-13gl_texture_cache: Lazily create non-sRGB texture views for sRGB formatsameerj
This creates non-sRGB texture views for sRGB texture formats to allow for interfacing with these views in compute shaders using imageLoad and imageStore. Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
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.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
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.