private SharpDX.Direct3D.ShaderMacro[] MakeMacros(int num) { SharpDX.Direct3D.ShaderMacro[] macros = new SharpDX.Direct3D.ShaderMacro[m_AfxCombos.Count + m_DynamicCombos.Count + m_StaticCombos.Count + 1]; int idx = 0; foreach (Combo combo in m_AfxCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } foreach (Combo combo in m_DynamicCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } foreach (Combo combo in m_StaticCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } macros[idx++] = new SharpDX.Direct3D.ShaderMacro("SHADER_MODEL_" + m_Profile.ToString().ToUpper(), 1); return(macros); }
private static SharpDX.Direct3D.ShaderMacro[] ParseMacro(Dictionary <string, object> input) { if (input == null) { return(null); } SharpDX.Direct3D.ShaderMacro[] output = new SharpDX.Direct3D.ShaderMacro[input.Count]; int i = 0; foreach (string key in input.Keys) { output[i++] = new SharpDX.Direct3D.ShaderMacro(key, input[key]); } return(output); }
private SharpDX.Direct3D.ShaderMacro[] MakeMacros(int num) { SharpDX.Direct3D.ShaderMacro[] macros = new SharpDX.Direct3D.ShaderMacro[m_AfxCombos.Count + m_DynamicCombos.Count + m_StaticCombos.Count + 1]; int idx = 0; foreach (Combo combo in m_AfxCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } foreach (Combo combo in m_DynamicCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } foreach (Combo combo in m_StaticCombos) { int d = num % (combo.Max - combo.Min + 1) + combo.Min; macros[idx++] = new SharpDX.Direct3D.ShaderMacro(combo.Name, d); num = num / (combo.Max - combo.Min + 1); } macros[idx++] = new SharpDX.Direct3D.ShaderMacro("SHADER_MODEL_" + m_Profile.ToString().ToUpper(), 1); return macros; }