summaryrefslogtreecommitdiffstats
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.cpp22
-rw-r--r--src/video_core/debug_utils/debug_utils.h12
2 files changed, 11 insertions, 23 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index f7d9455be..48e6dd182 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -22,27 +22,17 @@ namespace Pica {
namespace DebugUtils {
-void GeometryDumper::AddVertex(std::array<float,3> pos, TriangleTopology topology) {
- vertices.push_back({pos[0], pos[1], pos[2]});
+void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) {
+ vertices.push_back(v0);
+ vertices.push_back(v1);
+ vertices.push_back(v2);
int num_vertices = vertices.size();
-
- switch (topology) {
- case TriangleTopology::List:
- case TriangleTopology::ListIndexed:
- if (0 == (num_vertices % 3))
- faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 });
- break;
-
- default:
- ERROR_LOG(GPU, "Unknown triangle topology %x", (int)topology);
- exit(0);
- break;
- }
+ faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 });
}
void GeometryDumper::Dump() {
- // NOTE: Permanently enabling this just trashes hard disks for no reason.
+ // NOTE: Permanently enabling this just trashes the hard disk for no reason.
// Hence, this is currently disabled.
return;
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 53c33c96e..8b1499bf2 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -14,20 +14,18 @@ namespace Pica {
namespace DebugUtils {
-using TriangleTopology = Regs::TriangleTopology;
-
// Simple utility class for dumping geometry data to an OBJ file
class GeometryDumper {
public:
- void AddVertex(std::array<float,3> pos, TriangleTopology topology);
-
- void Dump();
-
-private:
struct Vertex {
std::array<float,3> pos;
};
+ void AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2);
+
+ void Dump();
+
+private:
struct Face {
int index[3];
};