summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-10-28 21:04:14 +0000
committerhrydgard <hrydgard@gmail.com>2008-10-28 21:04:14 +0000
commit22e1ecbb510e5b2e1501f8faacdbdca3bb12d338 (patch)
tree4a22ccaea5fb150b4748bf7cdba65b68a6b93ef2 /Source/Core
parent50547cdb5810e3750e7d3646117b2aafa99079d3 (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/NativeVertexFormat.h30
1 files changed, 27 insertions, 3 deletions
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.
};