summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-12-13 00:23:54 +0100
committerdegasus <wickmarkus@web.de>2014-12-21 13:47:43 +0100
commita71c8158d91c7ee0976b9b16eeba5ea3ac18ff99 (patch)
treec1f11b1fc5ca8dd1b39bb6ffedca43b9c8af788f /Source/Core
parent6e3b2712d2fafcd8fae7ba3653207980685708e6 (diff)
VertexLoader: remove inlined getters
They just blow up the code.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoBackends/Software/SWVertexLoader.cpp6
-rw-r--r--Source/Core/VideoCommon/VertexLoader.h24
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp14
3 files changed, 18 insertions, 26 deletions
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
index c00e43e2fd..fecfb94abe 100644
--- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
+++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp
@@ -46,7 +46,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
m_VertexLoaderMap[uid] = std::unique_ptr<VertexLoader>(m_CurrentLoader);
}
- m_VertexSize = m_CurrentLoader->GetVertexSize();
+ m_VertexSize = m_CurrentLoader->m_VertexSize;
m_CurrentVat = &g_main_cp_state.vtx_attr[m_attributeIndex];
@@ -168,7 +168,7 @@ void SWVertexLoader::ParseVertex(const PortableVertexDeclaration& vdec)
void SWVertexLoader::LoadVertex()
{
- const PortableVertexDeclaration& vdec = m_CurrentLoader->GetNativeVertexDeclaration();
+ const PortableVertexDeclaration& vdec = m_CurrentLoader->m_native_vtx_decl;
// reserve memory for the destination of the vertex loader
m_LoadedVertices.resize(vdec.stride + 4);
@@ -180,7 +180,7 @@ void SWVertexLoader::LoadVertex()
DataReader(g_video_buffer_read_ptr, nullptr), // src
DataReader(m_LoadedVertices.data(), m_LoadedVertices.data() + m_LoadedVertices.size()) // dst
);
- g_video_buffer_read_ptr = old + m_CurrentLoader->GetVertexSize();
+ g_video_buffer_read_ptr = old + m_CurrentLoader->m_VertexSize;
// parse the videocommon format to our own struct format (m_Vertex)
ParseVertex(vdec);
diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h
index 92adfbeb54..0e1f60792a 100644
--- a/Source/Core/VideoCommon/VertexLoader.h
+++ b/Source/Core/VideoCommon/VertexLoader.h
@@ -102,32 +102,27 @@ public:
VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr);
~VertexLoader();
- int GetVertexSize() const {return m_VertexSize;}
- u32 GetNativeComponents() const { return m_native_components; }
- const PortableVertexDeclaration& GetNativeVertexDeclaration() const
- { return m_native_vtx_decl; }
-
void SetupRunVertices(int primitive, int const count);
int RunVertices(int primitive, int count, DataReader src, DataReader dst);
// For debugging / profiling
void AppendToString(std::string *dest) const;
- int GetNumLoadedVerts() const { return m_numLoadedVertices; }
- NativeVertexFormat* m_native_vertex_format; // used by VertexLoaderManager to cache the NativeVertexFormat objects
+ // per loader public state
+ int m_VertexSize; // number of bytes of a raw GC vertex
+ PortableVertexDeclaration m_native_vtx_decl;
+ u32 m_native_components;
+
+ // used by VertexLoaderManager
+ NativeVertexFormat* m_native_vertex_format;
+ int m_numLoadedVertices;
private:
- int m_VertexSize; // number of bytes of a raw GC vertex. Computed by CompileVertexTranslator.
-
// GC vertex format
TVtxAttr m_VtxAttr; // VAT decoded into easy format
TVtxDesc m_VtxDesc; // Not really used currently - or well it is, but could be easily avoided.
VAT m_vat;
- // PC vertex format
- u32 m_native_components;
- PortableVertexDeclaration m_native_vtx_decl;
-
#ifndef USE_VERTEX_LOADER_JIT
// Pipeline.
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
@@ -136,9 +131,6 @@ private:
const u8 *m_compiledCode;
- int m_numLoadedVertices;
-
-
void SetVAT(const VAT& vat);
void CompileVertexTranslator();
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index 48f924d9d4..98f92e3d10 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -75,7 +75,7 @@ void AppendListToString(std::string *dest)
{
entry e;
map_entry.second->AppendToString(&e.text);
- e.num_verts = map_entry.second->GetNumLoadedVerts();
+ e.num_verts = map_entry.second->m_numLoadedVertices;
entries.push_back(e);
total_size += e.text.size() + 1;
}
@@ -111,14 +111,14 @@ static VertexLoader* RefreshLoader(int vtx_attr_group, CPState* state)
s_vertex_loader_map[uid] = std::unique_ptr<VertexLoader>(loader);
// search for a cached native vertex format
- const PortableVertexDeclaration& format = loader->GetNativeVertexDeclaration();
+ const PortableVertexDeclaration& format = loader->m_native_vtx_decl;
auto& native = s_native_vertex_map[format];
if (!native)
{
auto raw_pointer = g_vertex_manager->CreateNativeVertexFormat();
native = std::unique_ptr<NativeVertexFormat>(raw_pointer);
native->Initialize(format);
- native->m_components = loader->GetNativeComponents();
+ native->m_components = loader->m_native_components;
}
loader->m_native_vertex_format = native.get();
@@ -141,7 +141,7 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
VertexLoader* loader = RefreshLoader(vtx_attr_group, state);
- int size = count * loader->GetVertexSize();
+ int size = count * loader->m_VertexSize;
if ((int)src.size() < size)
return -1;
@@ -157,13 +157,13 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
s_current_vtx_fmt = loader->m_native_vertex_format;
DataReader dst = VertexManager::PrepareForAdditionalData(primitive, count,
- loader->GetNativeVertexDeclaration().stride);
+ loader->m_native_vtx_decl.stride);
count = loader->RunVertices(primitive, count, src, dst);
IndexGenerator::AddIndices(primitive, count);
- VertexManager::FlushData(count, loader->GetNativeVertexDeclaration().stride);
+ VertexManager::FlushData(count, loader->m_native_vtx_decl.stride);
ADDSTAT(stats.thisFrame.numPrims, count);
INCSTAT(stats.thisFrame.numPrimitiveJoins);
@@ -172,7 +172,7 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
int GetVertexSize(int vtx_attr_group, bool preprocess)
{
- return RefreshLoader(vtx_attr_group, preprocess ? &g_preprocess_cp_state : &g_main_cp_state)->GetVertexSize();
+ return RefreshLoader(vtx_attr_group, preprocess ? &g_preprocess_cp_state : &g_main_cp_state)->m_VertexSize;
}
NativeVertexFormat* GetCurrentVertexFormat()