summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_gen.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3098 from ReinUsesLisp/shader-invalidationsbunnei2019-11-251-18/+26
|\ | | | | gl_shader_cache: Miscellaneous changes to shaders
| * gl_shader_cache: Remove dynamic BaseBinding specializationReinUsesLisp2019-11-231-12/+19
| |
| * video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp2019-11-231-6/+7
| |
* | gl_shader_gen: Apply default value to gl_PositionReinUsesLisp2019-11-201-0/+1
|/ | | | | | | Nvidia has sane default output values for varyings, but the other vendors don't apply these. To properly emulate this we would have to analyze the shader header. For the time being, apply the same default Nvidia applies so we get the same behaviour on non-Nvidia drivers.
* gl_rasterizer: Emulate viewport flipping with ARB_clip_controlReinUsesLisp2019-11-071-20/+4
| | | | | | | 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_shader_decompiler: Move entries to a separate functionReinUsesLisp2019-10-251-70/+24
|
* Shader_Cache: setup connection of ConstBufferLockerFernando Sahmkow2019-10-251-9/+17
|
* Shader_ir: Address feedbackFernando Sahmkow2019-10-051-11/+2
|
* Shader_Ir: Refactor Decompilation process and allow multiple decompilation modes.Fernando Sahmkow2019-10-051-5/+20
|
* gl_shader_cache: Address CI issuesReinUsesLisp2019-07-151-2/+1
|
* gl_rasterizer: Implement compute shadersReinUsesLisp2019-07-151-11/+27
|
* shader_ir: propagate shader size to the IRFernando Sahmkow2019-07-091-4/+4
|
* Merge pull request #2514 from ReinUsesLisp/opengl-compatZach Hilman2019-06-071-27/+0
|\ | | | | video_core: Drop OpenGL core in favor of OpenGL compatibility
| * gl_rasterizer: Move alpha testing to the OpenGL pipelineReinUsesLisp2019-05-301-27/+0
| | | | | | | | Removes the alpha testing code from each fragment shader invocation.
* | gl_shader_decompiler: Remove guest "position" varyingReinUsesLisp2019-06-031-17/+2
|/ | | | | | | | "position" was being written but not read anywhere besides geometry shaders, where it had the same value as gl_Position. This commit replaces "position" with gl_Position, reducing the complexity of our code and the emitted GLSL code.
* gl_shader_gen: Always declare extensions after the version declarationReinUsesLisp2019-05-271-6/+3
| | | | | This addresses a bug on geometry shaders where code was being written before all #extension declarations were done. Ref to #2523
* gl_shader_gen: std::move objects where applicableLioncash2019-05-191-7/+7
| | | | | | Avoids performing copies into the pair being returned. Instead, we can just move the resources into the pair, avoiding the need to make copies of both the std::string and ShaderEntries struct.
* Merge pull request #2425 from FernandoS27/y-directionHexagon122019-04-231-0/+3
|\ | | | | Fix flipping on some games by applying Y direction register
| * Apply Position Y DirectionFernando Sahmkow2019-04-201-0/+3
| |
* | gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp2019-04-141-7/+8
|/
* video_core/renderer_opengl: Remove unnecessary includesLioncash2019-04-041-1/+0
| | | | | | | Quite a few unused includes have built up over time, particularly on core/memory.h. Removing these includes means the source files including those files will no longer need to be rebuilt if they're changed, making compilation slightly faster in this scenario.
* shader_decompiler: Improve Accuracy of Attribute Interpolation.Fernando Sahmkow2019-02-141-2/+2
|
* gl_shader_cache: Use explicit bindingsReinUsesLisp2019-01-301-8/+5
|
* gl_shader_gen: Fixup code formattingReinUsesLisp2019-01-151-17/+21
|
* video_core: Rename glsl_decompiler to gl_shader_decompilerReinUsesLisp2019-01-151-1/+1
|
* glsl_decompiler: Fixup geometry shadersReinUsesLisp2019-01-151-5/+1
|
* video_core: Implement IR based geometry shadersReinUsesLisp2019-01-151-8/+6
|
* video_core: Replace gl_shader_decompilerReinUsesLisp2019-01-151-49/+45
|
* Implemented a shader unique identifier.Fernando Sahmkow2018-12-091-0/+7
|
* gl_shader_decompiler: Implement S2R's Y_DIRECTIONReinUsesLisp2018-11-251-8/+6
|
* gl_shader_decompiler: Guard out of bound geometry shader input readsReinUsesLisp2018-11-101-2/+2
| | | | | | | | | | | | | Geometry shaders follow a pattern that results in out of bound reads. This pattern is: - VSETP to predicate - Use that predicate to conditionally set a register a big number - Use the register to access geometry shaders At the time of writing this commit I don't know what's the intent of this number. Some drivers argue about these out of bound reads. To avoid this issue, input reads are guarded limiting reads to the highest posible vertex input of the current topology (e.g. points to 1 and triangles to 3).
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-4/+4
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* Implement PointSizeFernandoS272018-10-231-3/+0
|
* Use standard UBO and fix/stylize the codeFernandoS272018-10-221-1/+28
|
* gl_shader_decompiler: Move position varying declaration back to gl_shader_genReinUsesLisp2018-10-201-0/+7
| | | | | | | The intention of declaring them in gl_shader_decompiler was to be able to use blocks to implement geometry shaders. But that wasn't needed in the end and it caused issues when both vertex stages were being used, resulting in a redeclaration of "position".
* gl_shader_decompiler: Implement geometry shadersReinUsesLisp2018-10-071-25/+59
|
* Fixed renderdoc input/output textures not working due to render targetsDavid Marcec2018-09-111-1/+8
|
* gl_shader_gen: Initialize position.Markus Wick2018-09-061-0/+1
| | | | | IMO the old code is fine, but nvidia raises shader compiler warnings. Trivial fix through...
* renderer_opengl: Implement a new shader cache.bunnei2018-08-281-2/+2
|
* 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.
* Shaders: Write all the enabled color outputs when a fragment shader exits.Subv2018-08-211-1/+1
| | | | | | | We were only writing to the first render target before. Note that this is only the GLSL side of the implementation, supporting multiple render targets requires more changes in the OpenGL renderer. Dual Source blending is not implemented and stuff that uses it might not work at all.
* Rasterizer: Implemented instanced rendering.Subv2018-08-151-0/+2
| | | | | | 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_gen: Implement dual vertex shader mode.bunnei2018-07-131-9/+35
| | | | - When VertexA shader stage is enabled, we combine with VertexB program to make a single Vertex Shader stage.
* gl_shader_gen: Set position.w to 1.bunnei2018-06-161-0/+4
|
* GPU: Implement sampling multiple textures in the generated glsl shaders.Subv2018-06-061-2/+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-0/+10
| | | | | | * gl_shader_gen: Support vertical/horizontal viewport flipping. * fixup! gl_shader_gen: Support vertical/horizontal viewport flipping.
* gl_shader_decompiler: Allow vertex position to be used in fragment shader.bunnei2018-04-171-1/+5
|
* shaders: Expose hints about used const buffers.bunnei2018-04-151-6/+48
|
* gl_shader_gen: Add hashable setup/config structs.bunnei2018-04-141-2/+2
|
* renderer_opengl: Logging, etc. cleanup.bunnei2018-03-271-2/+2
|
* renderer_gl: Port over gl_shader_gen module from Citra.bunnei2018-03-201-0/+20
|
* Remove references to PICA and rasterizers in video_coreJames Rowe2018-01-131-1231/+0
|
* Merge pull request #2900 from wwylele/clip-2Yuri Kunde Schlesner2017-09-161-33/+47
|\ | | | | PICA: implement custom clip plane
| * gl_rasterizer: implement custom clip planewwylele2017-08-251-33/+47
| |
* | Merge pull request #2914 from wwylele/fresnel-fixbunnei2017-09-051-4/+5
|\ \ | | | | | | pica/lighting: only apply Fresnel factor for the last light
| * | pica/lighting: only apply Fresnel factor for the last lightwwylele2017-09-031-4/+5
| | |
* | | video_core: report telemetry for gas modewwylele2017-08-311-0/+6
|/ /
* | Merge pull request #2891 from wwylele/sw-bumpbunnei2017-08-311-2/+2
|\ \ | |/ |/| SwRasterizer/Lighting: implement bump mapping
| * gl_rasterizer/lighting: more accurate CP formulawwylele2017-08-221-2/+2
| |
* | gl_shader_gen: simplify and clarify the depth transformation between vertex shader and fragment shaderwwylele2017-08-211-2/+5
| |
* | gl_rasterizer: add clipping plane z<=0 defined in PICAwwylele2017-08-211-0/+2
|/
* gl_shader_gen: don't call SampleTexture when bump map is not usedwwylele2017-08-111-4/+5
|
* gl_rasterizer: use texture buffer for proctex LUTwwylele2017-07-011-10/+10
|
* gl_rasterizer: use texture buffer for fog LUTwwylele2017-06-221-7/+3
|
* gl_rasterizer/lighting: fix LUT interpolationwwylele2017-06-211-51/+59
|
* gl_rasterizer/lighting: use the formula from the paper for germetic factorwwylele2017-06-181-8/+8
|
* gl_rasterizer/lighting: implement geometric factorwwylele2017-06-151-1/+16
|
* gl_rasterizer/lighting: Implement tangent mappingwwylele2017-06-111-7/+12
|
* gl_rasterizer/lighting: implement lut input 5 (CP)wwylele2017-06-111-2/+25
|
* Merge pull request #2727 from wwylele/spot-lightSebastian Valle2017-06-111-6/+33
|\ | | | | Fragment lighting: implement spot light
| * gl_rasterizer: implement spot lightwwylele2017-05-301-6/+24
| |
| * gl_rasterizer: sync spot light statuswwylele2017-05-301-0/+9
| |
* | Merge pull request #2729 from yuriks/quaternion-fixYuri Kunde Schlesner2017-05-281-3/+5
|\ \ | | | | | | OpenGL: Improve accuracy of quaternion interpolation
| * | OpenGL: Improve accuracy of quaternion interpolationYuri Kunde Schlesner2017-05-271-3/+5
| |/ | | | | | | | | | | | | Current order of operations (rotate then normalize) seems to produce a lot more distortion than normalizing and then rotating. This makes Citra results match pretty closesly with hardware, and indicates that hardware may also be using lerp instead of slerp to interpolate the quaternions.
* / gl_shader: refactor texture sampler into its own functionwwylele2017-05-271-40/+39
|/
* gl_rasterizer: implement procedural texturewwylele2017-05-201-6/+265
|
* pica: shader_dirty if texture2 coord changedwwylele2017-05-051-1/+1
|
* pica: use correct coordinates for texture 2wwylele2017-05-031-3/+14
|
* Merge pull request #2671 from wwylele/dot3-rgbabunnei2017-04-211-13/+20
|\ | | | | rasterizer: implement combiner operation 7 (Dot3_RGBA)
| * gl_shader_gen: remove TODO about Lerp behaviour verification. The implementation is verified against hardwarewwylele2017-04-201-2/+0
| |
| * rasterizer: implement combiner operation 7 (Dot3_RGBA)wwylele2017-04-191-11/+20
| |
* | OpenGL: Pass Pica regs via parameterYuri Kunde Schlesner2017-04-171-3/+1
| |
* | OpenGL: Move PicaShaderConfig to gl_shader_gen.hYuri Kunde Schlesner2017-04-171-0/+94
|/ | | | Also move the implementation of CurrentConfig to the cpp file.
* VideoCore: Split regs.h inclusionsYuri Kunde Schlesner2017-02-091-13/+17
|
* VideoCore: Move Regs to its own fileYuri Kunde Schlesner2017-02-041-1/+1
|
* VideoCore: Split lighting regs from Regs structYuri Kunde Schlesner2017-02-041-32/+40
|
* VideoCore: Split framebuffer regs from Regs structYuri Kunde Schlesner2017-02-041-4/+4
|
* VideoCore: Split texturing regs from Regs structYuri Kunde Schlesner2017-02-041-5/+5
|
* VideoCore: Split rasterizer regs from Regs structYuri Kunde Schlesner2017-02-041-3/+4
|
* Minor cleanup in GLSL codeJannik Vogel2016-12-251-3/+2
|
* Offset lighting LUT samples correctlyJannik Vogel2016-12-251-7/+7
|
* OpenGL: Take cached viewport sub-rect into account for scissorYuri Kunde Schlesner2016-09-301-5/+4
| | | | Fixes #1938
* Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner2016-09-211-1/+1
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-3/+1
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner2016-09-191-3/+1
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-76/+137
|
* OpenGL: Avoid error on unsupported lighting LUTJannik Vogel2016-08-301-0/+1
|
* OpenGL: Add scaled resolution support to scissorYuri Kunde Schlesner2016-06-281-2/+5
|
* PICA: Scissor fixes and cleanupsYuri Kunde Schlesner2016-06-281-7/+8
|
* PICA: Implement scissor testSubv2016-06-281-0/+16
|
* OpenGL: Implement fogJannik Vogel2016-06-071-5/+29
|
* OpenGL: Avoid undefined behaviour for UNIFORM_BLOCK_DATA_SIZEJannik Vogel2016-06-071-2/+2
|
* OpenGL: Use uniforms for dist_atten_bias and dist_atten_scaleJannik Vogel2016-05-231-3/+3
|
* OpenGL: Implement texture type 3Jannik Vogel2016-05-111-35/+53
|
* OpenGL: Implement W-Buffers and fix depth-mappingJannik Vogel2016-05-101-1/+10
|
* Pica: Use a union for PicaShaderConfigJannik Vogel2016-05-031-37/+41
|
* Pica: Add TevStageConfigRaw to PicaShaderConfig (MSVC workaround)Jannik Vogel2016-05-031-1/+1
|
* VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot2016-04-301-0/+8
|
* OpenGL: Implement color combiner Operation::Dot3_RGBJannik Vogel2016-04-101-0/+3
|
* gl_rasterizer: Initial implementation of bump mapping.bunnei2016-02-051-5/+27
|
* gl_shader_gen: Fix bug in LUT range (should within range [0, 255] not [0, 256]).bunnei2016-02-051-3/+3
|
* gl_shader_gen: Implement lighting red, green, and blue reflection.bunnei2016-02-051-17/+45
|
* gl_shader_gen: View should be normalized.bunnei2016-02-051-2/+2
|
* gl_shader_gen: Implement fragment lighting fresnel effect.bunnei2016-02-051-9/+26
|
* gl_shader_gen: Implement fragment lighting specular 1 component.bunnei2016-02-051-3/+14
|
* gl_shader_gen: Add support for D0 LUT scaling.bunnei2016-02-051-1/+1
|
* gl_shader_gen: Refactor lighting config to match Pica register naming.bunnei2016-02-051-14/+16
| | | | - Also implement D0 LUT enable.
* gl_shader_gen: Reorganize and cleanup lighting code.bunnei2016-02-051-100/+107
| | | | - No functional difference.
* gl_shader_gen: Fix directional lights.bunnei2016-02-051-1/+1
|
* gl_shader_gen: Fix bug with lighting where clamp highlights was only applied to last light.bunnei2016-02-051-6/+6
|
* gl_shader_gen: View vector needs to be normalized when computing half angle vector.bunnei2016-02-051-3/+4
|
* renderer_opengl: Use textures for fragment shader LUTs instead of UBOs.bunnei2016-02-051-11/+7
| | | | | - Gets us LUT interpolation for free. - Some older Intel GPU drivers did not support the big UBOs needed to store the LUTs.
* renderer_opengl: Initial implementation of basic specular lighting.bunnei2016-02-051-12/+70
|
* renderer_opengl: Implement HW fragment lighting distance attenuation.bunnei2016-02-051-3/+16
|
* renderer_opengl: Implement HW fragment lighting LUTs within our default UBO.bunnei2016-02-051-0/+7
|
* renderer_opengl: Implement diffuse component of HW fragment lighting.bunnei2016-02-051-2/+51
|
* hwrasterizer: Use depth offsettfarley2016-01-211-1/+3
|
* OpenGL: Flip framebuffers during transfer rather than when renderingYuri Kunde Schlesner2015-12-051-1/+1
|
* PICA: Properly emulate 1-stage delay in the combiner bufferYuri Kunde Schlesner2015-12-011-7/+11
| | | | | | | | | This was discovered and verified by @fincs. The tev combiner buffer actually lags behind by one stage, meaning stage 1 reads the initial color, stage 2 reads stage 0's output, and so on. Fixes character portraits in Fire Emblem: Awakening and world textures in Zelda: ALBW. Closes #1140.
* renderer_opengl: Fix uniform issues introduced with kemenaran/avoid-explicit-uniform-location.bunnei2015-11-261-2/+2
|
* Use regular uniform locationPierre de La Morinerie2015-11-251-5/+1
| | | | | | The support for GL_ARB_explicit_uniform_location is not that good (53% according to http://feedback.wildfiregames.com/report/opengl/feature/GL_ARB_explicit_uniform_location). This fix the shader compilation on Intel HD 4000 (#1222).
* FragShader: Use an UBO instead of several individual uniformsSubv2015-11-191-3/+7
|
* gl_shader_gen: Use explicit locations for vertex shader attributes.bunnei2015-10-221-9/+9
|
* gl_shader_gen: Optimize code for AppendAlphaTestCondition.bunnei2015-10-221-16/+11
| | | | - Also add a comment to AppendColorCombiner.
* gl_shader_gen: Various cleanups to shader generation.bunnei2015-10-221-44/+48
|
* gl_rasterizer: Use MMH3 hash for shader cache hey.bunnei2015-10-221-2/+2
| | | | - Includes a check to confirm no hash collisions.
* gl_shader_gen: Require explicit uniform locations.bunnei2015-10-221-11/+12
| | | | - Fixes uniform issue on AMD.
* gl_shader_gen: Rename 'o' to 'attr' in vertex/fragment shaders.bunnei2015-10-221-11/+11
|
* gl_shader_gen: AppendAlphaModifier default should be 0.0, not vec4(0.0).bunnei2015-10-221-1/+1
|
* gl_shader_gen: Fix bug where TEV stage outputs should be clamped.bunnei2015-10-221-3/+3
|
* gl_shader_gen: Add additional function documentation.bunnei2015-10-221-0/+8
|
* gl_shader_gen: Various cleanups + moved TEV stage generation to its own function.bunnei2015-10-221-161/+170
|
* renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.bunnei2015-10-221-0/+371