summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar bunnei2020-07-24 06:33:09 -0700
committerGravatar GitHub2020-07-24 06:33:09 -0700
commitf650cf8a9a4f4976356e7e2eef404e81ccc0c8aa (patch)
treeacb35a74ffe2349a7ac0c605a4c43972142bfdb2 /src/video_core/renderer_opengl
parentMerge pull request #4394 from lioncash/unused6 (diff)
parentvideo_core: Allow copy elision to take place where applicable (diff)
downloadyuzu-f650cf8a9a4f4976356e7e2eef404e81ccc0c8aa.tar.gz
yuzu-f650cf8a9a4f4976356e7e2eef404e81ccc0c8aa.tar.xz
yuzu-f650cf8a9a4f4976356e7e2eef404e81ccc0c8aa.zip
Merge pull request #4391 from lioncash/nrvo
video_core: Allow copy elision to take place where applicable
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_arb_decompiler.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
index 7ab7755f5..b7e9ed2e9 100644
--- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
@@ -1704,7 +1704,7 @@ std::string ARBDecompiler::HCastFloat(Operation operation) {
1704} 1704}
1705 1705
1706std::string ARBDecompiler::HUnpack(Operation operation) { 1706std::string ARBDecompiler::HUnpack(Operation operation) {
1707 const std::string operand = Visit(operation[0]); 1707 std::string operand = Visit(operation[0]);
1708 switch (std::get<Tegra::Shader::HalfType>(operation.GetMeta())) { 1708 switch (std::get<Tegra::Shader::HalfType>(operation.GetMeta())) {
1709 case Tegra::Shader::HalfType::H0_H1: 1709 case Tegra::Shader::HalfType::H0_H1:
1710 return operand; 1710 return operand;
@@ -2054,7 +2054,7 @@ std::string ARBDecompiler::InvocationId(Operation) {
2054 2054
2055std::string ARBDecompiler::YNegate(Operation) { 2055std::string ARBDecompiler::YNegate(Operation) {
2056 LOG_WARNING(Render_OpenGL, "(STUBBED)"); 2056 LOG_WARNING(Render_OpenGL, "(STUBBED)");
2057 const std::string temporary = AllocTemporary(); 2057 std::string temporary = AllocTemporary();
2058 AddLine("MOV.F {}, 1;", temporary); 2058 AddLine("MOV.F {}, 1;", temporary);
2059 return temporary; 2059 return temporary;
2060} 2060}
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 28d47a211..be71e1733 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -126,7 +126,7 @@ std::shared_ptr<Registry> MakeRegistry(const ShaderDiskCacheEntry& entry) {
126 const VideoCore::GuestDriverProfile guest_profile{entry.texture_handler_size}; 126 const VideoCore::GuestDriverProfile guest_profile{entry.texture_handler_size};
127 const VideoCommon::Shader::SerializedRegistryInfo info{guest_profile, entry.bound_buffer, 127 const VideoCommon::Shader::SerializedRegistryInfo info{guest_profile, entry.bound_buffer,
128 entry.graphics_info, entry.compute_info}; 128 entry.graphics_info, entry.compute_info};
129 const auto registry = std::make_shared<Registry>(entry.type, info); 129 auto registry = std::make_shared<Registry>(entry.type, info);
130 for (const auto& [address, value] : entry.keys) { 130 for (const auto& [address, value] : entry.keys) {
131 const auto [buffer, offset] = address; 131 const auto [buffer, offset] = address;
132 registry->InsertKey(buffer, offset, value); 132 registry->InsertKey(buffer, offset, value);
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 1b1c97239..3f75fcd2b 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1919,7 +1919,7 @@ private:
1919 Expression Comparison(Operation operation) { 1919 Expression Comparison(Operation operation) {
1920 static_assert(!unordered || type == Type::Float); 1920 static_assert(!unordered || type == Type::Float);
1921 1921
1922 const Expression expr = GenerateBinaryInfix(operation, op, Type::Bool, type, type); 1922 Expression expr = GenerateBinaryInfix(operation, op, Type::Bool, type, type);
1923 1923
1924 if constexpr (op.compare("!=") == 0 && type == Type::Float && !unordered) { 1924 if constexpr (op.compare("!=") == 0 && type == Type::Float && !unordered) {
1925 // GLSL's operator!=(float, float) doesn't seem be ordered. This happens on both AMD's 1925 // GLSL's operator!=(float, float) doesn't seem be ordered. This happens on both AMD's