diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-10 22:34:15 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-22 21:07:33 +0200 |
commit | 59a004f915e84fec4a4fed125661eb486e1de198 (patch) | |
tree | 0503fc9161e632023e1deeb005b33ee028440bcc /src/video_core/renderer_opengl/gl_shader_gen.cpp | |
parent | Cache uniform locations and restructure the implementation (diff) | |
download | yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.gz yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.bz2 yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.lz yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.xz yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.zst yuzu-59a004f915e84fec4a4fed125661eb486e1de198.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index ecbc9d8ed..e883ffb1d 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -29,6 +29,7 @@ layout(std140) uniform vs_config { vec4 viewport_flip; uvec4 instance_id; uvec4 flip_stage; + uvec4 alpha_test; }; )"; @@ -105,6 +106,7 @@ layout (std140) uniform gs_config { vec4 viewport_flip; uvec4 instance_id; uvec4 flip_stage; + uvec4 alpha_test; }; void main() { @@ -142,8 +144,33 @@ layout (std140) uniform fs_config { vec4 viewport_flip; uvec4 instance_id; uvec4 flip_stage; + uvec4 alpha_test; }; +bool AlphaFunc(in float value) { + float ref = uintBitsToFloat(alpha_test[2]); + switch (alpha_test[1]) { + case 1: + return false; + case 2: + return value < ref; + case 3: + return value == ref; + case 4: + return value <= ref; + case 5: + return value > ref; + case 6: + return value != ref; + case 7: + return value >= ref; + case 8: + return true; + default: + return false; + } +} + void main() { exec_fragment(); } @@ -152,4 +179,4 @@ void main() { out += program.first; return {out, program.second}; } -} // namespace OpenGL::GLShader
\ No newline at end of file +} // namespace OpenGL::GLShader |