From 000e78144ce87d0be1749f26b9d0494d3c4ddf2f Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 27 Jan 2017 20:16:36 -0800 Subject: VideoCore: Split rasterizer regs from Regs struct --- src/video_core/debug_utils/debug_utils.cpp | 4 ++-- src/video_core/debug_utils/debug_utils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/video_core/debug_utils') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 2d40f7d4f..618268654 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -90,7 +90,7 @@ namespace DebugUtils { void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, - const Regs::VSOutputAttributes* output_attributes) { + const RasterizerRegs::VSOutputAttributes* output_attributes) { struct StuffToWrite { const u8* pointer; u32 size; @@ -129,7 +129,7 @@ void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, // This is put into a try-catch block to make sure we notice unknown configurations. std::vector output_info_table; for (unsigned i = 0; i < 7; ++i) { - using OutputAttributes = Pica::Regs::VSOutputAttributes; + using OutputAttributes = Pica::RasterizerRegs::VSOutputAttributes; // TODO: It's still unclear how the attribute components map to the register! // Once we know that, this code probably will not make much sense anymore. diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 938a2e1b5..51270bc9c 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -184,7 +184,7 @@ namespace DebugUtils { void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, - const Regs::VSOutputAttributes* output_attributes); + const RasterizerRegs::VSOutputAttributes* output_attributes); // Utility class to log Pica commands. struct PicaTrace { -- cgit v1.2.3 From 9017093f58fb08b85cfb842f305efa667d62cecb Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 27 Jan 2017 20:51:59 -0800 Subject: VideoCore: Split texturing regs from Regs struct --- src/video_core/debug_utils/debug_utils.cpp | 35 +++++++++++++++++------------- src/video_core/debug_utils/debug_utils.h | 8 +++---- 2 files changed, 24 insertions(+), 19 deletions(-) (limited to 'src/video_core/debug_utils') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 618268654..81cd35cd9 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -331,7 +331,7 @@ static void FlushIOFile(png_structp png_ptr) { } #endif -void DumpTexture(const Pica::Regs::TextureConfig& texture_config, u8* data) { +void DumpTexture(const TexturingRegs::TextureConfig& texture_config, u8* data) { #ifndef HAVE_PNG return; #else @@ -396,7 +396,7 @@ void DumpTexture(const Pica::Regs::TextureConfig& texture_config, u8* data) { info.width = texture_config.width; info.height = texture_config.height; info.stride = row_stride; - info.format = g_state.regs.texture0_format; + info.format = g_state.regs.texturing.texture0_format; Math::Vec4 texture_color = Pica::Texture::LookupTexture(data, x, y, info); buf[3 * x + y * row_stride] = texture_color.r(); buf[3 * x + y * row_stride + 1] = texture_color.g(); @@ -434,8 +434,10 @@ static std::string ReplacePattern(const std::string& input, const std::string& p return ret; } -static std::string GetTevStageConfigSourceString(const Pica::Regs::TevStageConfig::Source& source) { - using Source = Pica::Regs::TevStageConfig::Source; +static std::string GetTevStageConfigSourceString( + const TexturingRegs::TevStageConfig::Source& source) { + + using Source = TexturingRegs::TevStageConfig::Source; static const std::map source_map = { {Source::PrimaryColor, "PrimaryColor"}, {Source::PrimaryFragmentColor, "PrimaryFragmentColor"}, @@ -457,9 +459,10 @@ static std::string GetTevStageConfigSourceString(const Pica::Regs::TevStageConfi } static std::string GetTevStageConfigColorSourceString( - const Pica::Regs::TevStageConfig::Source& source, - const Pica::Regs::TevStageConfig::ColorModifier modifier) { - using ColorModifier = Pica::Regs::TevStageConfig::ColorModifier; + const TexturingRegs::TevStageConfig::Source& source, + const TexturingRegs::TevStageConfig::ColorModifier modifier) { + + using ColorModifier = TexturingRegs::TevStageConfig::ColorModifier; static const std::map color_modifier_map = { {ColorModifier::SourceColor, "%source.rgb"}, {ColorModifier::OneMinusSourceColor, "(1.0 - %source.rgb)"}, @@ -483,9 +486,10 @@ static std::string GetTevStageConfigColorSourceString( } static std::string GetTevStageConfigAlphaSourceString( - const Pica::Regs::TevStageConfig::Source& source, - const Pica::Regs::TevStageConfig::AlphaModifier modifier) { - using AlphaModifier = Pica::Regs::TevStageConfig::AlphaModifier; + const TexturingRegs::TevStageConfig::Source& source, + const TexturingRegs::TevStageConfig::AlphaModifier modifier) { + + using AlphaModifier = TexturingRegs::TevStageConfig::AlphaModifier; static const std::map alpha_modifier_map = { {AlphaModifier::SourceAlpha, "%source.a"}, {AlphaModifier::OneMinusSourceAlpha, "(1.0 - %source.a)"}, @@ -507,8 +511,9 @@ static std::string GetTevStageConfigAlphaSourceString( } static std::string GetTevStageConfigOperationString( - const Pica::Regs::TevStageConfig::Operation& operation) { - using Operation = Pica::Regs::TevStageConfig::Operation; + const TexturingRegs::TevStageConfig::Operation& operation) { + + using Operation = TexturingRegs::TevStageConfig::Operation; static const std::map combiner_map = { {Operation::Replace, "%source1"}, {Operation::Modulate, "(%source1 * %source2)"}, @@ -528,7 +533,7 @@ static std::string GetTevStageConfigOperationString( return op_it->second; } -std::string GetTevStageConfigColorCombinerString(const Pica::Regs::TevStageConfig& tev_stage) { +std::string GetTevStageConfigColorCombinerString(const TexturingRegs::TevStageConfig& tev_stage) { auto op_str = GetTevStageConfigOperationString(tev_stage.color_op); op_str = ReplacePattern( op_str, "%source1", @@ -541,7 +546,7 @@ std::string GetTevStageConfigColorCombinerString(const Pica::Regs::TevStageConfi GetTevStageConfigColorSourceString(tev_stage.color_source3, tev_stage.color_modifier3)); } -std::string GetTevStageConfigAlphaCombinerString(const Pica::Regs::TevStageConfig& tev_stage) { +std::string GetTevStageConfigAlphaCombinerString(const TexturingRegs::TevStageConfig& tev_stage) { auto op_str = GetTevStageConfigOperationString(tev_stage.alpha_op); op_str = ReplacePattern( op_str, "%source1", @@ -554,7 +559,7 @@ std::string GetTevStageConfigAlphaCombinerString(const Pica::Regs::TevStageConfi GetTevStageConfigAlphaSourceString(tev_stage.alpha_source3, tev_stage.alpha_modifier3)); } -void DumpTevStageConfig(const std::array& stages) { +void DumpTevStageConfig(const std::array& stages) { std::string stage_info = "Tev setup:\n"; for (size_t index = 0; index < stages.size(); ++index) { const auto& tev_stage = stages[index]; diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 51270bc9c..e58b76d41 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -205,13 +205,13 @@ inline bool IsPicaTracing() { void OnPicaRegWrite(PicaTrace::Write write); std::unique_ptr FinishPicaTracing(); -void DumpTexture(const Pica::Regs::TextureConfig& texture_config, u8* data); +void DumpTexture(const TexturingRegs::TextureConfig& texture_config, u8* data); -std::string GetTevStageConfigColorCombinerString(const Pica::Regs::TevStageConfig& tev_stage); -std::string GetTevStageConfigAlphaCombinerString(const Pica::Regs::TevStageConfig& tev_stage); +std::string GetTevStageConfigColorCombinerString(const TexturingRegs::TevStageConfig& tev_stage); +std::string GetTevStageConfigAlphaCombinerString(const TexturingRegs::TevStageConfig& tev_stage); /// Dumps the Tev stage config to log at trace level -void DumpTevStageConfig(const std::array& stages); +void DumpTevStageConfig(const std::array& stages); /** * Used in the vertex loader to merge access records. TODO: Investigate if actually useful. -- cgit v1.2.3 From f7c7f422c6995a31c1a16c0865bbe13bb38469a3 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 28 Jan 2017 13:03:13 -0800 Subject: VideoCore: Split shader regs from Regs struct --- src/video_core/debug_utils/debug_utils.cpp | 2 +- src/video_core/debug_utils/debug_utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/debug_utils') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 81cd35cd9..ec8a9ee4a 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -88,7 +88,7 @@ std::shared_ptr g_debug_context; // TODO: Get rid of this global namespace DebugUtils { -void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, +void DumpShader(const std::string& filename, const ShaderRegs& config, const Shader::ShaderSetup& setup, const RasterizerRegs::VSOutputAttributes* output_attributes) { struct StuffToWrite { diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index e58b76d41..44d5af462 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -182,7 +182,7 @@ namespace DebugUtils { #define PICA_DUMP_TEXTURES 0 #define PICA_LOG_TEV 0 -void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, +void DumpShader(const std::string& filename, const ShaderRegs& config, const Shader::ShaderSetup& setup, const RasterizerRegs::VSOutputAttributes* output_attributes); -- cgit v1.2.3 From 5759d94b5c5b11af426668d046d206839bc5e802 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 28 Jan 2017 13:27:24 -0800 Subject: VideoCore: Move Regs to its own file --- src/video_core/debug_utils/debug_utils.cpp | 2 +- src/video_core/debug_utils/debug_utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/debug_utils') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index ec8a9ee4a..e164e83a1 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -29,10 +29,10 @@ #include "common/math_util.h" #include "common/vector_math.h" #include "video_core/debug_utils/debug_utils.h" -#include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" #include "video_core/rasterizer_interface.h" +#include "video_core/regs.h" #include "video_core/renderer_base.h" #include "video_core/shader/shader.h" #include "video_core/texture/texture_decode.h" diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 44d5af462..fd94bdbb8 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -17,7 +17,7 @@ #include #include "common/common_types.h" #include "common/vector_math.h" -#include "video_core/pica.h" +#include "video_core/regs.h" namespace CiTrace { class Recorder; -- cgit v1.2.3