예제 #1
0
        public LogicalGroupReference CreateDrawLogicalGroup(string logicalGroup)
        {
            // Check existing slots
            for (int i = 0; i < drawLogicalGroups.Count; i++)
            {
                if (drawLogicalGroups[i].Variable.Equals(logicalGroup))
                {
                    return(new LogicalGroupReference(i));
                }
            }

            // Need a new slot
            var slotReference = new LogicalGroupReference(drawLogicalGroups.Count);

            drawLogicalGroups.Add(new NamedSlotDefinition(logicalGroup));

            // Update existing instantiated buffers
            foreach (var effect in InstantiatedEffects)
            {
                var resourceGroupLayout = effect.Value.PerDrawLayout;

                // Ensure there is enough space
                if (resourceGroupLayout.LogicalGroups == null || resourceGroupLayout.LogicalGroups.Length < drawLogicalGroups.Count)
                {
                    Array.Resize(ref resourceGroupLayout.LogicalGroups, drawLogicalGroups.Count);
                }

                ResolveLogicalGroup(resourceGroupLayout, slotReference.Index, logicalGroup);
            }

            return(slotReference);
        }
예제 #2
0
 public LogicalGroup GetLogicalGroup(LogicalGroupReference logicalGroupReference)
 {
     return(LogicalGroups[logicalGroupReference.Index]);
 }
 protected override void InitializeCore()
 {
     base.InitializeCore();
     VoxelizerStorerCasterKey = ((RootEffectRenderFeature)RootRenderFeature).CreateViewLogicalGroup("VoxelizerStorer");
 }