diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index c9531d429c..3d1ee6ba6e 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -286,7 +286,7 @@ void VertexShaderManager::SetConstants(bool proj_hax_1) } PRIM_LOG("Projection: %f %f %f %f %f %f\n", xfregs.rawProjection[0], xfregs.rawProjection[1], xfregs.rawProjection[2], xfregs.rawProjection[3], xfregs.rawProjection[4], xfregs.rawProjection[5]); - SetVSConstant4fv(C_PROJECTION, &g_fProjectionMatrix[0]); + SetVSConstant4fv(C_PROJECTION, &g_fProjectionMatrix[0]); SetVSConstant4fv(C_PROJECTION+1, &g_fProjectionMatrix[4]); SetVSConstant4fv(C_PROJECTION+2, &g_fProjectionMatrix[8]); SetVSConstant4fv(C_PROJECTION+3, &g_fProjectionMatrix[12]); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp index 25ba1ccdc8..688a5a3eab 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp @@ -95,7 +95,7 @@ void PixelShaderCache::SetShader() newentry.frameCount = frameCount; PixelShaders[uid] = newentry; - D3D::dev->SetFVF(NULL); + Renderer::SetFVF(NULL); D3D::dev->SetPixelShader(shader); INCSTAT(stats.numPixelShadersCreated); @@ -134,7 +134,7 @@ void PixelShaderCache::Cleanup() while (iter != PixelShaders.end()) { PSCacheEntry &entry = iter->second; - if (entry.frameCount < frameCount-30) + if (entry.frameCount < frameCount-400) { entry.Destroy(); iter = PixelShaders.erase(iter); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 017ddf3bb7..7866e350f3 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -232,6 +232,7 @@ void Renderer::SwapBuffers() p+=sprintf(p,"CP loads (DL): %i\n",stats.thisFrame.numCPLoadsInDL); p+=sprintf(p,"BP loads: %i\n",stats.thisFrame.numBPLoads); p+=sprintf(p,"BP loads (DL): %i\n",stats.thisFrame.numBPLoadsInDL); + p+=sprintf(p,"Vertex Loaders: %i\n",stats.numVertexLoaders); D3D::font.DrawTextScaled(0,30,20,20,0.0f,0xFF00FFFF,st,false); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp index 7fc09a62c7..2603406431 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp @@ -182,6 +182,10 @@ void Flush() DVSTARTPROFILE(); if (collection != C_NOTHING) { + // setup the pointers + if(g_nativeVertexFmt) + g_nativeVertexFmt->SetupVertexPointers(); + u32 usedtextures = 0; for (u32 i = 0; i < (u32)bpmem.genMode.numtevstages + 1; ++i) { if (bpmem.tevorders[i/2].getEnable(i & 1)) @@ -232,8 +236,8 @@ void Flush() int numVertices = indexGen.GetNumVerts(); if (numVertices) { - PixelShaderCache::SetShader(); // TODO(ector): only do this if shader has changed - VertexShaderCache::SetShader(g_nativeVertexFmt->m_components); // TODO(ector): only do this if shader has changed + PixelShaderCache::SetShader(); + VertexShaderCache::SetShader(g_nativeVertexFmt->m_components); // set global constants VertexShaderManager::SetConstants(false); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp index cc501866c0..fc784633b3 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp @@ -105,7 +105,7 @@ void VertexShaderCache::SetShader(u32 components) { PanicAlert("Failed to compile Vertex Shader:\n\n%s", code); } - D3D::dev->SetFVF(NULL); + Renderer::SetFVF(NULL); D3D::dev->SetVertexShader(shader); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp index f940ca6b9b..0f4ebec6ca 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp @@ -52,7 +52,6 @@ void SetVSConstant4fv(int const_number, const float *f) glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, const_number, f); } - void VertexShaderCache::Init() { s_displayCompileAlert = true;