summaryrefslogtreecommitdiff
path: root/src/video_core/debug_utils
diff options
context:
space:
mode:
authorGravatar Jannik Vogel2016-04-10 22:07:06 +0200
committerGravatar Jannik Vogel2016-04-10 22:07:06 +0200
commitff7c798d8601d59b095e60feea43e98e20054c22 (patch)
tree10bbbe8454dd2516e7d1dcaa9f8ffa05fcf957ea /src/video_core/debug_utils
parentMerge pull request #1653 from mailwl/blx-lr (diff)
downloadyuzu-ff7c798d8601d59b095e60feea43e98e20054c22.tar.gz
yuzu-ff7c798d8601d59b095e60feea43e98e20054c22.tar.xz
yuzu-ff7c798d8601d59b095e60feea43e98e20054c22.zip
Pica: Remove geometry dumper (PICA_DUMP_GEOMETRY)
Diffstat (limited to 'src/video_core/debug_utils')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp29
-rw-r--r--src/video_core/debug_utils/debug_utils.h21
2 files changed, 0 insertions, 50 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index bac6d69c7..693f93597 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -85,35 +85,6 @@ std::shared_ptr<DebugContext> g_debug_context; // TODO: Get rid of this global
85 85
86namespace DebugUtils { 86namespace DebugUtils {
87 87
88void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) {
89 vertices.push_back(v0);
90 vertices.push_back(v1);
91 vertices.push_back(v2);
92
93 int num_vertices = (int)vertices.size();
94 faces.push_back({{ num_vertices-3, num_vertices-2, num_vertices-1 }});
95}
96
97void GeometryDumper::Dump() {
98 static int index = 0;
99 std::string filename = std::string("geometry_dump") + std::to_string(++index) + ".obj";
100
101 std::ofstream file(filename);
102
103 for (const auto& vertex : vertices) {
104 file << "v " << vertex.pos[0]
105 << " " << vertex.pos[1]
106 << " " << vertex.pos[2] << std::endl;
107 }
108
109 for (const Face& face : faces) {
110 file << "f " << 1+face.index[0]
111 << " " << 1+face.index[1]
112 << " " << 1+face.index[2] << std::endl;
113 }
114}
115
116
117void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes) 88void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes)
118{ 89{
119 struct StuffToWrite { 90 struct StuffToWrite {
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 795160a32..7df941619 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -158,30 +158,9 @@ extern std::shared_ptr<DebugContext> g_debug_context; // TODO: Get rid of this g
158 158
159namespace DebugUtils { 159namespace DebugUtils {
160 160
161#define PICA_DUMP_GEOMETRY 0
162#define PICA_DUMP_TEXTURES 0 161#define PICA_DUMP_TEXTURES 0
163#define PICA_LOG_TEV 0 162#define PICA_LOG_TEV 0
164 163
165// Simple utility class for dumping geometry data to an OBJ file
166class GeometryDumper {
167public:
168 struct Vertex {
169 std::array<float,3> pos;
170 };
171
172 void AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2);
173
174 void Dump();
175
176private:
177 struct Face {
178 int index[3];
179 };
180
181 std::vector<Vertex> vertices;
182 std::vector<Face> faces;
183};
184
185void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, 164void DumpShader(const std::string& filename, const Regs::ShaderConfig& config,
186 const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes); 165 const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes);
187 166