diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-20 23:25:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-20 23:25:08 +0200 |
commit | 0a67416971c15b205f61e5db4ec5955b49638774 (patch) | |
tree | b4e2498af98cfa334b801b5b71263a0330579cc0 /src/video_core/renderer_opengl | |
parent | Update README.md (diff) | |
parent | shader/half_set_predicate: Fix HSETP2 implementation (diff) | |
download | yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar.gz yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar.bz2 yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar.lz yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar.xz yuzu-0a67416971c15b205f61e5db4ec5955b49638774.tar.zst yuzu-0a67416971c15b205f61e5db4ec5955b49638774.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 119073776..e19d502bc 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -254,10 +254,6 @@ public: } private: - using OperationDecompilerFn = std::string (GLSLDecompiler::*)(Operation); - using OperationDecompilersArray = - std::array<OperationDecompilerFn, static_cast<std::size_t>(OperationCode::Amount)>; - void DeclareVertex() { if (stage != ShaderStage::Vertex) return; @@ -1400,14 +1396,10 @@ private: return fmt::format("{}[{}]", pair, VisitOperand(operation, 1, Type::Uint)); } - std::string LogicalAll2(Operation operation) { + std::string LogicalAnd2(Operation operation) { return GenerateUnary(operation, "all", Type::Bool, Type::Bool2); } - std::string LogicalAny2(Operation operation) { - return GenerateUnary(operation, "any", Type::Bool, Type::Bool2); - } - template <bool with_nan> std::string GenerateHalfComparison(Operation operation, const std::string& compare_op) { const std::string comparison{GenerateBinaryCall(operation, compare_op, Type::Bool2, @@ -1714,7 +1706,7 @@ private: return "utof(gl_WorkGroupID"s + GetSwizzle(element) + ')'; } - static constexpr OperationDecompilersArray operation_decompilers = { + static constexpr std::array operation_decompilers = { &GLSLDecompiler::Assign, &GLSLDecompiler::Select, @@ -1798,8 +1790,7 @@ private: &GLSLDecompiler::LogicalXor, &GLSLDecompiler::LogicalNegate, &GLSLDecompiler::LogicalPick2, - &GLSLDecompiler::LogicalAll2, - &GLSLDecompiler::LogicalAny2, + &GLSLDecompiler::LogicalAnd2, &GLSLDecompiler::LogicalLessThan<Type::Float>, &GLSLDecompiler::LogicalEqual<Type::Float>, @@ -1863,6 +1854,7 @@ private: &GLSLDecompiler::WorkGroupId<1>, &GLSLDecompiler::WorkGroupId<2>, }; + static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount)); std::string GetRegister(u32 index) const { return GetDeclarationWithSuffix(index, "gpr"); |