mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
VertexLoader: Eliminate use of DataReader
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways. Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
This commit is contained in:
@ -332,7 +332,7 @@ static void CheckCPConfiguration(int vtx_attr_group)
|
||||
}
|
||||
|
||||
template <bool IsPreprocess>
|
||||
int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, DataReader src)
|
||||
int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, const u8* src)
|
||||
{
|
||||
if (count == 0) [[unlikely]]
|
||||
return 0;
|
||||
@ -341,8 +341,6 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
|
||||
VertexLoaderBase* loader = RefreshLoader<IsPreprocess>(vtx_attr_group);
|
||||
|
||||
int size = count * loader->m_vertex_size;
|
||||
if ((int)src.size() < size) [[unlikely]]
|
||||
return -1;
|
||||
|
||||
if constexpr (!IsPreprocess)
|
||||
{
|
||||
@ -371,7 +369,7 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
|
||||
DataReader dst = g_vertex_manager->PrepareForAdditionalData(
|
||||
primitive, count, loader->m_native_vtx_decl.stride, cullall);
|
||||
|
||||
count = loader->RunVertices(src, dst, count);
|
||||
count = loader->RunVertices(src, dst.GetPointer(), count);
|
||||
|
||||
g_vertex_manager->AddIndices(primitive, count);
|
||||
g_vertex_manager->FlushData(count, loader->m_native_vtx_decl.stride);
|
||||
@ -383,9 +381,9 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
|
||||
}
|
||||
|
||||
template int RunVertices<false>(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count,
|
||||
DataReader src);
|
||||
const u8* src);
|
||||
template int RunVertices<true>(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count,
|
||||
DataReader src);
|
||||
const u8* src);
|
||||
|
||||
NativeVertexFormat* GetCurrentVertexFormat()
|
||||
{
|
||||
|
Reference in New Issue
Block a user