summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_gen.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-07-15gl_shader_cache: Address CI issuesReinUsesLisp1-2/+1
2019-07-15gl_rasterizer: Implement compute shadersReinUsesLisp1-11/+27
2019-07-09shader_ir: propagate shader size to the IRFernando Sahmkow1-4/+4
2019-06-03gl_shader_decompiler: Remove guest "position" varyingReinUsesLisp1-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.
2019-05-30gl_rasterizer: Move alpha testing to the OpenGL pipelineReinUsesLisp1-27/+0
Removes the alpha testing code from each fragment shader invocation.
2019-05-27gl_shader_gen: Always declare extensions after the version declarationReinUsesLisp1-6/+3
This addresses a bug on geometry shaders where code was being written before all #extension declarations were done. Ref to #2523
2019-05-19gl_shader_gen: std::move objects where applicableLioncash1-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.
2019-04-20Apply Position Y DirectionFernando Sahmkow1-0/+3
2019-04-14gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp1-7/+8
2019-04-04video_core/renderer_opengl: Remove unnecessary includesLioncash1-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.
2019-02-14shader_decompiler: Improve Accuracy of Attribute Interpolation.Fernando Sahmkow1-2/+2
2019-01-30gl_shader_cache: Use explicit bindingsReinUsesLisp1-8/+5
2019-01-15gl_shader_gen: Fixup code formattingReinUsesLisp1-17/+21
2019-01-15video_core: Rename glsl_decompiler to gl_shader_decompilerReinUsesLisp1-1/+1
2019-01-15glsl_decompiler: Fixup geometry shadersReinUsesLisp1-5/+1
2019-01-15video_core: Implement IR based geometry shadersReinUsesLisp1-8/+6
2019-01-15video_core: Replace gl_shader_decompilerReinUsesLisp1-49/+45
2018-12-09Implemented a shader unique identifier.Fernando Sahmkow1-0/+7
2018-11-25gl_shader_decompiler: Implement S2R's Y_DIRECTIONReinUsesLisp1-8/+6
2018-11-10gl_shader_decompiler: Guard out of bound geometry shader input readsReinUsesLisp1-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).
2018-10-30global: Use std::optional instead of boost::optional (#1578)Frederic L1-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
2018-10-28Refactor precise usage and add FMNMX, MUFU, FMUL32 and FADD332FernandoS271-6/+3
2018-10-28Improved Shader accuracy on Vertex and Geometry Shaders with FFMA, FMUL and FADDFernandoS271-3/+6
2018-10-23Implement PointSizeFernandoS271-3/+0
2018-10-22Use standard UBO and fix/stylize the codeFernandoS271-1/+28
2018-10-20gl_shader_decompiler: Move position varying declaration back to gl_shader_genReinUsesLisp1-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".
2018-10-07gl_shader_decompiler: Implement geometry shadersReinUsesLisp1-25/+59
2018-09-11Fixed renderdoc input/output textures not working due to render targetsDavid Marcec1-1/+8
2018-09-06gl_shader_gen: Initialize position.Markus Wick1-0/+1
IMO the old code is fine, but nvidia raises shader compiler warnings. Trivial fix through...
2018-08-28renderer_opengl: Implement a new shader cache.bunnei1-2/+2
2018-08-22renderer_opengl: Namespace OpenGL codeLioncash1-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.
2018-08-21Shaders: Write all the enabled color outputs when a fragment shader exits.Subv1-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.
2018-08-15Rasterizer: Implemented instanced rendering.Subv1-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.
2018-07-13gl_shader_gen: Implement dual vertex shader mode.bunnei1-9/+35
- When VertexA shader stage is enabled, we combine with VertexB program to make a single Vertex Shader stage.
2018-06-16gl_shader_gen: Set position.w to 1.bunnei1-0/+4
2018-06-06GPU: Implement sampling multiple textures in the generated glsl shaders.Subv1-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.
2018-04-18gl_shader_gen: Support vertical/horizontal viewport flipping. (#347)bunnei1-0/+10
* gl_shader_gen: Support vertical/horizontal viewport flipping. * fixup! gl_shader_gen: Support vertical/horizontal viewport flipping.
2018-04-17gl_shader_decompiler: Allow vertex position to be used in fragment shader.bunnei1-1/+5
2018-04-15shaders: Expose hints about used const buffers.bunnei1-6/+48
2018-04-14gl_shader_gen: Add hashable setup/config structs.bunnei1-2/+2
2018-03-27renderer_opengl: Logging, etc. cleanup.bunnei1-2/+2
2018-03-20renderer_gl: Port over gl_shader_gen module from Citra.bunnei1-0/+20
2018-01-13Remove references to PICA and rasterizers in video_coreJames Rowe1-1231/+0
2017-09-03pica/lighting: only apply Fresnel factor for the last lightwwylele1-4/+5
2017-08-31video_core: report telemetry for gas modewwylele1-0/+6
2017-08-25gl_rasterizer: implement custom clip planewwylele1-33/+47
2017-08-22gl_rasterizer/lighting: more accurate CP formulawwylele1-2/+2
2017-08-21gl_shader_gen: simplify and clarify the depth transformation between vertex shader and fragment shaderwwylele1-2/+5
2017-08-21gl_rasterizer: add clipping plane z<=0 defined in PICAwwylele1-0/+2
2017-08-11gl_shader_gen: don't call SampleTexture when bump map is not usedwwylele1-4/+5
2017-07-01gl_rasterizer: use texture buffer for proctex LUTwwylele1-10/+10
2017-06-22gl_rasterizer: use texture buffer for fog LUTwwylele1-7/+3
2017-06-21gl_rasterizer/lighting: fix LUT interpolationwwylele1-51/+59
2017-06-18gl_rasterizer/lighting: use the formula from the paper for germetic factorwwylele1-8/+8
2017-06-15gl_rasterizer/lighting: implement geometric factorwwylele1-1/+16
2017-06-11gl_rasterizer/lighting: Implement tangent mappingwwylele1-7/+12
2017-06-11gl_rasterizer/lighting: implement lut input 5 (CP)wwylele1-2/+25
2017-05-30gl_rasterizer: implement spot lightwwylele1-6/+24
2017-05-30gl_rasterizer: sync spot light statuswwylele1-0/+9
2017-05-27OpenGL: Improve accuracy of quaternion interpolationYuri Kunde Schlesner1-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.
2017-05-27gl_shader: refactor texture sampler into its own functionwwylele1-40/+39
2017-05-20gl_rasterizer: implement procedural texturewwylele1-6/+265
2017-05-05pica: shader_dirty if texture2 coord changedwwylele1-1/+1
2017-05-03pica: use correct coordinates for texture 2wwylele1-3/+14
2017-04-20gl_shader_gen: remove TODO about Lerp behaviour verification. The implementation is verified against hardwarewwylele1-2/+0
2017-04-19rasterizer: implement combiner operation 7 (Dot3_RGBA)wwylele1-11/+20
2017-04-17OpenGL: Pass Pica regs via parameterYuri Kunde Schlesner1-3/+1
2017-04-17OpenGL: Move PicaShaderConfig to gl_shader_gen.hYuri Kunde Schlesner1-0/+94
Also move the implementation of CurrentConfig to the cpp file.
2017-02-09VideoCore: Split regs.h inclusionsYuri Kunde Schlesner1-13/+17
2017-02-04VideoCore: Move Regs to its own fileYuri Kunde Schlesner1-1/+1
2017-02-04VideoCore: Split lighting regs from Regs structYuri Kunde Schlesner1-32/+40
2017-02-04VideoCore: Split framebuffer regs from Regs structYuri Kunde Schlesner1-4/+4
2017-02-04VideoCore: Split texturing regs from Regs structYuri Kunde Schlesner1-5/+5
2017-02-04VideoCore: Split rasterizer regs from Regs structYuri Kunde Schlesner1-3/+4
2016-12-25Minor cleanup in GLSL codeJannik Vogel1-3/+2
2016-12-25Offset lighting LUT samples correctlyJannik Vogel1-7/+7
2016-09-30OpenGL: Take cached viewport sub-rect into account for scissorYuri Kunde Schlesner1-5/+4
Fixes #1938
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner1-1/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-3/+1
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-19Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner1-3/+1
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-76/+137
2016-08-30OpenGL: Avoid error on unsupported lighting LUTJannik Vogel1-0/+1
2016-06-28OpenGL: Add scaled resolution support to scissorYuri Kunde Schlesner1-2/+5
2016-06-28PICA: Scissor fixes and cleanupsYuri Kunde Schlesner1-7/+8
2016-06-28PICA: Implement scissor testSubv1-0/+16
2016-06-07OpenGL: Implement fogJannik Vogel1-5/+29
2016-06-07OpenGL: Avoid undefined behaviour for UNIFORM_BLOCK_DATA_SIZEJannik Vogel1-2/+2
2016-05-23OpenGL: Use uniforms for dist_atten_bias and dist_atten_scaleJannik Vogel1-3/+3
2016-05-11OpenGL: Implement texture type 3Jannik Vogel1-35/+53
2016-05-10OpenGL: Implement W-Buffers and fix depth-mappingJannik Vogel1-1/+10
2016-05-03Pica: Use a union for PicaShaderConfigJannik Vogel1-37/+41
2016-05-03Pica: Add TevStageConfigRaw to PicaShaderConfig (MSVC workaround)Jannik Vogel1-1/+1
2016-04-30VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot1-0/+8
2016-04-10OpenGL: Implement color combiner Operation::Dot3_RGBJannik Vogel1-0/+3
2016-02-05gl_rasterizer: Initial implementation of bump mapping.bunnei1-5/+27
2016-02-05gl_shader_gen: Fix bug in LUT range (should within range [0, 255] not [0, 256]).bunnei1-3/+3
2016-02-05gl_shader_gen: Implement lighting red, green, and blue reflection.bunnei1-17/+45
2016-02-05gl_shader_gen: View should be normalized.bunnei1-2/+2
2016-02-05gl_shader_gen: Implement fragment lighting fresnel effect.bunnei1-9/+26
2016-02-05gl_shader_gen: Implement fragment lighting specular 1 component.bunnei1-3/+14
2016-02-05gl_shader_gen: Add support for D0 LUT scaling.bunnei1-1/+1
2016-02-05gl_shader_gen: Refactor lighting config to match Pica register naming.bunnei1-14/+16
- Also implement D0 LUT enable.
2016-02-05gl_shader_gen: Reorganize and cleanup lighting code.bunnei1-100/+107
- No functional difference.
2016-02-05gl_shader_gen: Fix directional lights.bunnei1-1/+1
2016-02-05gl_shader_gen: Fix bug with lighting where clamp highlights was only applied to last light.bunnei1-6/+6
2016-02-05gl_shader_gen: View vector needs to be normalized when computing half angle vector.bunnei1-3/+4
2016-02-05renderer_opengl: Use textures for fragment shader LUTs instead of UBOs.bunnei1-11/+7
- Gets us LUT interpolation for free. - Some older Intel GPU drivers did not support the big UBOs needed to store the LUTs.
2016-02-05renderer_opengl: Initial implementation of basic specular lighting.bunnei1-12/+70
2016-02-05renderer_opengl: Implement HW fragment lighting distance attenuation.bunnei1-3/+16
2016-02-05renderer_opengl: Implement HW fragment lighting LUTs within our default UBO.bunnei1-0/+7
2016-02-05renderer_opengl: Implement diffuse component of HW fragment lighting.bunnei1-2/+51
2016-01-21hwrasterizer: Use depth offsettfarley1-1/+3
2015-12-05OpenGL: Flip framebuffers during transfer rather than when renderingYuri Kunde Schlesner1-1/+1
2015-12-01PICA: Properly emulate 1-stage delay in the combiner bufferYuri Kunde Schlesner1-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.
2015-11-26renderer_opengl: Fix uniform issues introduced with kemenaran/avoid-explicit-uniform-location.bunnei1-2/+2
2015-11-25Use regular uniform locationPierre de La Morinerie1-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).
2015-11-19FragShader: Use an UBO instead of several individual uniformsSubv1-3/+7
2015-10-22gl_shader_gen: Use explicit locations for vertex shader attributes.bunnei1-9/+9
2015-10-22gl_shader_gen: Optimize code for AppendAlphaTestCondition.bunnei1-16/+11
- Also add a comment to AppendColorCombiner.
2015-10-22gl_shader_gen: Various cleanups to shader generation.bunnei1-44/+48
2015-10-22gl_rasterizer: Use MMH3 hash for shader cache hey.bunnei1-2/+2
- Includes a check to confirm no hash collisions.
2015-10-22gl_shader_gen: Require explicit uniform locations.bunnei1-11/+12
- Fixes uniform issue on AMD.
2015-10-22gl_shader_gen: Rename 'o' to 'attr' in vertex/fragment shaders.bunnei1-11/+11
2015-10-22gl_shader_gen: AppendAlphaModifier default should be 0.0, not vec4(0.0).bunnei1-1/+1
2015-10-22gl_shader_gen: Fix bug where TEV stage outputs should be clamped.bunnei1-3/+3
2015-10-22gl_shader_gen: Add additional function documentation.bunnei1-0/+8
2015-10-22gl_shader_gen: Various cleanups + moved TEV stage generation to its own function.bunnei1-161/+170
2015-10-22renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.bunnei1-0/+371