Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Autolinker fix.
Browse files Browse the repository at this point in the history
Excluding self referencing shaders calls from depdendency list.
This caused endless recursive compilation in certain setups.
  • Loading branch information
WolfgangSt committed Oct 27, 2011
1 parent 1bc03dc commit 351e775
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion IIS.SLSharp/Shaders/Shader.Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public UnitContext(List<FunctionDescription> functions, List<string> forwardDecl

private readonly TypeDefinition _shader;

private readonly Type _shaderType;

private TypeDefinition LoadReflection(Type t)
{
var resolver = new DefaultAssemblyResolver();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 351e775

Please sign in to comment.