diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-15 06:43:44 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-22 04:18:37 +0200 |
commit | e2b67a868b7191237374226218756c1a62fabd4e (patch) | |
tree | 0ae75b1a89a5cdec2abf2433b20558f4aaab589b /src/video_core/renderer_opengl | |
parent | Merge pull request #3926 from ogniK5377/keyboard-states (diff) | |
download | yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar.gz yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar.bz2 yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar.lz yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar.xz yuzu-e2b67a868b7191237374226218756c1a62fabd4e.tar.zst yuzu-e2b67a868b7191237374226218756c1a62fabd4e.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 960ebf1a1..c83a08d42 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -2309,6 +2309,18 @@ private: return {"gl_SubGroupInvocationARB", Type::Uint}; } + template <const std::string_view& comparison> + Expression ThreadMask(Operation) { + if (device.HasWarpIntrinsics()) { + return {fmt::format("gl_Thread{}MaskNV", comparison), Type::Uint}; + } + if (device.HasShaderBallot()) { + return {fmt::format("uint(gl_SubGroup{}MaskARB)", comparison), Type::Uint}; + } + LOG_ERROR(Render_OpenGL, "Thread mask intrinsics are required by the shader"); + return {"0U", Type::Uint}; + } + Expression ShuffleIndexed(Operation operation) { std::string value = VisitOperand(operation, 0).AsFloat(); @@ -2337,6 +2349,12 @@ private: static constexpr std::string_view NotEqual = "!="; static constexpr std::string_view GreaterEqual = ">="; + static constexpr std::string_view Eq = "Eq"; + static constexpr std::string_view Ge = "Ge"; + static constexpr std::string_view Gt = "Gt"; + static constexpr std::string_view Le = "Le"; + static constexpr std::string_view Lt = "Lt"; + static constexpr std::string_view Add = "Add"; static constexpr std::string_view Min = "Min"; static constexpr std::string_view Max = "Max"; @@ -2554,6 +2572,11 @@ private: &GLSLDecompiler::VoteEqual, &GLSLDecompiler::ThreadId, + &GLSLDecompiler::ThreadMask<Func::Eq>, + &GLSLDecompiler::ThreadMask<Func::Ge>, + &GLSLDecompiler::ThreadMask<Func::Gt>, + &GLSLDecompiler::ThreadMask<Func::Le>, + &GLSLDecompiler::ThreadMask<Func::Lt>, &GLSLDecompiler::ShuffleIndexed, &GLSLDecompiler::MemoryBarrierGL, |