From 983978ee66cc15c010b2af6703aab866f3a41dcf Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 1 Nov 2015 22:39:31 +0100 Subject: VideoCommon: flush vertex manager if components change --- Source/Core/VideoCommon/VertexLoaderManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp') 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> NativeVertexFormatMap; static NativeVertexFormatMap s_native_vertex_map; static NativeVertexFormat* s_current_vtx_fmt; +u32 g_current_components; typedef std::unordered_map> 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. -- cgit v1.2.3