UDitherMode(GLuint _program, bool _usesNoise)
	: m_usesNoise(_usesNoise)
	{
		LocateUniform(uAlphaCompareMode);
		LocateUniform(uAlphaDitherMode);
		LocateUniform(uColorDitherMode);
	}
	UTextureSize(GLuint _program, bool _useT0, bool _useT1)
	: m_useT0(_useT0)
	, m_useT1(_useT1)
	{
		LocateUniform(uTextureSize[0]);
		LocateUniform(uTextureSize[1]);
	}
	UColors(GLuint _program) {
		LocateUniform(uFogColor);
		LocateUniform(uCenterColor);
		LocateUniform(uScaleColor);
		LocateUniform(uBlendColor);
		LocateUniform(uEnvColor);
		LocateUniform(uPrimColor);
		LocateUniform(uPrimLod);
		LocateUniform(uK4);
		LocateUniform(uK5);
	}
	UTextureParams(GLuint _program, bool _useT0, bool _useT1)
	{
		m_useTile[0] = _useT0;
		m_useTile[1] = _useT1;
		LocateUniform(uTexOffset[0]);
		LocateUniform(uTexOffset[1]);
		LocateUniform(uCacheShiftScale[0]);
		LocateUniform(uCacheShiftScale[1]);
		LocateUniform(uCacheScale[0]);
		LocateUniform(uCacheScale[1]);
		LocateUniform(uCacheOffset[0]);
		LocateUniform(uCacheOffset[1]);
		LocateUniform(uTexScale);
		LocateUniform(uCacheFrameBuffer);
	}
	UDepthInfo(GLuint _program) {
		LocateUniform(uEnableDepth);
		LocateUniform(uEnableDepthCompare);
		LocateUniform(uEnableDepthUpdate);
		LocateUniform(uDepthMode);
		LocateUniform(uDepthSource);
		LocateUniform(uDeltaZ);
	}
	UMipmap2(GLuint _program) {
		LocateUniform(uEnableLod);
		LocateUniform(uTextureDetail);
	}
	UScreenCoordsScale(GLuint _program) {
		LocateUniform(uScreenCoordsScale);
	}
	URenderTarget(GLuint _program) {
		LocateUniform(uRenderTarget);
	}
	UDepthScale(GLuint _program) {
		LocateUniform(uDepthScale);
	}
	UAlphaTestInfo(GLuint _program) {
		LocateUniform(uEnableAlphaTest);
		LocateUniform(uAlphaCvgSel);
		LocateUniform(uCvgXAlpha);
		LocateUniform(uAlphaTestValue);
	}
	UDepthTex(GLuint _program) {
		LocateUniform(uDepthTex);
	}
	UMipmap1(GLuint _program) {
		LocateUniform(uMinLod);
		LocateUniform(uMaxTile);
	}
	URectColor(GLuint _program) {
		LocateUniform(uRectColor);
	}
	UTextures(GLuint _program) {
		LocateUniform(uTex0);
		LocateUniform(uTex1);
	}
	UBlendMode2Cycle(GLuint _program) {
		LocateUniform(uBlendMux1);
		LocateUniform(uBlendMux2);
		LocateUniform(uForceBlendCycle1);
		LocateUniform(uForceBlendCycle2);
	}
	UFog(GLuint _program) {
		LocateUniform(uFogUsage);
		LocateUniform(uFogScale);
	}
	UFrameBufferInfo(GLuint _program) {
		LocateUniform(uFbMonochrome);
		LocateUniform(uFbFixedAlpha);
		LocateUniform(uMSTexEnabled);
	}
	UMSAATextures(GLuint _program) {
		LocateUniform(uMSTex0);
		LocateUniform(uMSTex1);
		LocateUniform(uMSAASamples);
	}
	UTexturePersp(GLuint _program) {
		LocateUniform(uTexturePersp);
	}
	UTextureFilterMode(GLuint _program) {
		LocateUniform(uTextureFilterMode);
	}
void _locate_uniforms(ShaderProgram *p)
{
    LocateUniform(uTex0);
    LocateUniform(uTex1);
    LocateUniform(uNoise);
    LocateUniform(uEnvColor);
    LocateUniform(uPrimColor);
    LocateUniform(uPrimLODFrac);
    LocateUniform(uK4);
    LocateUniform(uK5);
    LocateUniform(uFogColor);
    LocateUniform(uEnableFog);
    LocateUniform(uRenderState);
    LocateUniform(uFogMultiplier);
    LocateUniform(uFogOffset);
    LocateUniform(uAlphaRef);
    LocateUniform(uTexScale);
    LocateUniform(uTexOffset[0]);
    LocateUniform(uTexOffset[1]);
    LocateUniform(uCacheShiftScale[0]);
    LocateUniform(uCacheShiftScale[1]);
    LocateUniform(uCacheScale[0]);
    LocateUniform(uCacheScale[1]);
    LocateUniform(uCacheOffset[0]);
    LocateUniform(uCacheOffset[1]);
}
	UNoiseTex(GLuint _program) {
		LocateUniform(uTexNoise);
	}