From ec28a80e00ae6893b1a71c1e0538561df78665e5 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 11 Dec 2014 22:39:58 +0100 Subject: VideoLoader: remove VAT_*_FRACBITS They are used to remove the flush amounts, but as we don't flush anymore on vertex loader changes (only on native vertex format right now), this optimization is now unneeded. This will allow us to hard code the frac factors within the vertex loaders. --- Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.cpp') diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index ec53bc6c3b..c00e43e2fd 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -176,7 +176,7 @@ void SWVertexLoader::LoadVertex() // convert the vertex from the gc format to the videocommon (hardware optimized) format u8* old = g_video_buffer_read_ptr; m_CurrentLoader->RunVertices( - g_main_cp_state.vtx_attr[m_attributeIndex], m_primitiveType, 1, + m_primitiveType, 1, DataReader(g_video_buffer_read_ptr, nullptr), // src DataReader(m_LoadedVertices.data(), m_LoadedVertices.data() + m_LoadedVertices.size()) // dst ); -- cgit v1.2.3 From a71c8158d91c7ee0976b9b16eeba5ea3ac18ff99 Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 13 Dec 2014 00:23:54 +0100 Subject: VertexLoader: remove inlined getters They just blow up the code. --- Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.cpp') diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index c00e43e2fd..fecfb94abe 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -46,7 +46,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) m_VertexLoaderMap[uid] = std::unique_ptr(m_CurrentLoader); } - m_VertexSize = m_CurrentLoader->GetVertexSize(); + m_VertexSize = m_CurrentLoader->m_VertexSize; m_CurrentVat = &g_main_cp_state.vtx_attr[m_attributeIndex]; @@ -168,7 +168,7 @@ void SWVertexLoader::ParseVertex(const PortableVertexDeclaration& vdec) void SWVertexLoader::LoadVertex() { - const PortableVertexDeclaration& vdec = m_CurrentLoader->GetNativeVertexDeclaration(); + const PortableVertexDeclaration& vdec = m_CurrentLoader->m_native_vtx_decl; // reserve memory for the destination of the vertex loader m_LoadedVertices.resize(vdec.stride + 4); @@ -180,7 +180,7 @@ void SWVertexLoader::LoadVertex() DataReader(g_video_buffer_read_ptr, nullptr), // src DataReader(m_LoadedVertices.data(), m_LoadedVertices.data() + m_LoadedVertices.size()) // dst ); - g_video_buffer_read_ptr = old + m_CurrentLoader->GetVertexSize(); + g_video_buffer_read_ptr = old + m_CurrentLoader->m_VertexSize; // parse the videocommon format to our own struct format (m_Vertex) ParseVertex(vdec); -- cgit v1.2.3 From 809117102e1c8007345c48aba5eabfec9cff26ee Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 13 Dec 2014 01:51:14 +0100 Subject: VideoCommon: split VertexLoaderBase from VertexLoader --- Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.cpp') diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index fecfb94abe..2523b5b01a 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -13,12 +13,8 @@ #include "VideoBackends/Software/TransformUnit.h" #include "VideoBackends/Software/XFMemLoader.h" -#include "VideoCommon/VertexLoader.h" -#include "VideoCommon/VertexLoader_Color.h" -#include "VideoCommon/VertexLoader_Normal.h" -#include "VideoCommon/VertexLoader_Position.h" -#include "VideoCommon/VertexLoader_TextCoord.h" -#include "VideoCommon/VertexManagerBase.h" +#include "VideoCommon/VertexLoaderBase.h" +#include "VideoCommon/VertexLoaderUtils.h" SWVertexLoader::SWVertexLoader() : m_VertexSize(0) @@ -42,8 +38,8 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) if (!m_CurrentLoader) { - m_CurrentLoader = new VertexLoader(g_main_cp_state.vtx_desc, g_main_cp_state.vtx_attr[m_attributeIndex]); - m_VertexLoaderMap[uid] = std::unique_ptr(m_CurrentLoader); + m_CurrentLoader = VertexLoaderBase::CreateVertexLoader(g_main_cp_state.vtx_desc, g_main_cp_state.vtx_attr[m_attributeIndex]); + m_VertexLoaderMap[uid] = std::unique_ptr(m_CurrentLoader); } m_VertexSize = m_CurrentLoader->m_VertexSize; -- cgit v1.2.3