From 22e1ecbb510e5b2e1501f8faacdbdca3bb12d338 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 28 Oct 2008 21:04:14 +0000 Subject: Make it possible to turn off the tiny vertex format setup JIT, may help macosx compatibility work (pretty useless, a jit for the actual vertex loading would have been much more useful) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@993 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/NativeVertexFormat.h | 30 +++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Source/Core') diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h index 64382ff040..bb9be45d79 100644 --- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h +++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h @@ -18,7 +18,6 @@ #ifndef _NATIVEVERTEXFORMAT_H #define _NATIVEVERTEXFORMAT_H -#include "CPMemory.h" #include "PluginSpecs.h" // m_components @@ -58,6 +57,31 @@ enum { #define LOADERDECL __cdecl typedef void (LOADERDECL *TPipelineFunction)(const void *); +enum VarType { + VAR_BYTE, + VAR_UNSIGNED_BYTE, + VAR_SHORT, + VAR_UNSIGNED_SHORT, + VAR_FLOAT, +}; + +struct PortableVertexDeclaration +{ + int stride; + + int num_normals; + int normal_offset[3]; + VarType normal_gl_type; + int normal_gl_size; + VarType color_gl_type; // always GL_UNSIGNED_BYTE + int color_offset[2]; + VarType texcoord_gl_type[8]; + int texcoord_gl_size[8]; + int texcoord_offset[8]; + int texcoord_size[8]; + int posmtx_offset; +}; + // The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp // is in the respective plugin, not here in VideoCommon. @@ -66,15 +90,15 @@ typedef void (LOADERDECL *TPipelineFunction)(const void *); class NativeVertexFormat { u8* m_compiledCode; + PortableVertexDeclaration vtx_decl; public: NativeVertexFormat(); ~NativeVertexFormat(); - void Initialize(const TVtxDesc &vtx_desc, const TVtxAttr &vtx_attr); + void Initialize(const PortableVertexDeclaration &vtx_decl); void SetupVertexPointers() const; // TODO: move these in under private: - int m_VBVertexStride; // PC-side vertex stride u32 m_components; // VB_HAS_X. Bitmask telling what vertex components are present. }; -- cgit v1.2.3