summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_manager.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* video_core: Implement opengl/vulkan draw_textureFeng Chen2023-01-051-112/+17
|
* 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.
* renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp2021-07-231-22/+78
| | | | | Ensures that states set for a particular stage are not attached to other stages which may not need them.
* gl_shader_cache: Rename Program abstractions into PipelineReinUsesLisp2021-07-231-1/+1
|
* gl_shader_manager: Zero initialize current assembly programsReinUsesLisp2021-07-231-1/+1
|
* gl_shader_manager: Remove unintentionally committed #pragmaReinUsesLisp2021-07-231-2/+0
|
* renderer_opengl: State track compute assembly programsReinUsesLisp2021-07-231-0/+19
|
* renderer_opengl: State track assembly programsReinUsesLisp2021-07-231-3/+48
|
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-64/+9
|
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-0/+6
| | | | | | | | | | | | | | 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-14/+3
| | | | | | | | | | | | | | | | 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.
* renderer_opengl: Add assembly program code pathsReinUsesLisp2020-05-191-23/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15/+14
| | | | | | | 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 completelyReinUsesLisp2020-02-281-1/+0
|
* gl_state: Remove program trackingReinUsesLisp2020-02-281-9/+8
|
* gl_rasterizer: Allow rendering without fragment shaderReinUsesLisp2019-12-261-0/+4
| | | | | Rendering without a fragment shader is usually used in depth-only passes.
* gl_rasterizer: Emulate viewport flipping with ARB_clip_controlReinUsesLisp2019-11-071-10/+5
| | | | | | | 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-7/+1
| | | | Removes the alpha testing code from each fragment shader invocation.
* gl_shader_manager: Move code to source file and minor clean upReinUsesLisp2019-04-111-33/+28
|
* Merge pull request #2321 from ReinUsesLisp/gl-state-reworkbunnei2019-04-071-1/+0
|\ | | | | gl_state: Rework to enable individual applies
| * gl_state: Rework to enable individual appliesReinUsesLisp2019-04-041-1/+0
| |
* | gl_shader_manager: Move using statement into the cpp fileLioncash2019-03-281-3/+1
| | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | | 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_manager: Amend Doxygen string for MaxwellUniformDataLioncash2019-03-271-3/+3
|/ | | | | Previously only one line of the whole comment was in proper Doxygen formatting.
* gl_shader_manager: Update pipeline when programs have changedReinUsesLisp2018-11-291-4/+17
|
* gl_shader_decompiler: Implement S2R's Y_DIRECTIONReinUsesLisp2018-11-251-3/+6
|
* fix viewport and scissor behaviorRodolfo Bogado2018-11-171-0/+1
|
* gl_resource_manager: Split implementations in .cpp file.Markus Wick2018-11-061-0/+1
| | | | | Those implementations are quite costly, so there is no need to inline them to the caller. Ressource deletion is often a performance bug, so in this way, we support to add breakpoints to them.
* Use standard UBO and fix/stylize the codeFernandoS272018-10-221-1/+7
|
* gl_shader_decompiler: Implement geometry shadersReinUsesLisp2018-10-071-1/+6
|
* gl_state: Pack sampler bindings into a single ARB_multi_bindReinUsesLisp2018-09-281-3/+0
|
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-1/+1
|
* renderer_opengl: Implement a new shader cache.bunnei2018-08-281-116/+10
|
* 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-2/+3
| | | | | | 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: Make ProgramManager's GetCurrentProgramStage() a const member functionLioncash2018-08-031-1/+1
| | | | This function doesn't modify class state, so it can be made const.
* gl_shader_manager: Take ShaderSetup instances by const reference in UseProgrammableVertexShader() and UseProgrammableFragmentShader()Lioncash2018-08-021-2/+2
| | | | | | | | | Avoids performing unnecessary copies of 65560 byte sized ShaderSetup instances, considering it's only used as part of lookup and not modified. Given the parameters were already const, it's likely taking these parameters by reference was intended but the ampersand was forgotten.
* gl_shader_manager: Replace unimplemented function prototypeLioncash2018-07-211-1/+0
| | | | This was just a linker error waiting to happen.
* GPU: Implement sampling multiple textures in the generated glsl shaders.Subv2018-06-061-1/+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.
* gl_shader_gen: Support vertical/horizontal viewport flipping. (#347)bunnei2018-04-181-3/+2
| | | | | | * gl_shader_gen: Support vertical/horizontal viewport flipping. * fixup! gl_shader_gen: Support vertical/horizontal viewport flipping.
* GPU: Don't use explicit binding points when uploading the constbuffers to opengl.Subv2018-04-151-0/+11
| | | | The bindpoints will now be dynamically calculated based on the number of buffers used by the previous shader stage.
* shaders: Expose hints about used const buffers.bunnei2018-04-151-13/+28
|
* GPU: Upload the entirety of each constbuffer for each shader stage as SSBOs.Subv2018-04-151-4/+3
| | | | 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-0/+3
|
* gl_shader_manager: Cleanup and consolidate uniform handling.bunnei2018-04-141-22/+9
|
* renderer_opengl: Add gl_shader_manager class.bunnei2018-04-141-0/+161