public void GenerateProperyNameMap(string propertyNameMapFullname) { List <ShaderField> shaderFieldList = new List <ShaderField>(); foreach (var item in this.VertexShaderFieldList) { if (item.Qualider == FieldQualifier.In) { bool exists = false; foreach (var shaderField in shaderFieldList) { if (shaderField.FieldName == item.FieldName) { exists = true; } } if (!exists) { shaderFieldList.Add(item); } } } PropertyNameMap map = new PropertyNameMap(); foreach (var item in shaderFieldList) { map.Add(item.FieldName, item.FieldName); } map.ToXElement().Save(propertyNameMapFullname); }
public void GenerateUinformNameMap(string uniformNameMapFullname) { List <ShaderField> shaderFieldList = new List <ShaderField>(); foreach (var item in this.VertexShaderFieldList) { if (item.Qualider == FieldQualifier.Uniform) { bool exists = false; foreach (var shaderField in shaderFieldList) { if (shaderField.FieldName == item.FieldName) { exists = true; } } if (!exists) { shaderFieldList.Add(item); } } } foreach (var item in this.GeometryShaderFieldList) { if (item.Qualider == FieldQualifier.Uniform) { bool exists = false; foreach (var shaderField in shaderFieldList) { if (shaderField.FieldName == item.FieldName) { exists = true; } } if (!exists) { shaderFieldList.Add(item); } } } foreach (var item in this.FragmentShaderFieldList) { if (item.Qualider == FieldQualifier.Uniform) { bool exists = false; foreach (var shaderField in shaderFieldList) { if (shaderField.FieldName == item.FieldName) { exists = true; } } if (!exists) { shaderFieldList.Add(item); } } } var map = new PropertyNameMap(); foreach (var item in shaderFieldList) { map.Add(item.FieldName, item.FieldName); } map.ToXElement().Save(uniformNameMapFullname); }