mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: clean up VertexLoader
This commit is contained in:
@ -130,24 +130,23 @@ static VertexLoader* RefreshLoader(int vtx_attr_group, CPState* state)
|
||||
return loader;
|
||||
}
|
||||
|
||||
bool RunVertices(int vtx_attr_group, int primitive, int count, DataReader& src, bool skip_drawing)
|
||||
int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool skip_drawing)
|
||||
{
|
||||
if (!count)
|
||||
return true;
|
||||
return 0;
|
||||
|
||||
CPState* state = &g_main_cp_state;
|
||||
|
||||
VertexLoader* loader = RefreshLoader(vtx_attr_group, state);
|
||||
|
||||
size_t size = count * loader->GetVertexSize();
|
||||
if (src.size() < size)
|
||||
return false;
|
||||
int size = count * loader->GetVertexSize();
|
||||
if ((int)src.size() < size)
|
||||
return -1;
|
||||
|
||||
if (skip_drawing || (bpmem.genMode.cullmode == GenMode::CULL_ALL && primitive < 5))
|
||||
{
|
||||
// if cull mode is CULL_ALL, ignore triangles and quads
|
||||
src.Skip(size);
|
||||
return true;
|
||||
return size;
|
||||
}
|
||||
|
||||
NativeVertexFormat* native = loader->GetNativeVertexFormat();
|
||||
@ -157,19 +156,18 @@ bool RunVertices(int vtx_attr_group, int primitive, int count, DataReader& src,
|
||||
VertexManager::Flush();
|
||||
s_current_vtx_fmt = native;
|
||||
|
||||
VertexManager::PrepareForAdditionalData(primitive, count,
|
||||
DataReader dst = VertexManager::PrepareForAdditionalData(primitive, count,
|
||||
loader->GetNativeVertexDeclaration().stride);
|
||||
|
||||
|
||||
src.WritePointer(&g_video_buffer_read_ptr);
|
||||
loader->RunVertices(state->vtx_attr[vtx_attr_group], primitive, count);
|
||||
src = g_video_buffer_read_ptr;
|
||||
count = loader->RunVertices(state->vtx_attr[vtx_attr_group], primitive, count, src, dst);
|
||||
|
||||
IndexGenerator::AddIndices(primitive, count);
|
||||
|
||||
VertexManager::FlushData(count, loader->GetNativeVertexDeclaration().stride);
|
||||
|
||||
ADDSTAT(stats.thisFrame.numPrims, count);
|
||||
INCSTAT(stats.thisFrame.numPrimitiveJoins);
|
||||
return true;
|
||||
return size;
|
||||
}
|
||||
|
||||
int GetVertexSize(int vtx_attr_group, bool preprocess)
|
||||
|
Reference in New Issue
Block a user