/// <summary> /// /// </summary> public static unsafe void PushDescriptorSet(this SharpVk.CommandBuffer extendedHandle, SharpVk.PipelineBindPoint pipelineBindPoint, SharpVk.PipelineLayout layout, uint set, SharpVk.WriteDescriptorSet[] descriptorWrites) { try { CommandCache commandCache = default(CommandCache); SharpVk.Interop.WriteDescriptorSet *marshalledDescriptorWrites = default(SharpVk.Interop.WriteDescriptorSet *); commandCache = extendedHandle.commandCache; if (descriptorWrites != null) { var fieldPointer = (SharpVk.Interop.WriteDescriptorSet *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.WriteDescriptorSet>(descriptorWrites.Length).ToPointer()); for (int index = 0; index < (uint)(descriptorWrites.Length); index++) { descriptorWrites[index].MarshalTo(&fieldPointer[index]); } marshalledDescriptorWrites = fieldPointer; } else { marshalledDescriptorWrites = null; } SharpVk.Interop.Khronos.VkCommandBufferPushDescriptorSetDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkCommandBufferPushDescriptorSetDelegate>("vkCmdPushDescriptorSetKHR", "instance"); commandDelegate(extendedHandle.handle, pipelineBindPoint, layout?.handle ?? default(SharpVk.Interop.PipelineLayout), set, (uint)(descriptorWrites?.Length ?? 0), marshalledDescriptorWrites); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.WriteDescriptorSet *pointer) { pointer->SType = StructureType.WriteDescriptorSet; pointer->Next = null; pointer->DestinationSet = this.DestinationSet?.handle ?? default(SharpVk.Interop.DescriptorSet); pointer->DestinationBinding = this.DestinationBinding; pointer->DestinationArrayElement = this.DestinationArrayElement; pointer->DescriptorCount = this.DescriptorCount; pointer->DescriptorType = this.DescriptorType; if (this.ImageInfo != null) { var fieldPointer = (SharpVk.Interop.DescriptorImageInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.DescriptorImageInfo>(this.ImageInfo.Length).ToPointer()); for (int index = 0; index < (uint)(this.ImageInfo.Length); index++) { this.ImageInfo[index].MarshalTo(&fieldPointer[index]); } pointer->ImageInfo = fieldPointer; } else { pointer->ImageInfo = null; } if (this.BufferInfo != null) { var fieldPointer = (SharpVk.Interop.DescriptorBufferInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.DescriptorBufferInfo>(this.BufferInfo.Length).ToPointer()); for (int index = 0; index < (uint)(this.BufferInfo.Length); index++) { this.BufferInfo[index].MarshalTo(&fieldPointer[index]); } pointer->BufferInfo = fieldPointer; } else { pointer->BufferInfo = null; } if (this.TexelBufferView != null) { var fieldPointer = (SharpVk.Interop.BufferView *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.BufferView>(this.TexelBufferView.Length).ToPointer()); for (int index = 0; index < (uint)(this.TexelBufferView.Length); index++) { fieldPointer[index] = this.TexelBufferView[index]?.handle ?? default(SharpVk.Interop.BufferView); } pointer->TexelBufferView = fieldPointer; } else { pointer->TexelBufferView = null; } }
/// <summary> /// Pushes descriptor updates into a command buffer. /// </summary> /// <param name="extendedHandle"> /// The CommandBuffer handle to extend. /// </param> /// <param name="pipelineBindPoint"> /// </param> /// <param name="layout"> /// </param> /// <param name="set"> /// </param> /// <param name="descriptorWrites"> /// </param> public static unsafe void PushDescriptorSet(this SharpVk.CommandBuffer extendedHandle, SharpVk.PipelineBindPoint pipelineBindPoint, SharpVk.PipelineLayout layout, uint set, ArrayProxy <SharpVk.WriteDescriptorSet>?descriptorWrites) { try { CommandCache commandCache = default(CommandCache); SharpVk.Interop.WriteDescriptorSet *marshalledDescriptorWrites = default(SharpVk.Interop.WriteDescriptorSet *); commandCache = extendedHandle.commandCache; if (descriptorWrites.IsNull()) { marshalledDescriptorWrites = null; } else { if (descriptorWrites.Value.Contents == ProxyContents.Single) { marshalledDescriptorWrites = (SharpVk.Interop.WriteDescriptorSet *)(Interop.HeapUtil.Allocate <SharpVk.Interop.WriteDescriptorSet>()); descriptorWrites.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.WriteDescriptorSet *)(marshalledDescriptorWrites)); } else { var fieldPointer = (SharpVk.Interop.WriteDescriptorSet *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.WriteDescriptorSet>(Interop.HeapUtil.GetLength(descriptorWrites.Value)).ToPointer()); for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(descriptorWrites.Value)); index++) { descriptorWrites.Value[index].MarshalTo(&fieldPointer[index]); } marshalledDescriptorWrites = fieldPointer; } } SharpVk.Interop.Khronos.VkCommandBufferPushDescriptorSetDelegate commandDelegate = commandCache.Cache.vkCmdPushDescriptorSetKHR; commandDelegate(extendedHandle.handle, pipelineBindPoint, layout?.handle ?? default(SharpVk.Interop.PipelineLayout), set, (uint)(Interop.HeapUtil.GetLength(descriptorWrites)), marshalledDescriptorWrites); } finally { Interop.HeapUtil.FreeAll(); } }
public static extern void vkUpdateDescriptorSets(SharpVk.Interop.Device device, uint descriptorWriteCount, SharpVk.Interop.WriteDescriptorSet *descriptorWrites, uint descriptorCopyCount, SharpVk.Interop.CopyDescriptorSet *descriptorCopies);