Permalink
Browse files

Autolinker fix.

Excluding self referencing shaders calls from depdendency list.
This caused endless recursive compilation in certain setups.
  • Loading branch information...
1 parent 1bc03dc commit 351e775f528057d59acb28658a2cba7f6ea5613e @WolfgangSt WolfgangSt committed Oct 27, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 IIS.SLSharp/Shaders/Shader.Context.cs
@@ -52,6 +52,8 @@ public struct UnitContext
private readonly TypeDefinition _shader;
+ private readonly Type _shaderType;
+
private TypeDefinition LoadReflection(Type t)
{
var resolver = new DefaultAssemblyResolver();
@@ -187,13 +189,16 @@ private UnitContext CollectFuncs<T>(ShaderType type)
}
var forwardDecl = trans.ForwardDeclare(DebugMode);
- return new UnitContext(desc, forwardDecl, trans.Dependencies.ToList());
+ var deps = trans.Dependencies.Except(new [] { _shaderType }).ToList();
+
+ return new UnitContext(desc, forwardDecl, deps);
}
// shaderType = GetShaderType()
public ShaderContext(Type shaderType)
{
_shader = LoadReflection(shaderType);
+ _shaderType = shaderType;
Varyings = CollectVaryings();
Uniforms = CollectUniforms();

0 comments on commit 351e775

Please sign in to comment.