summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2017-03-26 22:52:10 -0400
committerLioncash <mathew1800@gmail.com>2017-03-26 23:50:09 -0400
commit9ebd84e54afecee306b4bbc97fa15604def37310 (patch)
tree753d8ff6528628e92671e8348c8df68e3eca83b7 /Source/Core
parent9859533ab461c6d509337d8b9013a7ba62dd78ae (diff)
VertexLoaderManager: Return debug strings by value
This also renames AppendListToString to VertexLoadersToString.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Statistics.cpp3
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp13
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.h2
3 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp
index 1497a3df30..0a4a9236b0 100644
--- a/Source/Core/VideoCommon/Statistics.cpp
+++ b/Source/Core/VideoCommon/Statistics.cpp
@@ -68,8 +68,7 @@ std::string Statistics::ToString()
str += StringFromFormat("Uniform streamed: %i kB\n", stats.thisFrame.bytesUniformStreamed / 1024);
str += StringFromFormat("Vertex Loaders: %i\n", stats.numVertexLoaders);
- std::string vertex_list;
- VertexLoaderManager::AppendListToString(&vertex_list);
+ std::string vertex_list = VertexLoaderManager::VertexLoadersToString();
// TODO : at some point text1 just becomes too huge and overflows, we can't even read the added
// stuff
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index f0d8decb3d..463094e66b 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -98,7 +98,7 @@ struct entry
};
}
-void AppendListToString(std::string* dest)
+std::string VertexLoadersToString()
{
std::lock_guard<std::mutex> lk(s_vertex_loader_map_lock);
std::vector<entry> entries;
@@ -112,13 +112,18 @@ void AppendListToString(std::string* dest)
total_size += e.text.size() + 1;
entries.push_back(std::move(e));
}
+
sort(entries.begin(), entries.end());
- dest->reserve(dest->size() + total_size);
+
+ std::string dest;
+ dest.reserve(total_size);
for (const entry& entry : entries)
{
- *dest += entry.text;
- *dest += '\n';
+ dest += entry.text;
+ dest += '\n';
}
+
+ return dest;
}
void MarkAllDirty()
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.h b/Source/Core/VideoCommon/VertexLoaderManager.h
index bff6d4e8eb..30ceb41aec 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.h
+++ b/Source/Core/VideoCommon/VertexLoaderManager.h
@@ -30,7 +30,7 @@ NativeVertexFormatMap* GetNativeVertexFormatMap();
int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool is_preprocess);
// For debugging
-void AppendListToString(std::string* dest);
+std::string VertexLoadersToString();
NativeVertexFormat* GetCurrentVertexFormat();