Esempio n. 1
0
        private static void CollectShaderInfoImpl(CGfxEffectDesc desc, int index)
        {
            var cloneDesc = desc.CloneEffectDesc();
            GfxEnvShaderCode shadingEnv = cloneDesc.EnvShaderPatch;

            if (index >= shadingEnv.MacroDefines.Count)
            {
                return;
            }

            for (int i = index; i < shadingEnv.MacroDefines.Count; i++)
            {
                var values = shadingEnv.GetMacroValues(shadingEnv.MacroDefines[i].Name);
                if (values == null)
                {
                    continue;
                }
                for (int j = 0; j < values.Count; j++)
                {
                    if (shadingEnv.SetMacroDefineValue(i, values[j]))
                    {
                        cloneDesc.UpdateHash64(true);
                        Hash64 hash;
                        hash = cloneDesc.GetHash64();
                        var file = CGfxEffectDesc.GetShaderInfoFileName(hash);
                        if (CEngine.Instance.FileManager.FileExists(file) == false)
                        {
                            cloneDesc.SaveXML(null, hash);
                        }

                        CollectShaderInfoImpl(cloneDesc, i + 1);
                    }
                }
            }
        }
Esempio n. 2
0
 protected bool SetMacroDefineValue(int index, string value)
 {
     return(mEnvCode.SetMacroDefineValue(index, value));
 }