Clean up and merge #883

This commit is contained in:
Paul Chote
2011-06-21 13:34:38 +12:00
parent bb2e514dfd
commit 74b2b36a40

View File

@@ -87,14 +87,18 @@ namespace OpenRA.Renderer.Glsl
int nextTexUnit = 1; int nextTexUnit = 1;
for( int i = 0 ; i < numUniforms ; i++ ) for( int i = 0 ; i < numUniforms ; i++ )
{ {
int uLen, uSize, uType; int uLen, uSize, uType, loc;
var sb = new StringBuilder(128); var sb = new StringBuilder(128);
Gl.glGetActiveUniformARB( program, i, 128, out uLen, out uSize, out uType, sb ); Gl.glGetActiveUniformARB( program, i, 128, out uLen, out uSize, out uType, sb );
var sampler = sb.ToString();
GraphicsDevice.CheckGlError(); GraphicsDevice.CheckGlError();
if( uType == Gl.GL_SAMPLER_2D_ARB ) if( uType == Gl.GL_SAMPLER_2D_ARB )
{ {
samplers.Add( sb.ToString(), nextTexUnit ); samplers.Add( sampler, nextTexUnit );
Gl.glUniform1iARB( i, nextTexUnit ); loc = Gl.glGetUniformLocationARB(program, sampler);
GraphicsDevice.CheckGlError();
Gl.glUniform1iARB( loc, nextTexUnit );
GraphicsDevice.CheckGlError();
++nextTexUnit; ++nextTexUnit;
} }
} }