예제 #1
0
        private static void ProcessShaderCompilerEnvironment(H1ShaderCompilerEnvironment environment, ref String outContent, List <SharpDX.Direct3D.ShaderMacro> outMacros)
        {
            // 1. process include files to the 'outContent'
            foreach (String content in environment.IncludeFileContentMap)
            {
                outContent += content;
            }

            // 2. process macros
            foreach (var definition in environment.Definitions)
            {
                outMacros.Add(new SharpDX.Direct3D.ShaderMacro(definition.Key, definition.Value));
            }
        }
예제 #2
0
            public override object DeepCopy()
            {
                var newObj = new H1ShaderCompilerEnvironment();

                newObj = this.MemberwiseClone() as H1ShaderCompilerEnvironment;

                // 1. definitions
                newObj.m_Definitions.Clear(); // making sure empty (for preventing shallow copy by memberwiseclone
                foreach (var element in this.m_Definitions)
                {
                    newObj.m_Definitions.Add(element.Key, element.Value);
                }

                // 2. include mapping
                newObj.m_IncludeFileNameToContentMap.Clear();
                foreach (var element in this.m_IncludeFileNameToContentMap)
                {
                    newObj.m_IncludeFileNameToContentMap.Add(element.Key, element.Value);
                }

                return(newObj);
            }