/// <summary> /// Free one or more descriptor sets. /// </summary> public void FreeDescriptorSets(ArrayProxy <DescriptorSet> descriptorSets) { unsafe { try { Result commandResult; Interop.DescriptorSet *marshalledDescriptorSets = null; if (descriptorSets.Contents != ProxyContents.Null) { Interop.DescriptorSet *arrayPointer = stackalloc Interop.DescriptorSet[descriptorSets.Length]; if (descriptorSets.Contents == ProxyContents.Single) { descriptorSets.GetSingleValue().MarshalTo(arrayPointer); } else { var arrayValue = descriptorSets.GetArrayValue(); for (int index = 0; index < descriptorSets.Length; index++) { arrayValue.Array[arrayValue.Offset + index].MarshalTo(&arrayPointer[index]); } } marshalledDescriptorSets = arrayPointer; } else { marshalledDescriptorSets = null; } commandResult = Interop.Commands.vkFreeDescriptorSets(this.parent.handle, this.handle, (uint)(descriptorSets.Length), marshalledDescriptorSets); if (SharpVkException.IsError(commandResult)) { throw SharpVkException.Create(commandResult); } } finally { Interop.HeapUtil.FreeLog(); } } }
internal unsafe void MarshalTo(Interop.DescriptorSet *pointer) { *pointer = this.handle; }