Ejemplo n.º 1
0
 internal void MergeFrom(SubResourceSet value)
 {
     foreach (var B in value.myIDsToItems)
     {
         AddDescriptor(B.Key, B.Value.myType, B.Value.Binding, B.Value.DescriptorCount);
     }
 }
Ejemplo n.º 2
0
        public void MergeFrom(SubResourceSet mySet)
        {
            Parallel.For(0, mySet.myDescriptorTypeCount.Count(), delegate(int i)
            {
                myDescriptorTypeCount[i] += mySet.myDescriptorTypeCount[i];
            });

            foreach (var B in mySet.myIDsToItems)
            {
                DescriptorInformation myDescriptor;
                if (myBindingNumberToItems.TryGetValue(B.Value.Binding, out myDescriptor)) //if we already have the same binding here...
                {
                    ValidateAndCombineDescriptorInformation(myDescriptor, B.Value);        //Make sure they match.
                }
                else
                {
                    myDescriptor = B.Value; //Otherwise add it in.
                    myBindingNumberToItems[B.Value.Binding] = B.Value;
                }

                if (myIDsToItems.ContainsKey(B.Key))
                {
                    if (!myIDsToItems[B.Key].Equals(myDescriptor))
                    {
                        throw new Exception("Two descriptors share the same internal ID, but aren't the same reference or binding!");
                    }
                }
                else
                {
                    myIDsToItems[B.Key] = myDescriptor;
                }
            }
        }
Ejemplo n.º 3
0
        internal SubResourceSet Copy()
        {
            SubResourceSet mySet = new SubResourceSet(this.ShaderStage);

            foreach (var A in myIDsToItems)
            {
                mySet.myIDsToItems.Add(A.Key, A.Value);
                mySet.myDescriptorTypeCount[(uint)A.Value.myType] += 1;
            }
            return(mySet);
        }