summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-04-11 04:24:47 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2016-04-11 04:24:47 +0200
commitad664b4a01e87c98df91b77f57b4ce98e17d316a (patch)
treeebf083460ee02b09a874ec1699d181cbb1ea1fe7
parentMerge pull request #1368 from LittleWhite-tb/configure-widget (diff)
parentPica: Remove geometry dumper (PICA_DUMP_GEOMETRY) (diff)
downloadyuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar.gz
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar.bz2
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar.lz
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar.xz
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.tar.zst
yuzu-ad664b4a01e87c98df91b77f57b4ce98e17d316a.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/command_processor.cpp19
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp29
-rw-r--r--src/video_core/debug_utils/debug_utils.h21
-rw-r--r--src/video_core/primitive_assembly.cpp2
4 files changed, 0 insertions, 71 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 028b59348..08ec2907a 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -249,10 +249,6 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
const u16* index_address_16 = reinterpret_cast<const u16*>(index_address_8);
bool index_u16 = index_info.format != 0;
-#if PICA_DUMP_GEOMETRY
- DebugUtils::GeometryDumper geometry_dumper;
- PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex> dumping_primitive_assembler(regs.triangle_topology.Value());
-#endif
PrimitiveAssembler<Shader::OutputVertex>& primitive_assembler = g_state.primitive_assembler;
if (g_debug_context) {
@@ -388,17 +384,6 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
if (g_debug_context)
g_debug_context->OnEvent(DebugContext::Event::VertexLoaded, (void*)&input);
-#if PICA_DUMP_GEOMETRY
- // NOTE: When dumping geometry, we simply assume that the first input attribute
- // corresponds to the position for now.
- DebugUtils::GeometryDumper::Vertex dumped_vertex = {
- input.attr[0][0].ToFloat32(), input.attr[0][1].ToFloat32(), input.attr[0][2].ToFloat32()
- };
- using namespace std::placeholders;
- dumping_primitive_assembler.SubmitVertex(dumped_vertex,
- std::bind(&DebugUtils::GeometryDumper::AddTriangle,
- &geometry_dumper, _1, _2, _3));
-#endif
// Send to vertex shader
output = Shader::Run(shader_unit, input, attribute_config.GetNumTotalAttributes());
@@ -424,10 +409,6 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
range.second, range.first);
}
-#if PICA_DUMP_GEOMETRY
- geometry_dumper.Dump();
-#endif
-
break;
}
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
namespace DebugUtils {
-void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) {
- vertices.push_back(v0);
- vertices.push_back(v1);
- vertices.push_back(v2);
-
- int num_vertices = (int)vertices.size();
- faces.push_back({{ num_vertices-3, num_vertices-2, num_vertices-1 }});
-}
-
-void GeometryDumper::Dump() {
- static int index = 0;
- std::string filename = std::string("geometry_dump") + std::to_string(++index) + ".obj";
-
- std::ofstream file(filename);
-
- for (const auto& vertex : vertices) {
- file << "v " << vertex.pos[0]
- << " " << vertex.pos[1]
- << " " << vertex.pos[2] << std::endl;
- }
-
- for (const Face& face : faces) {
- file << "f " << 1+face.index[0]
- << " " << 1+face.index[1]
- << " " << 1+face.index[2] << std::endl;
- }
-}
-
-
void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, const Shader::ShaderSetup& setup, const Regs::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 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
namespace DebugUtils {
-#define PICA_DUMP_GEOMETRY 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:
- struct Vertex {
- std::array<float,3> pos;
- };
-
- void AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2);
-
- void Dump();
-
-private:
- struct Face {
- int index[3];
- };
-
- std::vector<Vertex> vertices;
- std::vector<Face> faces;
-};
-
void DumpShader(const std::string& filename, const Regs::ShaderConfig& config,
const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes);
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp
index 0061690f1..ff3e2b862 100644
--- a/src/video_core/primitive_assembly.cpp
+++ b/src/video_core/primitive_assembly.cpp
@@ -68,7 +68,5 @@ void PrimitiveAssembler<VertexType>::Reconfigure(Regs::TriangleTopology topology
// explicitly instantiate use cases
template
struct PrimitiveAssembler<Shader::OutputVertex>;
-template
-struct PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex>;
} // namespace