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); }
/// <inheritdoc/> protected override void InitializeCore() { renderObjectInstancingDataInfoKey = RootRenderFeature.RenderData.CreateStaticObjectKey <InstancingData>(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; instancingResourceGroupKey = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawLogicalGroup("Instancing"); }
public LogicalGroup GetLogicalGroup(LogicalGroupReference logicalGroupReference) { return(LogicalGroups[logicalGroupReference.Index]); }