From 7c486a8c243c3bb223b1d31aab34bf039c6a02a1 Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 13 Dec 2014 10:57:46 +0100 Subject: VertexLoader: Add a VertexLoader pointer to each function call --- Source/Core/VideoCommon/VertexLoader_Position.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index 60a6115ee0..c0fac7ef93 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -71,10 +71,10 @@ float PosScale(float val, float scale) } template -void LOADERDECL Pos_ReadDirect() +void LOADERDECL Pos_ReadDirect(VertexLoader* loader) { static_assert(N <= 3, "N > 3 is not sane!"); - auto const scale = posScale[0]; + auto const scale = loader->m_posScale[0];; DataReader dst(g_vertex_manager_write_ptr, nullptr); DataReader src(g_video_buffer_read_ptr, nullptr); @@ -87,14 +87,14 @@ void LOADERDECL Pos_ReadDirect() } template -void LOADERDECL Pos_ReadIndex() +void LOADERDECL 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(); auto const data = reinterpret_cast(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION])); - auto const scale = posScale[0]; + auto const scale = loader->m_posScale[0]; DataReader dst(g_vertex_manager_write_ptr, nullptr); for (int i = 0; i < 3; ++i) @@ -106,21 +106,21 @@ void LOADERDECL Pos_ReadIndex() #if _M_SSE >= 0x301 template -void LOADERDECL Pos_ReadDirect_SSSE3() +void LOADERDECL Pos_ReadDirect_SSSE3(VertexLoader* loader) { const T* pData = reinterpret_cast(DataGetPosition()); - Vertex_Read_SSSE3(pData, *(__m128*)posScale); + Vertex_Read_SSSE3(pData, *(__m128*)loader->m_posScale); DataSkip<(2 + three) * sizeof(T)>(); LOG_VTX(); } template -void LOADERDECL Pos_ReadIndex_SSSE3() +void LOADERDECL Pos_ReadIndex_SSSE3(VertexLoader* loader) { static_assert(std::is_unsigned::value, "Only unsigned I is sane!"); auto const index = DataRead(); const T* pData = (const T*)(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION])); - Vertex_Read_SSSE3(pData, *(__m128*)posScale); + Vertex_Read_SSSE3(pData, *(__m128*)loader->m_posScale); LOG_VTX(); } #endif -- cgit v1.2.3 From 1efd00227d3c38458d44193c4aa554f70a3b9c55 Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 21 Dec 2014 14:29:44 +0100 Subject: VertexLoader: Skip vertices with position index = -1 --- Source/Core/VideoCommon/VertexLoader_Position.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index c0fac7ef93..419c041b5b 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -93,6 +93,7 @@ void LOADERDECL Pos_ReadIndex(VertexLoader* loader) static_assert(N <= 3, "N > 3 is not sane!"); auto const index = DataRead(); + loader->m_vertexSkip = index == std::numeric_limits::max(); auto const data = reinterpret_cast(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION])); auto const scale = loader->m_posScale[0]; DataReader dst(g_vertex_manager_write_ptr, nullptr); @@ -119,6 +120,7 @@ void LOADERDECL Pos_ReadIndex_SSSE3(VertexLoader* loader) { static_assert(std::is_unsigned::value, "Only unsigned I is sane!"); auto const index = DataRead(); + loader->m_vertexSkip = index == std::numeric_limits::max(); const T* pData = (const T*)(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION])); Vertex_Read_SSSE3(pData, *(__m128*)loader->m_posScale); LOG_VTX(); -- cgit v1.2.3