Backed out changeset: 5fe5ad059c05
parent
1c4dbc64ab
commit
eebbda288d
|
|
@ -1274,28 +1274,6 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
|
|||
}
|
||||
}
|
||||
|
||||
void LLGLSLShader::uniform1b(U32 index, GLboolean x)
|
||||
{
|
||||
if (mProgramObject > 0)
|
||||
{
|
||||
if (mUniform.size() <= index)
|
||||
{
|
||||
UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mUniform[index] >= 0)
|
||||
{
|
||||
std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
|
||||
if (iter == mValue.end() || iter->second.mV[0] != x)
|
||||
{
|
||||
glUniform1iARB(mUniform[index], x);
|
||||
mValue[mUniform[index]] = LLVector4(x, 0.f, 0.f, 0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
|
||||
{
|
||||
GLint ret = -1;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ public:
|
|||
void uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
|
||||
void uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat *v);
|
||||
void uniform1b(U32 index, GLboolean b);
|
||||
|
||||
void setMinimumAlpha(F32 minimum);
|
||||
|
||||
|
|
|
|||
|
|
@ -1466,14 +1466,6 @@ U32 LLRender::getMatrixMode()
|
|||
return mMatrixMode;
|
||||
}
|
||||
|
||||
void LLRender::setInverseTexCoordByY(bool v)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
if (shader)
|
||||
{
|
||||
shader->uniform1b(LLShaderMgr::INVERSE_TEX_Y, v);
|
||||
}
|
||||
}
|
||||
|
||||
void LLRender::loadIdentity()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -355,7 +355,6 @@ public:
|
|||
void multMatrix(const GLfloat* m);
|
||||
void matrixMode(U32 mode);
|
||||
U32 getMatrixMode();
|
||||
void setInverseTexCoordByY(bool v);
|
||||
|
||||
const glh::matrix4f& getModelviewMatrix();
|
||||
const glh::matrix4f& getProjectionMatrix();
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,6 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||
|
||||
mReservedUniforms.push_back("origin");
|
||||
mReservedUniforms.push_back("display_gamma");
|
||||
mReservedUniforms.push_back("invert_tex_y");
|
||||
llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
|
||||
|
||||
std::set<std::string> dupe_check;
|
||||
|
|
|
|||
|
|
@ -215,8 +215,7 @@ public:
|
|||
TERRAIN_ALPHARAMP,
|
||||
|
||||
SHINY_ORIGIN,
|
||||
DISPLAY_GAMMA,
|
||||
INVERSE_TEX_Y,
|
||||
DISPLAY_GAMMA,
|
||||
END_RESERVED_UNIFORMS
|
||||
} eGLSLReservedUniforms;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,13 +26,6 @@
|
|||
uniform mat3 normal_matrix;
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
uniform bool invert_tex_y = false;
|
||||
const mat4 invTexM = mat4(
|
||||
1, 0, 0, 0,
|
||||
0,-1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
ATTRIBUTE vec4 diffuse_color;
|
||||
|
|
@ -51,10 +44,6 @@ void main()
|
|||
//transform vertex
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
if(invert_tex_y)
|
||||
{
|
||||
vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy;
|
||||
}
|
||||
|
||||
passTextureIndex();
|
||||
vary_normal = normalize(normal_matrix * normal);
|
||||
|
|
|
|||
|
|
@ -26,13 +26,6 @@
|
|||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
uniform bool invert_tex_y = false;
|
||||
const mat4 invTexM = mat4(
|
||||
1, 0, 0, 0,
|
||||
0,-1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
|
|
@ -69,10 +62,6 @@ void main()
|
|||
#endif
|
||||
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
if(invert_tex_y)
|
||||
{
|
||||
vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy;
|
||||
}
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,14 +26,6 @@
|
|||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
uniform bool invert_tex_y = false;
|
||||
const mat4 invTexM = mat4(
|
||||
1, 0, 0, 0,
|
||||
0,-1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
void passTextureIndex();
|
||||
|
|
@ -57,11 +49,6 @@ void main()
|
|||
vec4 pos = (modelview_matrix * vert);
|
||||
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
|
||||
if(invert_tex_y)
|
||||
{
|
||||
vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy;
|
||||
}
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,6 @@ uniform mat3 normal_matrix;
|
|||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
uniform bool invert_tex_y = false;
|
||||
const mat4 invTexM = mat4(
|
||||
1, 0, 0, 0,
|
||||
0,-1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
void passTextureIndex();
|
||||
|
|
@ -58,10 +51,7 @@ void main()
|
|||
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
|
||||
|
||||
if(invert_tex_y)
|
||||
{
|
||||
vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy;
|
||||
}
|
||||
|
||||
|
||||
vec3 norm = normalize(normal_matrix * normal);
|
||||
|
||||
|
|
|
|||
|
|
@ -473,10 +473,6 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba
|
|||
if (params.mTextureList[i].notNull())
|
||||
{
|
||||
gGL.getTexUnit(i)->bind(params.mTextureList[i], TRUE);
|
||||
if (LLViewerTexture::MEDIA_TEXTURE == params.mTextureList[i]->getType())
|
||||
{
|
||||
gGL.setInverseTexCoordByY(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -486,54 +482,13 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba
|
|||
{
|
||||
params.mTexture->addTextureStats(params.mVSize);
|
||||
gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ;
|
||||
|
||||
if (!gPipeline.mVertexShadersEnabled)
|
||||
{
|
||||
if (LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType() && !params.mTextureMatrix)
|
||||
{
|
||||
static const float fIdntInvY[] = {
|
||||
1, 0, 0, 0,
|
||||
0, -1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadMatrix((GLfloat*)fIdntInvY);
|
||||
gPipeline.mTextureMatrixOps++;
|
||||
|
||||
tex_setup = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.setInverseTexCoordByY(LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType());
|
||||
}
|
||||
|
||||
if (params.mTextureMatrix)
|
||||
{
|
||||
tex_setup = true;
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix);
|
||||
|
||||
if (LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType() && !gPipeline.mVertexShadersEnabled)
|
||||
{
|
||||
static const float fIdntInvY[] = {
|
||||
1, 0, 0, 0,
|
||||
0, -1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
gGL.multMatrix(fIdntInvY);
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
|
||||
gPipeline.mTextureMatrixOps++;
|
||||
|
||||
tex_setup = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue