summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_TextCoord.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_TextCoord.cpp121
1 files changed, 32 insertions, 89 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
index a64e1f1cde..02bfc8922b 100644
--- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
@@ -14,6 +14,8 @@
#include "VideoCommon/VertexLoaderManager.h"
#include "VideoCommon/VertexLoaderUtils.h"
+namespace
+{
template <int N>
void LOG_TEX();
@@ -32,19 +34,19 @@ void LOG_TEX<2>()
// ((float*)g_vertex_manager_write_ptr)[-1]);
}
-static void TexCoord_Read_Dummy(VertexLoader* loader)
+void TexCoord_Read_Dummy(VertexLoader* loader)
{
loader->m_tcIndex++;
}
template <typename T>
-float TCScale(T val, float scale)
+constexpr float TCScale(T val, float scale)
{
return val * scale;
}
template <>
-float TCScale(float val, float scale)
+constexpr float TCScale(float val, [[maybe_unused]] float scale)
{
return val;
}
@@ -52,7 +54,7 @@ float TCScale(float val, float scale)
template <typename T, int N>
void TexCoord_ReadDirect(VertexLoader* loader)
{
- auto const scale = loader->m_tcScale[loader->m_tcIndex];
+ const auto scale = loader->m_tcScale[loader->m_tcIndex];
DataReader dst(g_vertex_manager_write_ptr, nullptr);
DataReader src(g_video_buffer_read_ptr, nullptr);
@@ -71,11 +73,11 @@ void TexCoord_ReadIndex(VertexLoader* loader)
{
static_assert(std::is_unsigned<I>::value, "Only unsigned I is sane!");
- auto const index = DataRead<I>();
- auto const data = reinterpret_cast<const T*>(
+ const auto index = DataRead<I>();
+ const auto data = reinterpret_cast<const T*>(
VertexLoaderManager::cached_arraybases[ARRAY_TEXCOORD0 + loader->m_tcIndex] +
(index * g_main_cp_state.array_strides[ARRAY_TEXCOORD0 + loader->m_tcIndex]));
- auto const scale = loader->m_tcScale[loader->m_tcIndex];
+ const auto scale = loader->m_tcScale[loader->m_tcIndex];
DataReader dst(g_vertex_manager_write_ptr, nullptr);
for (int i = 0; i != N; ++i)
@@ -86,7 +88,7 @@ void TexCoord_ReadIndex(VertexLoader* loader)
++loader->m_tcIndex;
}
-static TPipelineFunction tableReadTexCoord[4][8][2] = {
+TPipelineFunction tableReadTexCoord[4][8][2] = {
{
{
nullptr,
@@ -177,96 +179,37 @@ static TPipelineFunction tableReadTexCoord[4][8][2] = {
},
};
-static int tableReadTexCoordVertexSize[4][8][2] = {
+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},
},
};
+} // Anonymous namespace
unsigned int VertexLoader_TextCoord::GetSize(u64 _type, unsigned int _format,
unsigned int _elements)