summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/util_shaders.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-09-17host_shaders: Remove opengl_copy_bgra.compameerj1-2/+0
2021-09-17gl_texture_cache: Migrate BGRCopyPass from util_shadersameerj1-35/+0
The BGR copies no longer use shaders.
2021-09-16util_shaders: Unify BGRA copy passesameerj1-62/+23
2021-08-01astc_decoder: Reduce workgroup sizeameerj1-2/+2
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-shaderameerj1-9/+7
Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
2021-08-01astc_decoder: Optimize the use EncodingDataameerj1-9/+4
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-23renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp1-12/+7
Ensures that states set for a particular stage are not attached to other stages which may not need them.
2021-07-23gl_shader_util: Move shader utility code to a separate fileReinUsesLisp1-6/+5
2021-07-23shader: Initial OpenGL implementationReinUsesLisp1-7/+6
2021-07-07util_shaders: Fix BindImageTexturelat9nq1-2/+2
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 bitsameerj1-1/+6
2021-06-19astc_decoder.comp: Remove unnecessary LUT SSBOsameerj1-18/+3
We can move them to instead be compile time constants within the shader.
2021-06-19astc: Various robustness enhancements for the gpu decoderameerj1-4/+1
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 useameerj1-57/+39
2021-03-13astc_decoder: Reimplement LayersRodrigo Locatti1-29/+24
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 shadersameerj1-6/+2
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 shaderameerj1-1/+98
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 copyameerj1-0/+76
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 formatsameerj1-6/+7
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 uploadsReinUsesLisp1-9/+9
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 cacheReinUsesLisp1-9/+9
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 cacheReinUsesLisp1-0/+224
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.