public IEnumerator Execute() { SetupShaderStage(serializedProperty); SetupTags(serializedProperty); SetupNameInfo(serializedProperty); SetupKeywordDictionary(serializedProperty); var progVertex = serializedProperty.FindPropertyRelative("progVertex.m_SubPrograms"); var progFragment = serializedProperty.FindPropertyRelative("progFragment.m_SubPrograms"); int vertNum = progVertex.arraySize; int fragNum = progFragment.arraySize; vertInfos = new List <GpuProgramInfo>(vertNum); fragmentInfos = new List <GpuProgramInfo>(fragNum); yieldChk.SetVertexNum(vertNum); yieldChk.SetFragmentNum(fragNum); for (int i = 0; i < vertNum; ++i) { var gpuProgram = new GpuProgramInfo(progVertex.GetArrayElementAtIndex(i)); gpuProgram.ResolveKeywordName(keywordDictionary); vertInfos.Add(gpuProgram); // yield yieldChk.CompleteVertIdx(i); if (yieldChk.ShouldYield()) { yield return(null); } } for (int i = 0; i < fragNum; ++i) { var gpuProgram = new GpuProgramInfo(progFragment.GetArrayElementAtIndex(i)); gpuProgram.ResolveKeywordName(keywordDictionary); fragmentInfos.Add(gpuProgram); // yield yieldChk.CompleteFragIdx(i); if (yieldChk.ShouldYield()) { yield return(null); } } yield return(null); }
public PassInfo(SerializedProperty serializedProperty) { SetupKeywordDictionary(serializedProperty); var progVertex = serializedProperty.FindPropertyRelative("progVertex.m_SubPrograms"); var progFragment = serializedProperty.FindPropertyRelative("progFragment.m_SubPrograms"); vertInfos = new List <GpuProgramInfo>(progVertex.arraySize); fragmentInfos = new List <GpuProgramInfo>(progFragment.arraySize); for (int i = 0; i < progVertex.arraySize; ++i) { var gpuProgram = new GpuProgramInfo(progVertex.GetArrayElementAtIndex(i)); gpuProgram.ResolveKeywordName(keywordDictionary); vertInfos.Add(gpuProgram); } for (int i = 0; i < progFragment.arraySize; ++i) { var gpuProgram = new GpuProgramInfo(progFragment.GetArrayElementAtIndex(i)); gpuProgram.ResolveKeywordName(keywordDictionary); fragmentInfos.Add(gpuProgram); } }