summaryrefslogtreecommitdiff
path: root/src/video_core/debug_utils
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-19 18:49:09 +0100
committerGravatar Tony Wasserka2014-12-20 18:06:55 +0100
commitd81370682fccda1370ba22026aa21a260b506efd (patch)
tree9ee4b4c993fcff6c19e442b05ae99233ee211892 /src/video_core/debug_utils
parentPica/VertexShader: Cleanup flow control logic and implement CMP/IFU instructi... (diff)
downloadyuzu-d81370682fccda1370ba22026aa21a260b506efd.tar.gz
yuzu-d81370682fccda1370ba22026aa21a260b506efd.tar.xz
yuzu-d81370682fccda1370ba22026aa21a260b506efd.zip
Pica/DebugUtils: Make a number of variables static.
Makes for cleaner and faster code.
Diffstat (limited to 'src/video_core/debug_utils')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 7e1cfb92c..0085c117d 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -580,7 +580,7 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
580 for (size_t index = 0; index < stages.size(); ++index) { 580 for (size_t index = 0; index < stages.size(); ++index) {
581 const auto& tev_stage = stages[index]; 581 const auto& tev_stage = stages[index];
582 582
583 const std::map<Source, std::string> source_map = { 583 static const std::map<Source, std::string> source_map = {
584 { Source::PrimaryColor, "PrimaryColor" }, 584 { Source::PrimaryColor, "PrimaryColor" },
585 { Source::Texture0, "Texture0" }, 585 { Source::Texture0, "Texture0" },
586 { Source::Texture1, "Texture1" }, 586 { Source::Texture1, "Texture1" },
@@ -589,23 +589,23 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
589 { Source::Previous, "Previous" }, 589 { Source::Previous, "Previous" },
590 }; 590 };
591 591
592 const std::map<ColorModifier, std::string> color_modifier_map = { 592 static const std::map<ColorModifier, std::string> color_modifier_map = {
593 { ColorModifier::SourceColor, { "%source.rgb" } }, 593 { ColorModifier::SourceColor, { "%source.rgb" } },
594 { ColorModifier::SourceAlpha, { "%source.aaa" } }, 594 { ColorModifier::SourceAlpha, { "%source.aaa" } },
595 }; 595 };
596 const std::map<AlphaModifier, std::string> alpha_modifier_map = { 596 static const std::map<AlphaModifier, std::string> alpha_modifier_map = {
597 { AlphaModifier::SourceAlpha, "%source.a" }, 597 { AlphaModifier::SourceAlpha, "%source.a" },
598 { AlphaModifier::OneMinusSourceAlpha, "(255 - %source.a)" }, 598 { AlphaModifier::OneMinusSourceAlpha, "(255 - %source.a)" },
599 }; 599 };
600 600
601 std::map<Operation, std::string> combiner_map = { 601 static const std::map<Operation, std::string> combiner_map = {
602 { Operation::Replace, "%source1" }, 602 { Operation::Replace, "%source1" },
603 { Operation::Modulate, "(%source1 * %source2) / 255" }, 603 { Operation::Modulate, "(%source1 * %source2) / 255" },
604 { Operation::Add, "(%source1 + %source2)" }, 604 { Operation::Add, "(%source1 + %source2)" },
605 { Operation::Lerp, "lerp(%source1, %source2, %source3)" }, 605 { Operation::Lerp, "lerp(%source1, %source2, %source3)" },
606 }; 606 };
607 607
608 auto ReplacePattern = 608 static auto ReplacePattern =
609 [](const std::string& input, const std::string& pattern, const std::string& replacement) -> std::string { 609 [](const std::string& input, const std::string& pattern, const std::string& replacement) -> std::string {
610 size_t start = input.find(pattern); 610 size_t start = input.find(pattern);
611 if (start == std::string::npos) 611 if (start == std::string::npos)
@@ -615,8 +615,8 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
615 ret.replace(start, pattern.length(), replacement); 615 ret.replace(start, pattern.length(), replacement);
616 return ret; 616 return ret;
617 }; 617 };
618 auto GetColorSourceStr = 618 static auto GetColorSourceStr =
619 [&source_map,&color_modifier_map,&ReplacePattern](const Source& src, const ColorModifier& modifier) { 619 [](const Source& src, const ColorModifier& modifier) {
620 auto src_it = source_map.find(src); 620 auto src_it = source_map.find(src);
621 std::string src_str = "Unknown"; 621 std::string src_str = "Unknown";
622 if (src_it != source_map.end()) 622 if (src_it != source_map.end())
@@ -629,8 +629,8 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
629 629
630 return ReplacePattern(modifier_str, "%source", src_str); 630 return ReplacePattern(modifier_str, "%source", src_str);
631 }; 631 };
632 auto GetColorCombinerStr = 632 static auto GetColorCombinerStr =
633 [&](const Regs::TevStageConfig& tev_stage) { 633 [](const Regs::TevStageConfig& tev_stage) {
634 auto op_it = combiner_map.find(tev_stage.color_op); 634 auto op_it = combiner_map.find(tev_stage.color_op);
635 std::string op_str = "Unknown op (%source1, %source2, %source3)"; 635 std::string op_str = "Unknown op (%source1, %source2, %source3)";
636 if (op_it != combiner_map.end()) 636 if (op_it != combiner_map.end())
@@ -640,8 +640,8 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
640 op_str = ReplacePattern(op_str, "%source2", GetColorSourceStr(tev_stage.color_source2, tev_stage.color_modifier2)); 640 op_str = ReplacePattern(op_str, "%source2", GetColorSourceStr(tev_stage.color_source2, tev_stage.color_modifier2));
641 return ReplacePattern(op_str, "%source3", GetColorSourceStr(tev_stage.color_source3, tev_stage.color_modifier3)); 641 return ReplacePattern(op_str, "%source3", GetColorSourceStr(tev_stage.color_source3, tev_stage.color_modifier3));
642 }; 642 };
643 auto GetAlphaSourceStr = 643 static auto GetAlphaSourceStr =
644 [&source_map,&alpha_modifier_map,&ReplacePattern](const Source& src, const AlphaModifier& modifier) { 644 [](const Source& src, const AlphaModifier& modifier) {
645 auto src_it = source_map.find(src); 645 auto src_it = source_map.find(src);
646 std::string src_str = "Unknown"; 646 std::string src_str = "Unknown";
647 if (src_it != source_map.end()) 647 if (src_it != source_map.end())
@@ -654,8 +654,8 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
654 654
655 return ReplacePattern(modifier_str, "%source", src_str); 655 return ReplacePattern(modifier_str, "%source", src_str);
656 }; 656 };
657 auto GetAlphaCombinerStr = 657 static auto GetAlphaCombinerStr =
658 [&](const Regs::TevStageConfig& tev_stage) { 658 [](const Regs::TevStageConfig& tev_stage) {
659 auto op_it = combiner_map.find(tev_stage.alpha_op); 659 auto op_it = combiner_map.find(tev_stage.alpha_op);
660 std::string op_str = "Unknown op (%source1, %source2, %source3)"; 660 std::string op_str = "Unknown op (%source1, %source2, %source3)";
661 if (op_it != combiner_map.end()) 661 if (op_it != combiner_map.end())