summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authorSoren Jorvang <soren.jorvang@gmail.com>2010-07-18 05:31:51 +0000
committerSoren Jorvang <soren.jorvang@gmail.com>2010-07-18 05:31:51 +0000
commitfaf586e8f1b1f9dc08840ae6003a334ff2f310d4 (patch)
tree95edcbec5f57d6ccd4a6095a32f6e228a9f78747 /Source/Core/VideoCommon/Src/VertexLoader_Position.cpp
parent2c419382c97c30e68c0cc60c8df9f98d5cf9ed80 (diff)
Because we only ever call Pos_ReadDirect (and through that, DataRead<T>)
from JIT generated code, the compiler may not get the heads-up to properly prepare for run-time instantiation of those template functions. Explicitly instantiating Pos_ReadDirect gets around that issue. Also force DataRead* inline as gcc didn't always do that itself when the DataRead functions in turn were called from (other) template functions. I am far from a C++ language lawyer, so I cannot speak learnedly about the correctness of this solution, but it works. Dolphin.app built on OS X 10.6 now actually works on 10.5 as well. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5901 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader_Position.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp
index 7eb2767e7f..42c689ab9a 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp
@@ -92,11 +92,21 @@ void Pos_ReadDirect()
VertexManager::s_pCurBufferPointer += 12;
}
+// Explicitly instantiate these functions to decrease the possibility of
+// symbol binding problems when (only) calling them from JIT compiled code.
+template void Pos_ReadDirect<u8, true>();
+template void Pos_ReadDirect<s8, true>();
+template void Pos_ReadDirect<u16, true>();
+template void Pos_ReadDirect<s16, true>();
+template void Pos_ReadDirect<u8, false>();
+template void Pos_ReadDirect<s8, false>();
+template void Pos_ReadDirect<u16, false>();
+template void Pos_ReadDirect<s16, false>();
+
void LOADERDECL Pos_ReadDirect_UByte3() { Pos_ReadDirect<u8, true>(); }
void LOADERDECL Pos_ReadDirect_Byte3() { Pos_ReadDirect<s8, true>(); }
void LOADERDECL Pos_ReadDirect_UShort3() { Pos_ReadDirect<u16, true>(); }
void LOADERDECL Pos_ReadDirect_Short3() { Pos_ReadDirect<s16, true>(); }
-
void LOADERDECL Pos_ReadDirect_UByte2() { Pos_ReadDirect<u8, false>(); }
void LOADERDECL Pos_ReadDirect_Byte2() { Pos_ReadDirect<s8, false>(); }
void LOADERDECL Pos_ReadDirect_UShort2() { Pos_ReadDirect<u16, false>(); }