summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_manager.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* OpenGL: Limit lmem warmup to NVIDIAameerj2023-06-261-4/+9
| | | | :frog:
* OpenGL: Add Local Memory warmup shaderameerj2023-06-261-1/+9
|
* video_core: Implement opengl/vulkan draw_textureFeng Chen2023-01-051-0/+121
|
* 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.
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-146/+0
|
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-0/+15
| | | | | | | | | | | | | | 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.
* gl_arb_decompiler: Use NV_shader_buffer_{load,store} on assembly shadersReinUsesLisp2020-07-181-29/+42
| | | | | | | | | | | | | | | | NV_shader_buffer_{load,store} is a 2010 extension that allows GL applications to use what in Vulkan is known as physical pointers, this is basically C pointers. On GLASM these is exposed through the LOAD/STORE/ATOM instructions. Up until now, assembly shaders were using NV_shader_storage_buffer_object. These work fine, but have a (probably unintended) limitation that forces us to have the limit of a single stage for all shader stages. In contrast, with NV_shader_buffer_{load,store} we can pass GPU addresses to the shader through local parameters (GLASM equivalent uniform constants, or push constants on Vulkan). Local parameters have the advantage of being per stage, allowing us to generate code without worrying about binding overlaps.
* gl_shader_manager: Unbind GLSL program when binding a host pipelineReinUsesLisp2020-05-261-0/+4
| | | | Fixes regression in Link's Awakening caused by 420cc13248350ef5c2d19e0b961cb4185cd16a8a
* renderer_opengl: Add assembly program code pathsReinUsesLisp2020-05-191-23/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code required to use OpenGL assembly programs based on NV_gpu_program5. Decompilation for ARB programs is intended to be added in a follow up commit. This does **not** include ARB decompilation and it's not in an usable state. The intention behind assembly programs is to reduce shader stutter significantly on drivers supporting NV_gpu_program5 (and other required extensions). Currently only Nvidia's proprietary driver supports these extensions. Add a UI option hidden for now to avoid people enabling this option accidentally. This code path has some limitations that OpenGL compatibility doesn't have: - NV_shader_storage_buffer_object is limited to 16 entries for a single OpenGL context state (I don't know if this is an intended limitation, an specification issue or I am missing something). Currently causes issues on The Legend of Zelda: Link's Awakening. - NV_parameter_buffer_object can't bind buffers using an offset different to zero. The used workaround is to copy to a temporary buffer (this doesn't happen often so it's not an issue). On the other hand, it has the following advantages: - Shaders build a lot faster. - We have control over how floating point rounding is done over individual instructions (SPIR-V on Vulkan can't do this). - Operations on shared memory can be unsigned and signed. - Transform feedbacks are dynamic state (not yet implemented). - Parameter buffers (uniform buffers) are per stage, matching NVN and hardware's behavior. - The API to bind and create assembly programs makes sense, unlike ARB_separate_shader_objects.
* gl_shader_manager: Fix interaction between graphics and computeReinUsesLisp2020-03-111-9/+22
| | | | | | | After a compute shader was set to the pipeline, no graphics shader was invoked again. To address this use glUseProgram to bind compute shaders (without state tracking) and call glUseProgram(0) when transitioning out of it back to the graphics pipeline.
* gl_state: Remove program trackingReinUsesLisp2020-02-281-11/+5
|
* gl_shader_manager: Remove unused variable in SetFromRegsReinUsesLisp2019-11-071-1/+0
|
* gl_rasterizer: Emulate viewport flipping with ARB_clip_controlReinUsesLisp2019-11-071-17/+2
| | | | | | | Emulates negative y viewports with ARB_clip_control. This allows us to more easily emulated pipelines with tessellation and/or geometry shader stages. It also avoids corrupting games with transform feedbacks and negative viewports (gl_Position.y was being modified).
* gl_rasterizer: Move alpha testing to the OpenGL pipelineReinUsesLisp2019-05-301-11/+0
| | | | Removes the alpha testing code from each fragment shader invocation.
* gl_shader_manager: Move code to source file and minor clean upReinUsesLisp2019-04-111-1/+33
|
* gl_shader_manager: Move using statement into the cpp fileLioncash2019-03-281-1/+3
| | | | | Avoids introducing Maxwell3D into the namespace for everything that includes the header.
* gl_shader_manager: Remove reliance on global accessor within MaxwellUniformData::SetFromRegs()Lioncash2019-03-281-7/+6
| | | | | | | | | We can just pass in the Maxwell3D instance instead of going through the system class to get at it. This also lets us simplify the interface a little bit. Since we pass in the Maxwell3D context now, we only really need to pass the shader stage index value in.
* gl_shader_decompiler: Implement S2R's Y_DIRECTIONReinUsesLisp2018-11-251-4/+6
|
* Use standard UBO and fix/stylize the codeFernandoS272018-10-221-0/+11
|
* gl_shader_decompiler: Implement geometry shadersReinUsesLisp2018-10-071-0/+8
|
* renderer_opengl: Implement a new shader cache.bunnei2018-08-281-29/+0
|
* renderer_opengl: Namespace OpenGL codeLioncash2018-08-221-2/+2
| | | | | | | Namespaces all OpenGL code under the OpenGL namespace. Prevents polluting the global namespace and allows clear distinction between other renderers' code in the future.
* Rasterizer: Implemented instanced rendering.Subv2018-08-151-1/+6
| | | | | | We keep track of the current instance and update an uniform in the shaders to let them know which instance they are. Instanced vertex arrays are not yet implemented.
* gl_shader_manager: Invert conditional in SetShaderUniformBlockBinding()Lioncash2018-08-041-7/+9
| | | | | This lets us indent the majority of the code and places the error case first.
* gl_shader_manager: Amend sign differences in an assertion comparison in SetShaderUniformBlockBinding()Lioncash2018-08-041-3/+2
| | | | | | | | Ensures both operands have the same sign in the comparison. While we're at it, we can get rid of the redundant casting of ub_size to an int. This type will always be trivial and alias a built-in type (not doing so would break backwards compatibility at a standard level).
* gl_shader_manager: Replace unimplemented function prototypeLioncash2018-07-211-2/+3
| | | | This was just a linker error waiting to happen.
* core: Don't construct instance of Core::System, just to access its live instanceLioncash2018-07-191-1/+1
| | | | | | | | | This would result in a lot of allocations and related object construction, just to toss it all away immediately after the call. These are definitely not intentional, and it was intended that all of these should have been accessing the static function GetInstance() through the name itself, not constructed instances.
* Build: Fixed some MSVC warnings in various parts of the code.Subv2018-06-201-2/+2
|
* GPU: Implement sampling multiple textures in the generated glsl shaders.Subv2018-06-061-19/+0
| | | | | | All tested games that use a single texture show no regression. Only Texture2D textures are supported right now, each shader gets its own "tex_fs/vs/gs" sampler array to maintain independent textures between shader stages, the textures themselves are reused if possible.
* general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-1/+1
|
* gl_shader_gen: Support vertical/horizontal viewport flipping. (#347)bunnei2018-04-181-1/+7
| | | | | | * gl_shader_gen: Support vertical/horizontal viewport flipping. * fixup! gl_shader_gen: Support vertical/horizontal viewport flipping.
* GPU: Upload the entirety of each constbuffer for each shader stage as SSBOs.Subv2018-04-151-8/+1
| | | | We're going to need the shader generator to give us a mapping of the actual used const buffers to properly bind them to the shader.
* shaders: Add NumTextureSamplers const, remove unused #pragma.bunnei2018-04-151-1/+1
|
* gl_shader_manager: Implement SetShaderSamplerBindings.bunnei2018-04-141-0/+8
|
* gl_shader_manager: Cleanup and consolidate uniform handling.bunnei2018-04-141-4/+15
|
* renderer_opengl: Add gl_shader_manager class.bunnei2018-04-141-0/+46