Move pipeline back into VertexLoader. Started work on VertexLoaderManager, which will cache VertexLoaders. (yep, the design plan changed a little bit).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@956 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-10-25 12:35:55 +00:00
parent 3a3eebc313
commit bc79d22f5e
12 changed files with 219 additions and 116 deletions

View File

@ -70,26 +70,20 @@ typedef void (LOADERDECL *TPipelineFunction)(const void *);
// all the data loading code must always be made compatible.
class NativeVertexFormat
{
u8* m_compiledCode;
public:
NativeVertexFormat();
~NativeVertexFormat();
void Initialize(const TVtxDesc &vtx_desc, const TVtxAttr &vtx_attr);
void RunPipelineOnce(const TVtxAttr &vtx_attr) const;
void SetupVertexPointers() {
// Cast a pointer to compiled code to a pointer to a function taking no parameters, through a (void *) cast first to
// get around type checking errors, and call it.
((void (*)())(void*)m_compiledCode)();
}
void SetupVertexPointers() const;
// TODO: move these in under private:
int m_VBVertexStride; // PC-side vertex stride
int m_VBStridePad;
u32 m_components; // VB_HAS_X. Bitmask telling what vertex components are present.
TPipelineFunction m_PipelineStages[32];
int m_numPipelineStages;
u8* m_compiledCode;
};
#endif // _NATIVEVERTEXFORMAT_H