summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
committerskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
commit7784fa4c67cc8d2545f45694d83805e7e89cd583 (patch)
tree7724133aabe971ec417d1dea0977a525bb8debfb /Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
parentd33c19b0cd2bae982c8d35e86a9d3551f9e5c72f (diff)
parent5cea0d9defeaa23e7af94adf7615a44fb2c9c173 (diff)
Merge branch 'master' into wii-network
# By Ryan Houdek (185) and others # Via degasus (12) and others * master: (625 commits) Revert "Don't open/close file for every file operation." as it was crashing PokePark in Windows builds. Array overrun fixed in VertexShaderCache for the DX11 plugin. Fixed DSPTool build. Windows build fix Go back to assuming every HID device is a wiimote on Windows. Fixed issue 6117. Unfixed issue 6031. VideoSoftware: Improve fog range adjustment by using less magic and more comments. revert RasterFont for VideoSoftware ogl: fix virtual xfb Windows build fix from web interface... Adjusted the audio loop criteria, using >= on the Wii and == on GC. This fixes the audio static that occurred in Wii games after hours of play. Forced the exception check only for ARAM DMA transfers. Removed the Eternal Darkness boot hack and replaced it with an exception check. VideoSoftware: Implement fog range adjustment, fixing issue 6147. implement 4xSSAA for OGL move ogl-only settings into backend Fix description of disable fog, and move it to enhancements tab. Reverted rd76ca5783743 as it was made obsolete by r1d550f4496e4. Removed the tracking of the FIFO Writes as it was made obsolete by r1d550f4496e4. Forced the external exception check to occur sooner by changing the downcount. Mark the Direct3D9 backend deprecated. Prefer D3D11 and OpenGL over D3D9 by default. ... Conflicts: CMakeLists.txt Source/Core/Common/Common.vcxproj.filters Source/Core/Common/Src/CommonPaths.h Source/Core/Core/Core.vcxproj.filters Source/Core/Core/Src/Core.cpp Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp Source/VSProps/Dolphin.Win32.props Source/VSProps/Dolphin.x64.props
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp403
1 files changed, 80 insertions, 323 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
index ba3bb73f43..f914226a63 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
@@ -28,290 +28,79 @@
#include <tmmintrin.h>
#endif
-#define LOG_TEX1() // PRIM_LOG("tex: %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0]);
-#define LOG_TEX2() // PRIM_LOG("tex: %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1]);
+template <int N>
+void LOG_TEX();
-extern int tcIndex;
-extern float tcScale[8];
-
-void LOADERDECL TexCoord_Read_Dummy()
+template <>
+__forceinline void LOG_TEX<1>()
{
- tcIndex++;
+ // warning: mapping buffer should be disabled to use this
+ // PRIM_LOG("tex: %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-1]);
}
-void LOADERDECL TexCoord_ReadDirect_UByte1()
+template <>
+__forceinline void LOG_TEX<2>()
{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU8() * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadDirect_UByte2()
-{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU8() * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)DataReadU8() * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
+ // warning: mapping buffer should be disabled to use this
+ // PRIM_LOG("tex: %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-2], ((float*)VertexManager::s_pCurBufferPointer)[-1]);
}
-void LOADERDECL TexCoord_ReadDirect_Byte1()
-{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)DataReadU8() * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadDirect_Byte2()
-{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)DataReadU8() * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s8)DataReadU8() * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
+extern int tcIndex;
+extern float tcScale[8];
-void LOADERDECL TexCoord_ReadDirect_UShort1()
-{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU16() * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadDirect_UShort2()
+void LOADERDECL TexCoord_Read_Dummy()
{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU16() * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)DataReadU16() * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
}
-void LOADERDECL TexCoord_ReadDirect_Short1()
-{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)DataReadU16() * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadDirect_Short2()
+template <typename T>
+float TCScale(T val)
{
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)DataReadU16() * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s16)DataReadU16() * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
+ return val * tcScale[tcIndex];
}
-void LOADERDECL TexCoord_ReadDirect_Float1()
-{
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = DataReadU32();
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadDirect_Float2()
-{
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = DataReadU32();
- ((u32*)VertexManager::s_pCurBufferPointer)[1] = DataReadU32();
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
+template <>
+float TCScale(float val)
+{ return val; }
-// ==================================================================================
-void LOADERDECL TexCoord_ReadIndex8_UByte1()
+template <typename T, int N>
+void LOADERDECL TexCoord_ReadDirect()
{
- u8 Index = DataReadU8();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(*pData) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex8_UByte2()
-{
- u8 Index = DataReadU8();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(u8)(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
+ for (int i = 0; i != N; ++i)
+ DataWrite(TCScale(DataRead<T>()));
-void LOADERDECL TexCoord_ReadIndex8_Byte1()
-{
- u8 Index = DataReadU8();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
+ LOG_TEX<N>();
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)(*pData) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex8_Byte2()
-{
- u8 Index = DataReadU8();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s8)(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
+ ++tcIndex;
}
-void LOADERDECL TexCoord_ReadIndex8_UShort1()
-{
- u8 Index = DataReadU8();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Common::swap16(*pData) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex8_UShort2()
+template <typename I, typename T, int N>
+void LOADERDECL TexCoord_ReadIndex()
{
- u8 Index = DataReadU8();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Common::swap16(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(u16)Common::swap16(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
+ static_assert(!std::numeric_limits<I>::is_signed, "Only unsigned I is sane!");
+
+ auto const index = DataRead<I>();
+ auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_TEXCOORD0 + tcIndex]
+ + (index * arraystrides[ARRAY_TEXCOORD0 + tcIndex]));
-void LOADERDECL TexCoord_ReadIndex8_Short1()
-{
- u8 Index = DataReadU8();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Common::swap16(pData[0]) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex8_Short2()
-{
- u8 Index = DataReadU8();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Common::swap16(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s16)Common::swap16(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
+ for (int i = 0; i != N; ++i)
+ DataWrite(TCScale(Common::FromBigEndian(data[i])));
-void LOADERDECL TexCoord_ReadIndex8_Float1()
-{
- u16 Index = DataReadU8();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = Common::swap32(pData[0]);
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex8_Float2()
-{
- u16 Index = DataReadU8();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = Common::swap32(pData[0]);
- ((u32*)VertexManager::s_pCurBufferPointer)[1] = Common::swap32(pData[1]);
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
-
-// ==================================================================================
-void LOADERDECL TexCoord_ReadIndex16_UByte1()
-{
- u16 Index = DataReadU16();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)(pData[0]) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex16_UByte2()
-{
- u16 Index = DataReadU16();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(u8)(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
-
-void LOADERDECL TexCoord_ReadIndex16_Byte1()
-{
- u16 Index = DataReadU16();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)(pData[0]) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex16_Byte2()
-{
- u16 Index = DataReadU16();
- const u8 *pData = cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s8)(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
-
-void LOADERDECL TexCoord_ReadIndex16_UShort1()
-{
- u16 Index = DataReadU16();
- const u16* pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Common::swap16(pData[0]) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-void LOADERDECL TexCoord_ReadIndex16_UShort2()
-{
- u16 Index = DataReadU16();
- const u16* pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Common::swap16(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(u16)Common::swap16(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
-
-void LOADERDECL TexCoord_ReadIndex16_Short1()
-{
- u16 Index = DataReadU16();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Common::swap16(*pData) * tcScale[tcIndex];
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-
-void LOADERDECL TexCoord_ReadIndex16_Short2()
-{
- // Heavy in ZWW
- u16 Index = DataReadU16();
- const u16 *pData = (const u16 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Common::swap16(pData[0]) * tcScale[tcIndex];
- ((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s16)Common::swap16(pData[1]) * tcScale[tcIndex];
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
+ LOG_TEX<N>();
+ ++tcIndex;
}
#if _M_SSE >= 0x401
static const __m128i kMaskSwap16_2 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0xFFFFFFFFL, 0x02030001L);
-void LOADERDECL TexCoord_ReadIndex16_Short2_SSE4()
+template <typename I>
+void LOADERDECL TexCoord_ReadIndex_Short2_SSE4()
{
+ static_assert(!std::numeric_limits<I>::is_signed, "Only unsigned I is sane!");
+
// Heavy in ZWW
- u16 Index = DataReadU16();
- const s32 *pData = (const s32*)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
+ auto const index = DataRead<I>();
+ const s32 *pData = (const s32*)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
const __m128i a = _mm_cvtsi32_si128(*pData);
const __m128i b = _mm_shuffle_epi8(a, kMaskSwap16_2);
const __m128i c = _mm_cvtepi16_epi32(b);
@@ -319,47 +108,27 @@ void LOADERDECL TexCoord_ReadIndex16_Short2_SSE4()
const __m128 e = _mm_load1_ps(&tcScale[tcIndex]);
const __m128 f = _mm_mul_ps(d, e);
_mm_storeu_ps((float*)VertexManager::s_pCurBufferPointer, f);
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
+ VertexManager::s_pCurBufferPointer += sizeof(float) * 2;
+ LOG_TEX<2>();
tcIndex++;
}
#endif
-void LOADERDECL TexCoord_ReadIndex16_Float1()
-{
- u16 Index = DataReadU16();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = Common::swap32(pData[0]);
- LOG_TEX1();
- VertexManager::s_pCurBufferPointer += 4;
- tcIndex++;
-}
-
-void LOADERDECL TexCoord_ReadIndex16_Float2()
-{
- u16 Index = DataReadU16();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
- ((u32*)VertexManager::s_pCurBufferPointer)[0] = Common::swap32(pData[0]);
- ((u32*)VertexManager::s_pCurBufferPointer)[1] = Common::swap32(pData[1]);
- LOG_TEX2();
- VertexManager::s_pCurBufferPointer += 8;
- tcIndex++;
-}
-
#if _M_SSE >= 0x301
static const __m128i kMaskSwap32 = _mm_set_epi32(0xFFFFFFFFL, 0xFFFFFFFFL, 0x04050607L, 0x00010203L);
-void LOADERDECL TexCoord_ReadIndex16_Float2_SSSE3()
+template <typename I>
+void LOADERDECL TexCoord_ReadIndex_Float2_SSSE3()
{
- u16 Index = DataReadU16();
- const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
+ static_assert(!std::numeric_limits<I>::is_signed, "Only unsigned I is sane!");
+
+ auto const index = DataRead<I>();
+ const u32 *pData = (const u32 *)(cached_arraybases[ARRAY_TEXCOORD0+tcIndex] + (index * arraystrides[ARRAY_TEXCOORD0+tcIndex]));
GC_ALIGNED128(const __m128i a = _mm_loadl_epi64((__m128i*)pData));
GC_ALIGNED128(const __m128i b = _mm_shuffle_epi8(a, kMaskSwap32));
- u8* p = VertexManager::s_pCurBufferPointer;
- _mm_storel_epi64((__m128i*)p, b);
- LOG_TEX2();
- p += 8;
- VertexManager::s_pCurBufferPointer = p;
+ _mm_storel_epi64((__m128i*)VertexManager::s_pCurBufferPointer, b);
+ VertexManager::s_pCurBufferPointer += sizeof(float) * 2;
+ LOG_TEX<2>();
tcIndex++;
}
#endif
@@ -373,56 +142,40 @@ static TPipelineFunction tableReadTexCoord[4][8][2] = {
{NULL, NULL,},
},
{
- {TexCoord_ReadDirect_UByte1, TexCoord_ReadDirect_UByte2,},
- {TexCoord_ReadDirect_Byte1, TexCoord_ReadDirect_Byte2,},
- {TexCoord_ReadDirect_UShort1, TexCoord_ReadDirect_UShort2,},
- {TexCoord_ReadDirect_Short1, TexCoord_ReadDirect_Short2,},
- {TexCoord_ReadDirect_Float1, TexCoord_ReadDirect_Float2,},
+ {TexCoord_ReadDirect<u8, 1>, TexCoord_ReadDirect<u8, 2>,},
+ {TexCoord_ReadDirect<s8, 1>, TexCoord_ReadDirect<s8, 2>,},
+ {TexCoord_ReadDirect<u16, 1>, TexCoord_ReadDirect<u16, 2>,},
+ {TexCoord_ReadDirect<s16, 1>, TexCoord_ReadDirect<s16, 2>,},
+ {TexCoord_ReadDirect<float, 1>, TexCoord_ReadDirect<float, 2>,},
},
{
- {TexCoord_ReadIndex8_UByte1, TexCoord_ReadIndex8_UByte2,},
- {TexCoord_ReadIndex8_Byte1, TexCoord_ReadIndex8_Byte2,},
- {TexCoord_ReadIndex8_UShort1, TexCoord_ReadIndex8_UShort2,},
- {TexCoord_ReadIndex8_Short1, TexCoord_ReadIndex8_Short2,},
- {TexCoord_ReadIndex8_Float1, TexCoord_ReadIndex8_Float2,},
+ {TexCoord_ReadIndex<u8, u8, 1>, TexCoord_ReadIndex<u8, u8, 2>,},
+ {TexCoord_ReadIndex<u8, s8, 1>, TexCoord_ReadIndex<u8, s8, 2>,},
+ {TexCoord_ReadIndex<u8, u16, 1>, TexCoord_ReadIndex<u8, u16, 2>,},
+ {TexCoord_ReadIndex<u8, s16, 1>, TexCoord_ReadIndex<u8, s16, 2>,},
+ {TexCoord_ReadIndex<u8, float, 1>, TexCoord_ReadIndex<u8, float, 2>,},
},
{
- {TexCoord_ReadIndex16_UByte1, TexCoord_ReadIndex16_UByte2,},
- {TexCoord_ReadIndex16_Byte1, TexCoord_ReadIndex16_Byte2,},
- {TexCoord_ReadIndex16_UShort1, TexCoord_ReadIndex16_UShort2,},
- {TexCoord_ReadIndex16_Short1, TexCoord_ReadIndex16_Short2,},
- {TexCoord_ReadIndex16_Float1, TexCoord_ReadIndex16_Float2,},
+ {TexCoord_ReadIndex<u16, u8, 1>, TexCoord_ReadIndex<u16, u8, 2>,},
+ {TexCoord_ReadIndex<u16, s8, 1>, TexCoord_ReadIndex<u16, s8, 2>,},
+ {TexCoord_ReadIndex<u16, u16, 1>, TexCoord_ReadIndex<u16, u16, 2>,},
+ {TexCoord_ReadIndex<u16, s16, 1>, TexCoord_ReadIndex<u16, s16, 2>,},
+ {TexCoord_ReadIndex<u16, float, 1>, TexCoord_ReadIndex<u16, float, 2>,},
},
};
static int tableReadTexCoordVertexSize[4][8][2] = {
{
- {0, 0,},
- {0, 0,},
- {0, 0,},
- {0, 0,},
- {0, 0,},
+ {0, 0,}, {0, 0,}, {0, 0,}, {0, 0,}, {0, 0,},
},
{
- {1, 2,},
- {1, 2,},
- {2, 4,},
- {2, 4,},
- {4, 8,},
+ {1, 2,}, {1, 2,}, {2, 4,}, {2, 4,}, {4, 8,},
},
{
- {1, 1,},
- {1, 1,},
- {1, 1,},
- {1, 1,},
- {1, 1,},
+ {1, 1,}, {1, 1,}, {1, 1,}, {1, 1,}, {1, 1,},
},
{
- {2, 2,},
- {2, 2,},
- {2, 2,},
- {2, 2,},
- {2, 2,},
+ {2, 2,}, {2, 2,}, {2, 2,}, {2, 2,}, {2, 2,},
},
};
@@ -430,16 +183,20 @@ void VertexLoader_TextCoord::Init(void) {
#if _M_SSE >= 0x301
- if (cpu_info.bSSSE3) {
- tableReadTexCoord[3][4][1] = TexCoord_ReadIndex16_Float2_SSSE3;
+ if (cpu_info.bSSSE3)
+ {
+ tableReadTexCoord[2][4][1] = TexCoord_ReadIndex_Float2_SSSE3<u8>;
+ tableReadTexCoord[3][4][1] = TexCoord_ReadIndex_Float2_SSSE3<u16>;
}
#endif
#if _M_SSE >= 0x401
- if (cpu_info.bSSE4_1) {
- tableReadTexCoord[3][3][1] = TexCoord_ReadIndex16_Short2_SSE4;
+ if (cpu_info.bSSE4_1)
+ {
+ tableReadTexCoord[2][3][1] = TexCoord_ReadIndex_Short2_SSE4<u8>;
+ tableReadTexCoord[3][3][1] = TexCoord_ReadIndex_Short2_SSE4<u16>;
}
#endif