From 60a1d0593c27315743d336ca11ed04a9fc2464c4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:24:11 -0400 Subject: [PATCH 1/7] VertexLoader_Color: Place helper functions in anonymous namespace While we're at it, convert the define into a constexpr variable. --- .../Core/VideoCommon/VertexLoader_Color.cpp | 151 +++++++++--------- 1 file changed, 77 insertions(+), 74 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp index 7a87519bd3..6e8bbd4e44 100644 --- a/Source/Core/VideoCommon/VertexLoader_Color.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp @@ -12,9 +12,11 @@ #include "VideoCommon/VertexLoaderUtils.h" #include "VideoCommon/VertexLoader_Color.h" -#define AMASK 0xFF000000 +namespace +{ +constexpr u32 alpha_mask = 0xFF000000; -static void SetCol(VertexLoader* loader, u32 val) +void SetCol(VertexLoader* loader, u32 val) { DataWrite(val); loader->m_colIndex++; @@ -22,7 +24,7 @@ static void SetCol(VertexLoader* loader, u32 val) // Color comes in format BARG in 16 bits // BARG -> AABBGGRR -static void SetCol4444(VertexLoader* loader, u16 val_) +void SetCol4444(VertexLoader* loader, u16 val_) { u32 col, val = val_; col = val & 0x00F0; // col = 000000R0; @@ -35,7 +37,7 @@ static void SetCol4444(VertexLoader* loader, u16 val_) // Color comes in format RGBA // RRRRRRGG GGGGBBBB BBAAAAAA -static void SetCol6666(VertexLoader* loader, u32 val) +void SetCol6666(VertexLoader* loader, u32 val) { u32 col = (val >> 16) & 0x000000FC; col |= (val >> 2) & 0x0000FC00; @@ -47,7 +49,7 @@ static void SetCol6666(VertexLoader* loader, u32 val) // Color comes in RGB // RRRRRGGG GGGBBBBB -static void SetCol565(VertexLoader* loader, u16 val_) +void SetCol565(VertexLoader* loader, u16 val_) { u32 col, val = val_; col = (val >> 8) & 0x0000F8; @@ -55,21 +57,87 @@ static void SetCol565(VertexLoader* loader, u16 val_) col |= (val << 19) & 0xF80000; col |= (col >> 5) & 0x070007; col |= (col >> 6) & 0x000300; - SetCol(loader, col | AMASK); + SetCol(loader, col | alpha_mask); } -static u32 Read32(const u8* addr) +u32 Read32(const u8* addr) { u32 value; std::memcpy(&value, addr, sizeof(u32)); return value; } -static u32 Read24(const u8* addr) +u32 Read24(const u8* addr) { - return Read32(addr) | AMASK; + return Read32(addr) | alpha_mask; } +template +void Color_ReadIndex_16b_565(VertexLoader* loader) +{ + const auto index = DataRead(); + const u8* const address = + VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); + + u16 value; + std::memcpy(&value, address, sizeof(u16)); + + SetCol565(loader, Common::swap16(value)); +} + +template +void Color_ReadIndex_24b_888(VertexLoader* loader) +{ + const auto index = DataRead(); + const u8* address = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); + SetCol(loader, Read24(address)); +} + +template +void Color_ReadIndex_32b_888x(VertexLoader* loader) +{ + const auto index = DataRead(); + const u8* address = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); + SetCol(loader, Read24(address)); +} + +template +void Color_ReadIndex_16b_4444(VertexLoader* loader) +{ + auto const index = DataRead(); + const u8* const address = + VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); + + u16 value; + std::memcpy(&value, address, sizeof(u16)); + + SetCol4444(loader, value); +} + +template +void Color_ReadIndex_24b_6666(VertexLoader* loader) +{ + const auto index = DataRead(); + const u8* data = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]) - 1; + const u32 val = Common::swap32(data); + SetCol6666(loader, val); +} + +template +void Color_ReadIndex_32b_8888(VertexLoader* loader) +{ + const auto index = DataRead(); + const u8* address = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + + (index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); + SetCol(loader, Read32(address)); +} +} // Anonymous namespace + void Color_ReadDirect_24b_888(VertexLoader* loader) { SetCol(loader, Read24(DataGetPosition())); @@ -103,71 +171,6 @@ void Color_ReadDirect_32b_8888(VertexLoader* loader) SetCol(loader, DataReadU32Unswapped()); } -template -void Color_ReadIndex_16b_565(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* const address = - VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); - - u16 value; - std::memcpy(&value, address, sizeof(u16)); - - SetCol565(loader, Common::swap16(value)); -} - -template -void Color_ReadIndex_24b_888(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* iAddress = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); - SetCol(loader, Read24(iAddress)); -} - -template -void Color_ReadIndex_32b_888x(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* iAddress = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); - SetCol(loader, Read24(iAddress)); -} - -template -void Color_ReadIndex_16b_4444(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* const address = - VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); - - u16 value; - std::memcpy(&value, address, sizeof(u16)); - - SetCol4444(loader, value); -} - -template -void Color_ReadIndex_24b_6666(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* pData = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]) - 1; - u32 val = Common::swap32(pData); - SetCol6666(loader, val); -} - -template -void Color_ReadIndex_32b_8888(VertexLoader* loader) -{ - auto const Index = DataRead(); - const u8* iAddress = VertexLoaderManager::cached_arraybases[ARRAY_COLOR + loader->m_colIndex] + - (Index * g_main_cp_state.array_strides[ARRAY_COLOR + loader->m_colIndex]); - SetCol(loader, Read32(iAddress)); -} - void Color_ReadIndex8_16b_565(VertexLoader* loader) { Color_ReadIndex_16b_565(loader); From be9a03b35fbf53e2e7a68d869607d8913dd2a699 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:29:20 -0400 Subject: [PATCH 2/7] VertexLoader_Position: Place helper functions in anonymous namespace --- .../VideoCommon/VertexLoader_Position.cpp | 123 +++++------------- 1 file changed, 33 insertions(+), 90 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index a21061ac55..1cb38a88c4 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -16,14 +16,16 @@ #include "VideoCommon/VertexLoaderUtils.h" #include "VideoCommon/VideoCommon.h" +namespace +{ template -float PosScale(T val, float scale) +constexpr float PosScale(T val, float scale) { return val * scale; } template <> -float PosScale(float val, float scale) +constexpr float PosScale(float val, [[maybe_unused]] float scale) { return val; } @@ -32,13 +34,13 @@ template void Pos_ReadDirect(VertexLoader* loader) { static_assert(N <= 3, "N > 3 is not sane!"); - auto const scale = loader->m_posScale; + const auto scale = loader->m_posScale; DataReader dst(g_vertex_manager_write_ptr, nullptr); DataReader src(g_video_buffer_read_ptr, nullptr); for (int i = 0; i < N; ++i) { - float value = PosScale(src.Read(), scale); + const float value = PosScale(src.Read(), scale); if (loader->m_counter < 3) VertexLoaderManager::position_cache[loader->m_counter][i] = value; dst.Write(value); @@ -55,17 +57,17 @@ void Pos_ReadIndex(VertexLoader* loader) static_assert(std::is_unsigned::value, "Only unsigned I is sane!"); static_assert(N <= 3, "N > 3 is not sane!"); - auto const index = DataRead(); + const auto index = DataRead(); loader->m_vertexSkip = index == std::numeric_limits::max(); - auto const data = + const auto data = reinterpret_cast(VertexLoaderManager::cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION])); - auto const scale = loader->m_posScale; + const auto scale = loader->m_posScale; DataReader dst(g_vertex_manager_write_ptr, nullptr); for (int i = 0; i < N; ++i) { - float value = PosScale(Common::FromBigEndian(data[i]), scale); + const float value = PosScale(Common::FromBigEndian(data[i]), scale); if (loader->m_counter < 3) VertexLoaderManager::position_cache[loader->m_counter][i] = value; dst.Write(value); @@ -75,7 +77,7 @@ void Pos_ReadIndex(VertexLoader* loader) LOG_VTX(); } -static TPipelineFunction tableReadPosition[4][8][2] = { +TPipelineFunction tableReadPosition[4][8][2] = { { { nullptr, @@ -166,96 +168,37 @@ static TPipelineFunction tableReadPosition[4][8][2] = { }, }; -static int tableReadPositionVertexSize[4][8][2] = { +int tableReadPositionVertexSize[4][8][2] = { { - { - 0, - 0, - }, - { - 0, - 0, - }, - { - 0, - 0, - }, - { - 0, - 0, - }, - { - 0, - 0, - }, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, }, { - { - 2, - 3, - }, - { - 2, - 3, - }, - { - 4, - 6, - }, - { - 4, - 6, - }, - { - 8, - 12, - }, + {2, 3}, + {2, 3}, + {4, 6}, + {4, 6}, + {8, 12}, }, { - { - 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_Position::GetSize(u64 _type, unsigned int _format, unsigned int _elements) { From 14e544eef8737634f952c85da4ebac22491f813f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:30:50 -0400 Subject: [PATCH 3/7] VertexLoader_Position: Make lookup tables immutable Allows the compiler to place these arrays within the read-only segment. --- Source/Core/VideoCommon/VertexLoader_Position.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index 1cb38a88c4..d4a816a36c 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -77,7 +77,7 @@ void Pos_ReadIndex(VertexLoader* loader) LOG_VTX(); } -TPipelineFunction tableReadPosition[4][8][2] = { +constexpr TPipelineFunction s_table_read_position[4][8][2] = { { { nullptr, @@ -168,7 +168,7 @@ TPipelineFunction tableReadPosition[4][8][2] = { }, }; -int tableReadPositionVertexSize[4][8][2] = { +constexpr int s_table_read_position_vertex_size[4][8][2] = { { {0, 0}, {0, 0}, @@ -202,11 +202,11 @@ int tableReadPositionVertexSize[4][8][2] = { unsigned int VertexLoader_Position::GetSize(u64 _type, unsigned int _format, unsigned int _elements) { - return tableReadPositionVertexSize[_type][_format][_elements]; + return s_table_read_position_vertex_size[_type][_format][_elements]; } TPipelineFunction VertexLoader_Position::GetFunction(u64 _type, unsigned int _format, unsigned int _elements) { - return tableReadPosition[_type][_format][_elements]; + return s_table_read_position[_type][_format][_elements]; } From 6f656b72199ba95398d5a0b08cab7f7a5db9e876 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:33:43 -0400 Subject: [PATCH 4/7] VertexLoader_Position: Tidy up public function definitions We can use u32 instead of unsigned int to shorten up these definitions and make them much nicer to read. While we're at it, change the size array to house u32 elements to match the return value of the function. --- Source/Core/VideoCommon/VertexLoader_Position.cpp | 11 +++++------ Source/Core/VideoCommon/VertexLoader_Position.h | 6 ++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index d4a816a36c..9808c76e65 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -168,7 +168,7 @@ constexpr TPipelineFunction s_table_read_position[4][8][2] = { }, }; -constexpr int s_table_read_position_vertex_size[4][8][2] = { +constexpr u32 s_table_read_position_vertex_size[4][8][2] = { { {0, 0}, {0, 0}, @@ -200,13 +200,12 @@ constexpr int s_table_read_position_vertex_size[4][8][2] = { }; } // Anonymous namespace -unsigned int VertexLoader_Position::GetSize(u64 _type, unsigned int _format, unsigned int _elements) +u32 VertexLoader_Position::GetSize(u64 type, u32 format, u32 elements) { - return s_table_read_position_vertex_size[_type][_format][_elements]; + return s_table_read_position_vertex_size[type][format][elements]; } -TPipelineFunction VertexLoader_Position::GetFunction(u64 _type, unsigned int _format, - unsigned int _elements) +TPipelineFunction VertexLoader_Position::GetFunction(u64 type, u32 format, u32 elements) { - return s_table_read_position[_type][_format][_elements]; + return s_table_read_position[type][format][elements]; } diff --git a/Source/Core/VideoCommon/VertexLoader_Position.h b/Source/Core/VideoCommon/VertexLoader_Position.h index 1a8a2855e3..a38d277278 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.h +++ b/Source/Core/VideoCommon/VertexLoader_Position.h @@ -10,9 +10,7 @@ class VertexLoader_Position { public: - // GetSize - static unsigned int GetSize(u64 _type, unsigned int _format, unsigned int _elements); + static u32 GetSize(u64 type, u32 format, u32 elements); - // GetFunction - static TPipelineFunction GetFunction(u64 _type, unsigned int _format, unsigned int _elements); + static TPipelineFunction GetFunction(u64 type, u32 format, u32 elements); }; From 16a03bade2bd6df232e60b19b07b00bdeb8ca75b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:38:09 -0400 Subject: [PATCH 5/7] VertexLoader_TextCoord: Place helper functions in anonymous namespace Gives them all internal linkage. --- .../VideoCommon/VertexLoader_TextCoord.cpp | 121 +++++------------- 1 file 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 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 -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 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::value, "Only unsigned I is sane!"); - auto const index = DataRead(); - auto const data = reinterpret_cast( + const auto index = DataRead(); + const auto data = reinterpret_cast( 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) From 9569c79ca20413b866206add51e249cbb18e462b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:39:27 -0400 Subject: [PATCH 6/7] VertexLoader_TextCoord: Make lookup tables immutable Allows the compiler to place the data within the read-only segment. --- Source/Core/VideoCommon/VertexLoader_TextCoord.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp index 02bfc8922b..52723225f9 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp @@ -88,7 +88,7 @@ void TexCoord_ReadIndex(VertexLoader* loader) ++loader->m_tcIndex; } -TPipelineFunction tableReadTexCoord[4][8][2] = { +constexpr TPipelineFunction s_table_read_tex_coord[4][8][2] = { { { nullptr, @@ -179,7 +179,7 @@ TPipelineFunction tableReadTexCoord[4][8][2] = { }, }; -int tableReadTexCoordVertexSize[4][8][2] = { +constexpr int s_table_read_tex_coord_vertex_size[4][8][2] = { { {0, 0}, {0, 0}, @@ -214,13 +214,13 @@ int tableReadTexCoordVertexSize[4][8][2] = { unsigned int VertexLoader_TextCoord::GetSize(u64 _type, unsigned int _format, unsigned int _elements) { - return tableReadTexCoordVertexSize[_type][_format][_elements]; + return s_table_read_tex_coord_vertex_size[_type][_format][_elements]; } TPipelineFunction VertexLoader_TextCoord::GetFunction(u64 _type, unsigned int _format, unsigned int _elements) { - return tableReadTexCoord[_type][_format][_elements]; + return s_table_read_tex_coord[_type][_format][_elements]; } TPipelineFunction VertexLoader_TextCoord::GetDummyFunction() From 24527474293a180a015ea549055852ddd0167dbe Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 May 2019 09:42:05 -0400 Subject: [PATCH 7/7] VertexLoader_TextCoord: Tidy up public function definitions We can use u32 instead of unsigned int to shorten up these definitions and make them much nicer to read. While we're at it, change the size array to house u32 elements to match the return value of the function. --- Source/Core/VideoCommon/VertexLoader_TextCoord.cpp | 12 +++++------- Source/Core/VideoCommon/VertexLoader_TextCoord.h | 7 ++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp index 52723225f9..3a31527b2c 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp @@ -179,7 +179,7 @@ constexpr TPipelineFunction s_table_read_tex_coord[4][8][2] = { }, }; -constexpr int s_table_read_tex_coord_vertex_size[4][8][2] = { +constexpr u32 s_table_read_tex_coord_vertex_size[4][8][2] = { { {0, 0}, {0, 0}, @@ -211,16 +211,14 @@ constexpr int s_table_read_tex_coord_vertex_size[4][8][2] = { }; } // Anonymous namespace -unsigned int VertexLoader_TextCoord::GetSize(u64 _type, unsigned int _format, - unsigned int _elements) +u32 VertexLoader_TextCoord::GetSize(u64 type, u32 format, u32 elements) { - return s_table_read_tex_coord_vertex_size[_type][_format][_elements]; + return s_table_read_tex_coord_vertex_size[type][format][elements]; } -TPipelineFunction VertexLoader_TextCoord::GetFunction(u64 _type, unsigned int _format, - unsigned int _elements) +TPipelineFunction VertexLoader_TextCoord::GetFunction(u64 type, u32 format, u32 elements) { - return s_table_read_tex_coord[_type][_format][_elements]; + return s_table_read_tex_coord[type][format][elements]; } TPipelineFunction VertexLoader_TextCoord::GetDummyFunction() diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.h b/Source/Core/VideoCommon/VertexLoader_TextCoord.h index 1b135e46d3..48b9a8e136 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.h +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.h @@ -10,13 +10,10 @@ class VertexLoader_TextCoord { public: - // GetSize - static unsigned int GetSize(u64 _type, unsigned int _format, unsigned int _elements); + static u32 GetSize(u64 type, u32 format, u32 elements); - // GetFunction - static TPipelineFunction GetFunction(u64 _type, unsigned int _format, unsigned int _elements); + static TPipelineFunction GetFunction(u64 type, u32 format, u32 elements); - // GetDummyFunction // It is important to synchronize tcIndex. static TPipelineFunction GetDummyFunction(); };