mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
DX9/OGL: Remove some superfluous checks (this is already done in VideoCommon).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6073 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -42,41 +42,23 @@ GLuint PixelShaderCache::CurrentShader;
|
||||
bool PixelShaderCache::ShaderEnabled;
|
||||
|
||||
static FRAGMENTSHADER* pShaderLast = NULL;
|
||||
static float lastPSconstants[C_PENVCONST_END][4];
|
||||
|
||||
|
||||
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
|
||||
{
|
||||
if (lastPSconstants[const_number][0] != f1 || lastPSconstants[const_number][1] != f2 ||
|
||||
lastPSconstants[const_number][2] != f3 || lastPSconstants[const_number][3] != f4)
|
||||
{
|
||||
lastPSconstants[const_number][0] = f1;
|
||||
lastPSconstants[const_number][1] = f2;
|
||||
lastPSconstants[const_number][2] = f3;
|
||||
lastPSconstants[const_number][3] = f4;
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, lastPSconstants[const_number]);
|
||||
|
||||
}
|
||||
float f[4] = { f1, f2, f3, f4 };
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, f);
|
||||
}
|
||||
|
||||
void SetPSConstant4fv(unsigned int const_number, const float *f)
|
||||
{
|
||||
if (memcmp(&lastPSconstants[const_number], f, sizeof(float) * 4)) {
|
||||
memcpy(&lastPSconstants[const_number], f, sizeof(float) * 4);
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, f);
|
||||
}
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, f);
|
||||
}
|
||||
|
||||
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
|
||||
{
|
||||
const float *f0 = f;
|
||||
for (unsigned int i = 0; i < count ;i++,f0+=4)
|
||||
{
|
||||
if (memcmp(&lastPSconstants[const_number + i], f0, sizeof(float) * 4)) {
|
||||
memcpy(&lastPSconstants[const_number + i], f0, sizeof(float) * 4);
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number + i, lastPSconstants[const_number + i]);
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < count; i++,f+=4)
|
||||
glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number + i, f);
|
||||
}
|
||||
|
||||
void PixelShaderCache::Init()
|
||||
@ -86,8 +68,6 @@ void PixelShaderCache::Init()
|
||||
CurrentShader = 0;
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
for (unsigned int i = 0; i < (C_PENVCONST_END) * 4; i++)
|
||||
lastPSconstants[i/4][i%4] = -100000000.0f;
|
||||
memset(&last_pixel_shader_uid, 0xFF, sizeof(last_pixel_shader_uid));
|
||||
|
||||
s_displayCompileAlert = true;
|
||||
|
Reference in New Issue
Block a user