SWVertexLoader: Value initialize SetupUnit instance
This commit is contained in:
parent
331b112816
commit
a8c8dd0c53
|
@ -39,17 +39,12 @@ SWVertexLoader::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_de
|
||||||
return new NullNativeVertexFormat(vtx_decl);
|
return new NullNativeVertexFormat(vtx_decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
SWVertexLoader::SWVertexLoader()
|
SWVertexLoader::SWVertexLoader() : LocalVBuffer(MAXVBUFFERSIZE), LocalIBuffer(MAXIBUFFERSIZE)
|
||||||
{
|
{
|
||||||
LocalVBuffer.resize(MAXVBUFFERSIZE);
|
|
||||||
LocalIBuffer.resize(MAXIBUFFERSIZE);
|
|
||||||
m_SetupUnit = new SetupUnit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWVertexLoader::~SWVertexLoader()
|
SWVertexLoader::~SWVertexLoader()
|
||||||
{
|
{
|
||||||
delete m_SetupUnit;
|
|
||||||
m_SetupUnit = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SWVertexLoader::ResetBuffer(u32 stride)
|
void SWVertexLoader::ResetBuffer(u32 stride)
|
||||||
|
@ -78,7 +73,7 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_SetupUnit->Init(primitiveType);
|
m_SetupUnit.Init(primitiveType);
|
||||||
|
|
||||||
// set all states with are stored within video sw
|
// set all states with are stored within video sw
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
|
@ -96,7 +91,7 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
|
||||||
if (index == 0xffff)
|
if (index == 0xffff)
|
||||||
{
|
{
|
||||||
// primitive restart
|
// primitive restart
|
||||||
m_SetupUnit->Init(primitiveType);
|
m_SetupUnit.Init(primitiveType);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
memset(&m_Vertex, 0, sizeof(m_Vertex));
|
memset(&m_Vertex, 0, sizeof(m_Vertex));
|
||||||
|
@ -109,7 +104,7 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
|
||||||
ParseVertex(VertexLoaderManager::GetCurrentVertexFormat()->GetVertexDeclaration(), index);
|
ParseVertex(VertexLoaderManager::GetCurrentVertexFormat()->GetVertexDeclaration(), index);
|
||||||
|
|
||||||
// transform this vertex so that it can be used for rasterization (outVertex)
|
// transform this vertex so that it can be used for rasterization (outVertex)
|
||||||
OutputVertexData* outVertex = m_SetupUnit->GetVertex();
|
OutputVertexData* outVertex = m_SetupUnit.GetVertex();
|
||||||
TransformUnit::TransformPosition(&m_Vertex, outVertex);
|
TransformUnit::TransformPosition(&m_Vertex, outVertex);
|
||||||
memset(&outVertex->normal, 0, sizeof(outVertex->normal));
|
memset(&outVertex->normal, 0, sizeof(outVertex->normal));
|
||||||
if (VertexLoaderManager::g_current_components & VB_HAS_NRM0)
|
if (VertexLoaderManager::g_current_components & VB_HAS_NRM0)
|
||||||
|
@ -121,7 +116,7 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
|
||||||
TransformUnit::TransformTexCoord(&m_Vertex, outVertex, m_TexGenSpecialCase);
|
TransformUnit::TransformTexCoord(&m_Vertex, outVertex, m_TexGenSpecialCase);
|
||||||
|
|
||||||
// assemble and rasterize the primitive
|
// assemble and rasterize the primitive
|
||||||
m_SetupUnit->SetupVertex();
|
m_SetupUnit.SetupVertex();
|
||||||
|
|
||||||
INCSTAT(stats.thisFrame.numVerticesLoaded)
|
INCSTAT(stats.thisFrame.numVerticesLoaded)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,19 +4,16 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
#include "VideoBackends/Software/NativeVertexFormat.h"
|
#include "VideoBackends/Software/NativeVertexFormat.h"
|
||||||
|
#include "VideoBackends/Software/SetupUnit.h"
|
||||||
|
|
||||||
#include "VideoCommon/VertexLoaderBase.h"
|
#include "VideoCommon/VertexLoaderBase.h"
|
||||||
#include "VideoCommon/VertexManagerBase.h"
|
#include "VideoCommon/VertexManagerBase.h"
|
||||||
|
|
||||||
class SetupUnit;
|
|
||||||
|
|
||||||
class SWVertexLoader : public VertexManagerBase
|
class SWVertexLoader : public VertexManagerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -37,7 +34,7 @@ private:
|
||||||
|
|
||||||
void ParseVertex(const PortableVertexDeclaration& vdec, int index);
|
void ParseVertex(const PortableVertexDeclaration& vdec, int index);
|
||||||
|
|
||||||
SetupUnit* m_SetupUnit;
|
SetupUnit m_SetupUnit;
|
||||||
|
|
||||||
bool m_TexGenSpecialCase;
|
bool m_TexGenSpecialCase;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue