aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/debug_utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/debug_utils')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp45
-rw-r--r--src/video_core/debug_utils/debug_utils.h16
2 files changed, 31 insertions, 30 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 7b8ab72b..e9a85841 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -23,6 +23,7 @@
#include "common/vector_math.h"
#include "video_core/pica.h"
+#include "video_core/renderer_base.h"
#include "video_core/utils.h"
#include "video_core/video_core.h"
@@ -84,15 +85,11 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) {
vertices.push_back(v1);
vertices.push_back(v2);
- int num_vertices = vertices.size();
+ int num_vertices = (int)vertices.size();
faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 });
}
void GeometryDumper::Dump() {
- // NOTE: Permanently enabling this just trashes the hard disk for no reason.
- // Hence, this is currently disabled.
- return;
-
static int index = 0;
std::string filename = std::string("geometry_dump") + std::to_string(++index) + ".obj";
@@ -115,10 +112,6 @@ void GeometryDumper::Dump() {
void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data, u32 swizzle_size,
u32 main_offset, const Regs::VSOutputAttributes* output_attributes)
{
- // NOTE: Permanently enabling this just trashes hard disks for no reason.
- // Hence, this is currently disabled.
- return;
-
struct StuffToWrite {
u8* pointer;
u32 size;
@@ -240,8 +233,8 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
dvle.main_offset_words = main_offset;
dvle.output_register_table_offset = write_offset - dvlb.dvle_offset;
- dvle.output_register_table_size = output_info_table.size();
- QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo));
+ dvle.output_register_table_size = static_cast<uint32_t>(output_info_table.size());
+ QueueForWriting((u8*)output_info_table.data(), static_cast<u32>(output_info_table.size() * sizeof(OutputRegisterInfo)));
// TODO: Create a label table for "main"
@@ -496,31 +489,31 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
// Lookup base value
Math::Vec3<int> ret;
if (differential_mode) {
- ret.r() = differential.r;
- ret.g() = differential.g;
- ret.b() = differential.b;
+ ret.r() = static_cast<int>(differential.r);
+ ret.g() = static_cast<int>(differential.g);
+ ret.b() = static_cast<int>(differential.b);
if (x >= 2) {
- ret.r() += differential.dr;
- ret.g() += differential.dg;
- ret.b() += differential.db;
+ ret.r() += static_cast<int>(differential.dr);
+ ret.g() += static_cast<int>(differential.dg);
+ ret.b() += static_cast<int>(differential.db);
}
ret.r() = Color::Convert5To8(ret.r());
ret.g() = Color::Convert5To8(ret.g());
ret.b() = Color::Convert5To8(ret.b());
} else {
if (x < 2) {
- ret.r() = Color::Convert4To8(separate.r1);
- ret.g() = Color::Convert4To8(separate.g1);
- ret.b() = Color::Convert4To8(separate.b1);
+ ret.r() = Color::Convert4To8(static_cast<u8>(separate.r1));
+ ret.g() = Color::Convert4To8(static_cast<u8>(separate.g1));
+ ret.b() = Color::Convert4To8(static_cast<u8>(separate.b1));
} else {
- ret.r() = Color::Convert4To8(separate.r2);
- ret.g() = Color::Convert4To8(separate.g2);
- ret.b() = Color::Convert4To8(separate.b2);
+ ret.r() = Color::Convert4To8(static_cast<u8>(separate.r2));
+ ret.g() = Color::Convert4To8(static_cast<u8>(separate.g2));
+ ret.b() = Color::Convert4To8(static_cast<u8>(separate.b2));
}
}
// Add modifier
- unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value();
+ unsigned table_index = static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value());
static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{
{ 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 },
@@ -564,10 +557,6 @@ TextureInfo TextureInfo::FromPicaRegister(const Regs::TextureConfig& config,
}
void DumpTexture(const Pica::Regs::TextureConfig& texture_config, u8* data) {
- // NOTE: Permanently enabling this just trashes hard disks for no reason.
- // Hence, this is currently disabled.
- return;
-
#ifndef HAVE_PNG
return;
#else
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 7926d64e..81eea30a 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -14,6 +14,8 @@
#include "common/vector_math.h"
+#include "core/tracer/recorder.h"
+
#include "video_core/pica.h"
namespace Pica {
@@ -23,11 +25,14 @@ public:
enum class Event {
FirstEvent = 0,
- CommandLoaded = FirstEvent,
- CommandProcessed,
+ PicaCommandLoaded = FirstEvent,
+ PicaCommandProcessed,
IncomingPrimitiveBatch,
FinishedPrimitiveBatch,
VertexLoaded,
+ IncomingDisplayTransfer,
+ GSPCommandProcessed,
+ BufferSwapped,
NumEvents
};
@@ -129,6 +134,8 @@ public:
Event active_breakpoint;
bool at_breakpoint = false;
+ std::shared_ptr<CiTrace::Recorder> recorder = nullptr;
+
private:
/**
* Private default constructor to make sure people always construct this through Construct()
@@ -150,6 +157,11 @@ extern std::shared_ptr<DebugContext> g_debug_context; // TODO: Get rid of this g
namespace DebugUtils {
+#define PICA_DUMP_GEOMETRY 0
+#define PICA_DUMP_SHADERS 0
+#define PICA_DUMP_TEXTURES 0
+#define PICA_LOG_TEV 0
+
// Simple utility class for dumping geometry data to an OBJ file
class GeometryDumper {
public: