- float frac = gRDP.LODFrac / 255.0f;
- float tempf[4] = {frac,frac,frac,frac};
- glUniform4fv(prog.EnvFracLocation,1, tempf);
- OPENGL_CHECK_ERRORS;
+ // avoid slow float compare..
+ if( *(int *)&gRDP.LODFrac != *(int *)&prog.EnvLODFrac ) {
+ prog.EnvLODFrac = gRDP.LODFrac;
+ float frac = gRDP.LODFrac / 255.0f;
+ float tempf[4] = {frac,frac,frac,frac};
+ glUniform4fv(prog.EnvFracLocation, 1, tempf);
+ OPENGL_CHECK_ERRORS;
+ }