예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="tagInfo">
 /// </param>
 public static unsafe void SetDebugUtilsObjectTag(this SharpVk.Device extendedHandle, SharpVk.Multivendor.DebugUtilsObjectTagInfo tagInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DebugUtilsObjectTagInfo *marshalledTagInfo = default(SharpVk.Interop.Multivendor.DebugUtilsObjectTagInfo *);
         commandCache      = extendedHandle.commandCache;
         marshalledTagInfo = (SharpVk.Interop.Multivendor.DebugUtilsObjectTagInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DebugUtilsObjectTagInfo>());
         tagInfo.MarshalTo(marshalledTagInfo);
         SharpVk.Interop.Multivendor.VkDeviceSetDebugUtilsObjectTagDelegate commandDelegate = commandCache.Cache.vkSetDebugUtilsObjectTagEXT;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledTagInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
 /// <summary>
 ///
 /// </summary>
 internal unsafe void MarshalTo(SharpVk.Interop.Multivendor.DebugUtilsObjectTagInfo *pointer)
 {
     pointer->SType        = StructureType.DebugUtilsObjectTagInfo;
     pointer->Next         = null;
     pointer->ObjectType   = this.ObjectType;
     pointer->ObjectHandle = this.ObjectHandle;
     pointer->TagName      = this.TagName;
     pointer->TagSize      = (HostSize)(Interop.HeapUtil.GetLength(this.Tag));
     if (this.Tag != null)
     {
         var fieldPointer = (byte *)(Interop.HeapUtil.AllocateAndClear <byte>(this.Tag.Length).ToPointer());
         for (int index = 0; index < (uint)(this.Tag.Length); index++)
         {
             fieldPointer[index] = this.Tag[index];
         }
         pointer->Tag = fieldPointer;
     }
     else
     {
         pointer->Tag = null;
     }
 }