summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/IndexGenerator.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-11-27 17:16:53 +1000
committerStenzek <stenzek@gmail.com>2018-12-04 17:37:25 +1000
commit7afd5cc2fb7e45f2c497e5aed007a017b8461335 (patch)
tree17f445fc7a686cd28859e6c46fb1a32d64a56123 /Source/Core/VideoCommon/IndexGenerator.cpp
parent5ca18ff04e6dd69e09a5675db8f9474a51bdfcc0 (diff)
Use main buffers for utility draws
Diffstat (limited to 'Source/Core/VideoCommon/IndexGenerator.cpp')
-rw-r--r--Source/Core/VideoCommon/IndexGenerator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/IndexGenerator.cpp b/Source/Core/VideoCommon/IndexGenerator.cpp
index 6cb49aceba..5e45cc6a5f 100644
--- a/Source/Core/VideoCommon/IndexGenerator.cpp
+++ b/Source/Core/VideoCommon/IndexGenerator.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cstddef>
+#include <cstring>
#include "Common/CommonTypes.h"
#include "Common/Compiler.h"
@@ -56,6 +57,13 @@ void IndexGenerator::AddIndices(int primitive, u32 numVerts)
base_index += numVerts;
}
+void IndexGenerator::AddExternalIndices(const u16* indices, u32 num_indices, u32 num_vertices)
+{
+ std::memcpy(index_buffer_current, indices, sizeof(u16) * num_indices);
+ index_buffer_current += num_indices;
+ base_index += num_vertices;
+}
+
// Triangles
template <bool pr>
DOLPHIN_FORCE_INLINE u16* IndexGenerator::WriteTriangle(u16* Iptr, u32 index1, u32 index2,