summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-08-04 19:51:42 -0700
committerPierre Bourdon <delroth@gmail.com>2014-08-04 20:47:02 -0700
commit16f180524cc1526e04cd91f33f74ca56f190bc06 (patch)
treef18195c61cc888f78f92156aa111cee0d904d74d /Source/Core/VideoCommon
parent99dc069b9a19661cf529028f3d6d1aa5ee69cf29 (diff)
VertexLoader: do not prepare for vertices if we need to skip them
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp7
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp8
2 files changed, 8 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index a4c0a2f6f2..6a094756a4 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -10,7 +10,6 @@
#include "Core/Host.h"
-#include "VideoCommon/BPMemory.h"
#include "VideoCommon/DataReader.h"
#include "VideoCommon/LookUpTables.h"
#include "VideoCommon/PixelEngine.h"
@@ -840,12 +839,6 @@ void VertexLoader::ConvertVertices ( int count )
void VertexLoader::RunVertices(const VAT& vat, int primitive, int const count)
{
- if (bpmem.genMode.cullmode == 3 && primitive < 5)
- {
- // if cull mode is none, ignore triangles and quads
- DataSkip(count * m_VertexSize);
- return;
- }
SetupRunVertices(vat, primitive, count);
ConvertVertices(count);
}
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index d94af17360..b538684b90 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -9,6 +9,7 @@
#include "Core/HW/Memmap.h"
+#include "VideoCommon/BPMemory.h"
#include "VideoCommon/IndexGenerator.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexLoader.h"
@@ -145,6 +146,13 @@ void RunVertices(int vtx_attr_group, int primitive, int count)
return;
VertexLoader* loader = RefreshLoader(vtx_attr_group);
+ if (bpmem.genMode.cullmode == GenMode::CULL_ALL && primitive < 5)
+ {
+ // if cull mode is CULL_ALL, ignore triangles and quads
+ DataSkip(count * loader->GetVertexSize());
+ return;
+ }
+
// If the native vertex format changed, force a flush.
NativeVertexFormat* required_vtx_fmt = GetNativeVertexFormat(
loader->GetNativeVertexDeclaration(),