summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/util_shaders.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common: Change semantics of UNREACHABLE to unconditionally crashLiam2022-06-141-1/+1
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | 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.
* OpenGL: fix S8D24 to ABGR8 conversionsLiam2022-04-071-1/+23
|
* host_shaders: Remove opengl_copy_bgra.compameerj2021-09-171-2/+0
|
* gl_texture_cache: Migrate BGRCopyPass from util_shadersameerj2021-09-171-35/+0
| | | | The BGR copies no longer use shaders.
* util_shaders: Unify BGRA copy passesameerj2021-09-161-62/+23
|
* astc_decoder: Reduce workgroup sizeameerj2021-08-011-2/+2
| | | | This reduces the amount of over dispatching when there are odd dimensions (i.e. ASTC 8x5), which rarely evenly divide into 32x32.
* astc_decoder: Compute offset swizzles in-shaderameerj2021-08-011-9/+7
| | | | Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
* astc_decoder: Optimize the use EncodingDataameerj2021-08-011-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.
* renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp2021-07-231-12/+7
| | | | | Ensures that states set for a particular stage are not attached to other stages which may not need them.
* gl_shader_util: Move shader utility code to a separate fileReinUsesLisp2021-07-231-6/+5
|
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-7/+6
|
* util_shaders: Fix BindImageTexturelat9nq2021-07-071-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.
* util_shaders: Specify ASTC decoder memory barrier bitsameerj2021-06-191-1/+6
|
* astc_decoder.comp: Remove unnecessary LUT SSBOsameerj2021-06-191-18/+3
| | | | We can move them to instead be compile time constants within the shader.
* astc: Various robustness enhancements for the gpu decoderameerj2021-06-191-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.
* astc_decoder: Refactor for style and more efficient memory useameerj2021-03-251-57/+39
|
* astc_decoder: Reimplement LayersRodrigo Locatti2021-03-131-29/+24
| | | | Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
* host_shaders: Modify shader cmake integration to allow for larger shadersameerj2021-03-131-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.
* renderer_opengl: Accelerate ASTC texture decoding with a compute shaderameerj2021-03-131-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.
* renderer_opengl: Swizzle BGR textures on copyameerj2021-03-041-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.
* gl_texture_cache: Lazily create non-sRGB texture views for sRGB formatsameerj2021-02-131-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>
* vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp2021-02-131-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.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-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.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-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.