diff options
Diffstat (limited to 'src/video_core/primitive_assembly.cpp')
| -rw-r--r-- | src/video_core/primitive_assembly.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp new file mode 100644 index 000000000..b2196d13c --- /dev/null +++ b/src/video_core/primitive_assembly.cpp | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "pica.h" | ||
| 6 | #include "primitive_assembly.h" | ||
| 7 | #include "vertex_shader.h" | ||
| 8 | |||
| 9 | namespace Pica { | ||
| 10 | |||
| 11 | namespace PrimitiveAssembly { | ||
| 12 | |||
| 13 | static OutputVertex buffer[2]; | ||
| 14 | static int buffer_index = 0; // TODO: reset this on emulation restart | ||
| 15 | |||
| 16 | void SubmitVertex(OutputVertex& vtx) | ||
| 17 | { | ||
| 18 | switch (registers.triangle_topology) { | ||
| 19 | case Regs::TriangleTopology::List: | ||
| 20 | case Regs::TriangleTopology::ListIndexed: | ||
| 21 | if (buffer_index < 2) { | ||
| 22 | buffer[buffer_index++] = vtx; | ||
| 23 | } else { | ||
| 24 | buffer_index = 0; | ||
| 25 | |||
| 26 | // TODO | ||
| 27 | // Clipper::ProcessTriangle(buffer[0], buffer[1], vtx); | ||
| 28 | } | ||
| 29 | break; | ||
| 30 | |||
| 31 | case Regs::TriangleTopology::Fan: | ||
| 32 | if (buffer_index == 2) { | ||
| 33 | buffer_index = 0; | ||
| 34 | |||
| 35 | // TODO | ||
| 36 | // Clipper::ProcessTriangle(buffer[0], buffer[1], vtx); | ||
| 37 | |||
| 38 | buffer[1] = vtx; | ||
| 39 | } else { | ||
| 40 | buffer[buffer_index++] = vtx; | ||
| 41 | } | ||
| 42 | break; | ||
| 43 | |||
| 44 | default: | ||
| 45 | ERROR_LOG(GPU, "Unknown triangle mode %x:", (int)registers.triangle_topology.Value()); | ||
| 46 | break; | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | } // namespace | ||
| 51 | |||
| 52 | } // namespace | ||