summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-10-25 13:27:28 +0000
committerhrydgard <hrydgard@gmail.com>2008-10-25 13:27:28 +0000
commit2f6d41e413ef2197ee25d1a9ea1790c9d64e548b (patch)
tree5082396fd2378e83f4a0268fd0b34f771c70fb1a /Source/Core
parentbc79d22f5e4293a390f9f6ae27bc29372856196f (diff)
Move moving things around and preparing for the next step (cached vertexloaders).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@957 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/CPMemory.cpp3
-rw-r--r--Source/Core/VideoCommon/Src/CPMemory.h10
-rw-r--r--Source/Core/VideoCommon/Src/NativeVertexFormat.h7
-rw-r--r--Source/Core/VideoCommon/Src/VideoState.cpp3
4 files changed, 16 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/Src/CPMemory.cpp b/Source/Core/VideoCommon/Src/CPMemory.cpp
index 06aa8d6192..837dde70ac 100644
--- a/Source/Core/VideoCommon/Src/CPMemory.cpp
+++ b/Source/Core/VideoCommon/Src/CPMemory.cpp
@@ -24,3 +24,6 @@ u32 arraybases[16];
u32 arraystrides[16];
TMatrixIndexA MatrixIndexA;
TMatrixIndexB MatrixIndexB;
+TVtxDesc g_VtxDesc;
+// Most games only use the first VtxAttr and simply reconfigure it all the time as needed.
+VAT g_VtxAttr[8];
diff --git a/Source/Core/VideoCommon/Src/CPMemory.h b/Source/Core/VideoCommon/Src/CPMemory.h
index 67e918292d..9557984ecf 100644
--- a/Source/Core/VideoCommon/Src/CPMemory.h
+++ b/Source/Core/VideoCommon/Src/CPMemory.h
@@ -248,4 +248,14 @@ extern u32 arraystrides[16];
extern TMatrixIndexA MatrixIndexA;
extern TMatrixIndexB MatrixIndexB;
+struct VAT
+{
+ UVAT_group0 g0;
+ UVAT_group1 g1;
+ UVAT_group2 g2;
+};
+
+extern TVtxDesc g_VtxDesc;
+extern VAT g_VtxAttr[8];
+
#endif
diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
index e0213c4ad2..2f3dd08f9b 100644
--- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h
+++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
@@ -55,17 +55,12 @@ enum {
VB_HAS_UVTEXMTXSHIFT=13,
};
-
#define LOADERDECL __cdecl
typedef void (LOADERDECL *TPipelineFunction)(const void *);
-// This will soon be used in a cache of vertex formats, rather than used in-place.
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
// is in the respective plugin, not here in VideoCommon.
-// This class will also be split into NativeVertexFormat and VertexFormatConverter.
-// VertexFormatConverters will be cached, indexed by TVtxDesc+TVtxAttr.
-
// Note that this class can't just invent arbitrary vertex formats out of its input -
// all the data loading code must always be made compatible.
class NativeVertexFormat
@@ -84,6 +79,4 @@ public:
u32 m_components; // VB_HAS_X. Bitmask telling what vertex components are present.
};
-
-
#endif // _NATIVEVERTEXFORMAT_H
diff --git a/Source/Core/VideoCommon/Src/VideoState.cpp b/Source/Core/VideoCommon/Src/VideoState.cpp
index 70a812e113..55b7c6f9f7 100644
--- a/Source/Core/VideoCommon/Src/VideoState.cpp
+++ b/Source/Core/VideoCommon/Src/VideoState.cpp
@@ -32,6 +32,9 @@ static void DoState(PointerWrap &p) {
p.DoArray(arraystrides, 16);
p.Do(MatrixIndexA);
p.Do(MatrixIndexB);
+ p.Do(g_VtxDesc.Hex);
+ p.DoArray(g_VtxAttr, 8);
+
// XF Memory
p.Do(xfregs);
p.DoArray(xfmem, XFMEM_SIZE);