Skip to content

Commit

Permalink
Merge pull request #739 from delroth/vertex-loader-fix
Browse files Browse the repository at this point in the history
VertexLoader: do not prepare for vertices if we need to skip them

Fixes issue [7542](https://code.google.com/p/dolphin-emu/issues/detail?id=7542)
  • Loading branch information
lioncash committed Aug 5, 2014
2 parents b7d4481 + 16f1805 commit e170195
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Source/Core/VideoCommon/VertexLoader.cpp
Expand Up @@ -10,7 +10,6 @@

#include "Core/Host.h"

#include "VideoCommon/BPMemory.h"
#include "VideoCommon/DataReader.h"
#include "VideoCommon/LookUpTables.h"
#include "VideoCommon/PixelEngine.h"
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/VideoCommon/VertexLoaderManager.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit e170195

Please sign in to comment.