diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2015-11-01 22:39:31 +0100 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2015-11-01 22:39:31 +0100 |
| commit | 983978ee66cc15c010b2af6703aab866f3a41dcf (patch) | |
| tree | 3d7a4f5410fb14c06ad0c8c5909ed74f4d22dce8 /Source/Core/VideoCommon/VertexLoaderManager.cpp | |
| parent | 491e1495458e692feacba9dfc3e9ffbc7f17cebb (diff) | |
VideoCommon: flush vertex manager if components change
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 8 |
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. |
