public ShaderInstance InstanceShader(ClydeHandle handle) { var newHandle = AllocRid(); var loaded = new LoadedShaderInstance { ShaderHandle = handle }; var instance = new ClydeShaderInstance(newHandle, this); _shaderInstances.Add(newHandle, loaded); return(instance); }
protected override ShaderInstance DuplicateImpl() { var instanceData = Parent._shaderInstances[Handle]; var newData = new LoadedShaderInstance { ShaderHandle = instanceData.ShaderHandle }; foreach (var(name, value) in instanceData.Parameters) { newData.Parameters.Add(name, value); } var newHandle = Parent.AllocRid(); Parent._shaderInstances.Add(newHandle, newData); return(new ClydeShaderInstance(newHandle, Parent)); }