refactor: early-return in Shader.Location uniform cache lookup
This commit is contained in:
@@ -38,11 +38,9 @@ public sealed class Shader : IDisposable
|
||||
|
||||
private int Location(string name)
|
||||
{
|
||||
if (!this._uniforms.TryGetValue(name, out int location))
|
||||
{
|
||||
if (this._uniforms.TryGetValue(name, out int location)) return location;
|
||||
location = GL.GetUniformLocation(this._handle, name);
|
||||
this._uniforms[name] = location;
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user