diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-09-19 10:46:25 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-09-19 10:46:25 +0000 |
| commit | dae1a68bfc1d2f4e2b08cecb09afd94894e85262 (patch) | |
| tree | aeed00e7dbc599b4617944b4ebad770da54154cc /Source/Core | |
| parent | 0d9543030b304438b650482e60926001f821a9e5 (diff) | |
D3D: minor vs constant-setting optimization, remove a stupid memcpy that doesn't do anything, don't see much benefit though :/ At least the PIX logs will be cleaner.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4301 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 9 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderManager.h | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index c90e8531f9..3a5936e3fe 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -100,9 +100,8 @@ void VertexShaderManager::SetConstants() int startn = nNormalMatricesChanged[0] / 3; int endn = (nNormalMatricesChanged[1] + 2) / 3; const float *pnstart = (const float*)&xfmem[XFMEM_NORMALMATRICES+3*startn]; - for (int i = startn; i < endn; ++i, pnstart += 3) - SetVSConstant4fv(C_NORMALMATRICES + i, pnstart); // looks like we're reading one too much.. - nNormalMatricesChanged[0] = nNormalMatricesChanged[1] = -1; + SetMultiVSConstant3fv(C_NORMALMATRICES + startn, endn - startn, pnstart); + nNormalMatricesChanged[0] = nNormalMatricesChanged[1] = -1; } if (nPostTransformMatricesChanged[0] >= 0) @@ -165,9 +164,7 @@ void VertexShaderManager::SetConstants() const float *norm = (const float *)xfmem + XFMEM_NORMALMATRICES + 3 * (MatrixIndexA.PosNormalMtxIdx & 31); SetMultiVSConstant4fv(C_POSNORMALMATRIX, 3, pos); - SetVSConstant4fv(C_POSNORMALMATRIX+3, norm); - SetVSConstant4fv(C_POSNORMALMATRIX+4, norm + 3); - SetVSConstant4fv(C_POSNORMALMATRIX+5, norm + 6); + SetMultiVSConstant3fv(C_POSNORMALMATRIX + 3, 3, norm); } if (bTexMatricesChanged[0]) diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index 619c3af5de..be7a506716 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -46,6 +46,7 @@ public: void SetVSConstant4f(int const_number, float f1, float f2, float f3, float f4); void SetVSConstant4fv(int const_number, const float *f); +void SetMultiVSConstant3fv(int const_number, int count, const float *f); void SetMultiVSConstant4fv(int const_number, int count, const float *f); #endif // _VERTEXSHADERMANAGER_H |
