summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWVertexLoader.h
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-10-09 20:50:36 +0200
committerdegasus <wickmarkus@web.de>2016-01-06 22:10:29 +0100
commitefbe5bc4b651d1f7f726bb064255e0e2562f7490 (patch)
tree6166a471269a9b1eb2bf703a31c915489e428b44 /Source/Core/VideoBackends/Software/SWVertexLoader.h
parent7fcb5a803b2e6179fe57654496fcea7f6b2ff183 (diff)
VideoSW: Use more VideoCommon
Now we require lots of empty functions, but this removes by far more duplicated code.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.h')
-rw-r--r--Source/Core/VideoBackends/Software/SWVertexLoader.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.h b/Source/Core/VideoBackends/Software/SWVertexLoader.h
index 4972364c1b..7166ae6697 100644
--- a/Source/Core/VideoBackends/Software/SWVertexLoader.h
+++ b/Source/Core/VideoBackends/Software/SWVertexLoader.h
@@ -6,45 +6,42 @@
#include <memory>
#include <unordered_map>
+#include <vector>
#include "Common/CommonTypes.h"
-#include "VideoBackends/Software/CPMemLoader.h"
#include "VideoBackends/Software/NativeVertexFormat.h"
#include "VideoCommon/VertexLoaderBase.h"
+#include "VideoCommon/VertexManagerBase.h"
-class PointerWrap;
class SetupUnit;
-class SWVertexLoader
+class SWVertexLoader : public VertexManagerBase
{
- u32 m_VertexSize;
+public:
+ SWVertexLoader();
+ ~SWVertexLoader();
- VAT* m_CurrentVat;
+ NativeVertexFormat* CreateNativeVertexFormat(const PortableVertexDeclaration& vdec) override;
+
+protected:
+ virtual void ResetBuffer(u32 stride);
+ u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
+private:
+ void vFlush(bool useDstAlpha) override;
+ std::vector<u8> LocalVBuffer;
+ std::vector<u16> LocalIBuffer;
InputVertexData m_Vertex;
- void ParseVertex(const PortableVertexDeclaration& vdec);
+ void ParseVertex(const PortableVertexDeclaration& vdec, int index);
SetupUnit *m_SetupUnit;
bool m_TexGenSpecialCase;
- std::unordered_map<VertexLoaderUID, std::unique_ptr<VertexLoaderBase>> m_VertexLoaderMap;
- std::vector<u8> m_LoadedVertices;
- VertexLoaderBase* m_CurrentLoader;
-
- u8 m_attributeIndex;
-
public:
- SWVertexLoader();
- ~SWVertexLoader();
void SetFormat(u8 attributeIndex, u8 primitiveType);
-
- u32 GetVertexSize() { return m_VertexSize; }
-
- void LoadVertex();
- void DoState(PointerWrap &p);
};