OpenGL: commit rodolfoosvaldobogado's (what a name!) speedup patches.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4322 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-09-26 12:39:12 +00:00
parent 5a7fbd63c2
commit 29808cdde2
16 changed files with 295 additions and 150 deletions

View File

@ -122,11 +122,12 @@ void VertexShaderManager::SetConstants()
for (int i = istart; i < iend; ++i)
{
u32 color = *(const u32*)(xfmemptr + 3);
float NormalizationCoef = 1 / 255.0f;
SetVSConstant4f(C_LIGHTS + 5 * i,
((color >> 24) & 0xFF) / 255.0f,
((color >> 16) & 0xFF) / 255.0f,
((color >> 8) & 0xFF) / 255.0f,
((color) & 0xFF) / 255.0f);
((color >> 24) & 0xFF) * NormalizationCoef,
((color >> 16) & 0xFF) * NormalizationCoef,
((color >> 8) & 0xFF) * NormalizationCoef,
((color) & 0xFF) * NormalizationCoef);
xfmemptr += 4;
for (int j = 0; j < 4; ++j, xfmemptr += 3)
@ -466,11 +467,11 @@ void VertexShaderManager::SetMaterialColor(int index, u32 data)
int ind = index * 4;
nMaterialsChanged |= (1 << index);
s_fMaterials[ind++] = ((data >> 24) & 0xFF) / 255.0f;
s_fMaterials[ind++] = ((data >> 16) & 0xFF) / 255.0f;
s_fMaterials[ind++] = ((data >> 8) & 0xFF) / 255.0f;
s_fMaterials[ind] = ( data & 0xFF) / 255.0f;
float NormalizationCoef = 1 / 255.0f;
s_fMaterials[ind++] = ((data >> 24) & 0xFF) * NormalizationCoef;
s_fMaterials[ind++] = ((data >> 16) & 0xFF) * NormalizationCoef;
s_fMaterials[ind++] = ((data >> 8) & 0xFF) * NormalizationCoef;
s_fMaterials[ind] = ( data & 0xFF) * NormalizationCoef;
}
void VertexShaderManager::TranslateView(float x, float y)