summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index 4a61c6bc6e..bc4f136500 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -32,6 +32,7 @@ u32 position_matrix_index[3];
typedef std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> NativeVertexFormatMap;
static NativeVertexFormatMap s_native_vertex_map;
static NativeVertexFormat* s_current_vtx_fmt;
+u32 g_current_components;
typedef std::unordered_map<VertexLoaderUID, std::unique_ptr<VertexLoaderBase>> VertexLoaderMap;
static std::mutex s_vertex_loader_map_lock;
@@ -153,7 +154,6 @@ static VertexLoaderBase* RefreshLoader(int vtx_attr_group, bool preprocess = fal
{
native.reset(g_vertex_manager->CreateNativeVertexFormat());
native->Initialize(format);
- native->m_components = loader->m_native_components;
}
loader->m_native_vertex_format = native.get();
}
@@ -185,9 +185,13 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
return size;
// If the native vertex format changed, force a flush.
- if (loader->m_native_vertex_format != s_current_vtx_fmt)
+ if (loader->m_native_vertex_format != s_current_vtx_fmt ||
+ loader->m_native_components != g_current_components)
+ {
VertexManager::Flush();
+ }
s_current_vtx_fmt = loader->m_native_vertex_format;
+ g_current_components = loader->m_native_components;
// if cull mode is CULL_ALL, tell VertexManager to skip triangles and quads.
// They still need to go through vertex loading, because we need to calculate a zfreeze refrence slope.