7 changed files with 95 additions and 2 deletions
-
2src/video_core/CMakeLists.txt
-
3src/video_core/command_processor.cpp
-
15src/video_core/pica.h
-
52src/video_core/primitive_assembly.cpp
-
21src/video_core/primitive_assembly.h
-
2src/video_core/video_core.vcxproj
-
2src/video_core/video_core.vcxproj.filters
@ -0,0 +1,52 @@ |
|||||
|
// Copyright 2014 Citra Emulator Project
|
||||
|
// Licensed under GPLv2
|
||||
|
// Refer to the license.txt file included.
|
||||
|
|
||||
|
#include "pica.h"
|
||||
|
#include "primitive_assembly.h"
|
||||
|
#include "vertex_shader.h"
|
||||
|
|
||||
|
namespace Pica { |
||||
|
|
||||
|
namespace PrimitiveAssembly { |
||||
|
|
||||
|
static OutputVertex buffer[2]; |
||||
|
static int buffer_index = 0; // TODO: reset this on emulation restart
|
||||
|
|
||||
|
void SubmitVertex(OutputVertex& vtx) |
||||
|
{ |
||||
|
switch (registers.triangle_topology) { |
||||
|
case Regs::TriangleTopology::List: |
||||
|
case Regs::TriangleTopology::ListIndexed: |
||||
|
if (buffer_index < 2) { |
||||
|
buffer[buffer_index++] = vtx; |
||||
|
} else { |
||||
|
buffer_index = 0; |
||||
|
|
||||
|
// TODO
|
||||
|
// Clipper::ProcessTriangle(buffer[0], buffer[1], vtx);
|
||||
|
} |
||||
|
break; |
||||
|
|
||||
|
case Regs::TriangleTopology::Fan: |
||||
|
if (buffer_index == 2) { |
||||
|
buffer_index = 0; |
||||
|
|
||||
|
// TODO
|
||||
|
// Clipper::ProcessTriangle(buffer[0], buffer[1], vtx);
|
||||
|
|
||||
|
buffer[1] = vtx; |
||||
|
} else { |
||||
|
buffer[buffer_index++] = vtx; |
||||
|
} |
||||
|
break; |
||||
|
|
||||
|
default: |
||||
|
ERROR_LOG(GPU, "Unknown triangle mode %x:", (int)registers.triangle_topology.Value()); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} // namespace
|
||||
|
|
||||
|
} // namespace
|
||||
@ -0,0 +1,21 @@ |
|||||
|
// Copyright 2014 Citra Emulator Project |
||||
|
// Licensed under GPLv2 |
||||
|
// Refer to the license.txt file included. |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
namespace Pica { |
||||
|
|
||||
|
namespace VertexShader { |
||||
|
struct OutputVertex; |
||||
|
} |
||||
|
|
||||
|
namespace PrimitiveAssembly { |
||||
|
|
||||
|
using VertexShader::OutputVertex; |
||||
|
|
||||
|
void SubmitVertex(OutputVertex& vtx); |
||||
|
|
||||
|
} // namespace |
||||
|
|
||||
|
} // namespace |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue