예제 #1
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe int GetFenceFileDescriptor(this SharpVk.Device extendedHandle, SharpVk.Khronos.FenceGetFileDescriptorInfo getFileDescriptorInfo)
 {
     try
     {
         int          result       = default(int);
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.FenceGetFileDescriptorInfo *marshalledGetFileDescriptorInfo = default(SharpVk.Interop.Khronos.FenceGetFileDescriptorInfo *);
         int marshalledFileDescriptor = default(int);
         commandCache = extendedHandle.commandCache;
         marshalledGetFileDescriptorInfo = (SharpVk.Interop.Khronos.FenceGetFileDescriptorInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.FenceGetFileDescriptorInfo>());
         getFileDescriptorInfo.MarshalTo(marshalledGetFileDescriptorInfo);
         SharpVk.Interop.Khronos.VkDeviceGetFenceFileDescriptorDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkDeviceGetFenceFileDescriptorDelegate>("vkGetFenceFdKHR", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledGetFileDescriptorInfo, &marshalledFileDescriptor);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = marshalledFileDescriptor;
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe uint AcquireNextImage2(this SharpVk.Device extendedHandle, SharpVk.Khronos.Experimental.AcquireNextImageInfo acquireInfo)
 {
     try
     {
         uint         result       = default(uint);
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Experimental.AcquireNextImageInfo *marshalledAcquireInfo = default(SharpVk.Interop.Khronos.Experimental.AcquireNextImageInfo *);
         uint marshalledImageIndex = default(uint);
         commandCache          = extendedHandle.commandCache;
         marshalledAcquireInfo = (SharpVk.Interop.Khronos.Experimental.AcquireNextImageInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.Experimental.AcquireNextImageInfo>());
         acquireInfo.MarshalTo(marshalledAcquireInfo);
         SharpVk.Interop.Khronos.Experimental.VkDeviceAcquireNextImage2Delegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.Experimental.VkDeviceAcquireNextImage2Delegate>("vkAcquireNextImage2KHX", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledAcquireInfo, &marshalledImageIndex);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = marshalledImageIndex;
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe SharpVk.Fence RegisterDisplayEvent(this SharpVk.Device extendedHandle, SharpVk.Khronos.Display display, SharpVk.Multivendor.DisplayEventInfo displayEventInfo, SharpVk.AllocationCallbacks allocator)
 {
     try
     {
         SharpVk.Fence result       = default(SharpVk.Fence);
         CommandCache  commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DisplayEventInfo *marshalledDisplayEventInfo = default(SharpVk.Interop.Multivendor.DisplayEventInfo *);
         SharpVk.Interop.AllocationCallbacks *         marshalledAllocator        = default(SharpVk.Interop.AllocationCallbacks *);
         SharpVk.Interop.Fence marshalledFence = default(SharpVk.Interop.Fence);
         commandCache = extendedHandle.commandCache;
         marshalledDisplayEventInfo = (SharpVk.Interop.Multivendor.DisplayEventInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DisplayEventInfo>());
         displayEventInfo.MarshalTo(marshalledDisplayEventInfo);
         marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>());
         allocator.MarshalTo(marshalledAllocator);
         SharpVk.Interop.Multivendor.VkDeviceRegisterDisplayEventDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Multivendor.VkDeviceRegisterDisplayEventDelegate>("vkRegisterDisplayEventEXT", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, display?.handle ?? default(SharpVk.Interop.Khronos.Display), marshalledDisplayEventInfo, marshalledAllocator, &marshalledFence);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = new SharpVk.Fence(extendedHandle, marshalledFence);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #4
0
 /// <summary>
 /// Signal a fence when a device event occurs.
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="deviceEventInfo">
 /// </param>
 /// <param name="allocator">
 /// An optional AllocationCallbacks instance that controls host memory
 /// allocation.
 /// </param>
 public static unsafe SharpVk.Fence RegisterEvent(this SharpVk.Device extendedHandle, SharpVk.Multivendor.DeviceEventInfo deviceEventInfo, SharpVk.AllocationCallbacks?allocator = default(SharpVk.AllocationCallbacks?))
 {
     try
     {
         SharpVk.Fence result       = default(SharpVk.Fence);
         CommandCache  commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DeviceEventInfo *marshalledDeviceEventInfo = default(SharpVk.Interop.Multivendor.DeviceEventInfo *);
         SharpVk.Interop.AllocationCallbacks *        marshalledAllocator       = default(SharpVk.Interop.AllocationCallbacks *);
         SharpVk.Interop.Fence marshalledFence = default(SharpVk.Interop.Fence);
         commandCache = extendedHandle.commandCache;
         marshalledDeviceEventInfo = (SharpVk.Interop.Multivendor.DeviceEventInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DeviceEventInfo>());
         deviceEventInfo.MarshalTo(marshalledDeviceEventInfo);
         if (allocator != null)
         {
             marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>());
             allocator.Value.MarshalTo(marshalledAllocator);
         }
         else
         {
             marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         }
         SharpVk.Interop.Multivendor.VkDeviceRegisterEventDelegate commandDelegate = commandCache.Cache.vkRegisterDeviceEventEXT;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledDeviceEventInfo, marshalledAllocator, &marshalledFence);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = new SharpVk.Fence(extendedHandle, marshalledFence);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void BindBufferMemory2(this SharpVk.Device extendedHandle, SharpVk.Khronos.Experimental.BindBufferMemoryInfo[] bindInfos)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *marshalledBindInfos = default(SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *);
         commandCache = extendedHandle.commandCache;
         if (bindInfos != null)
         {
             var fieldPointer = (SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo>(bindInfos.Length).ToPointer());
             for (int index = 0; index < (uint)(bindInfos.Length); index++)
             {
                 bindInfos[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledBindInfos = fieldPointer;
         }
         else
         {
             marshalledBindInfos = null;
         }
         SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate>("vkBindBufferMemory2KHX", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, (uint)(bindInfos?.Length ?? 0), marshalledBindInfos);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 public static unsafe SharpVk.RenderPass CreateRenderPass2(this SharpVk.Device extendedHandle, SharpVk.Khronos.RenderPassCreateInfo2 createInfo, SharpVk.AllocationCallbacks?allocator = default(SharpVk.AllocationCallbacks?))
 {
     try
     {
         SharpVk.RenderPass result       = default(SharpVk.RenderPass);
         CommandCache       commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.RenderPassCreateInfo2 *marshalledCreateInfo = default(SharpVk.Interop.Khronos.RenderPassCreateInfo2 *);
         SharpVk.Interop.AllocationCallbacks *          marshalledAllocator  = default(SharpVk.Interop.AllocationCallbacks *);
         SharpVk.Interop.RenderPass marshalledRenderPass = default(SharpVk.Interop.RenderPass);
         commandCache         = extendedHandle.commandCache;
         marshalledCreateInfo = (SharpVk.Interop.Khronos.RenderPassCreateInfo2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.RenderPassCreateInfo2>());
         createInfo.MarshalTo(marshalledCreateInfo);
         if (allocator != null)
         {
             marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>());
             allocator.Value.MarshalTo(marshalledAllocator);
         }
         else
         {
             marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         }
         SharpVk.Interop.Khronos.VkDeviceCreateRenderPass2Delegate commandDelegate = commandCache.Cache.vkCreateRenderPass2KHR;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledCreateInfo, marshalledAllocator, &marshalledRenderPass);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = new SharpVk.RenderPass(extendedHandle, marshalledRenderPass);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #7
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe IntPtr GetSemaphoreWin32Handle(this SharpVk.Device extendedHandle, SharpVk.Khronos.SemaphoreGetWin32HandleInfo getWin32HandleInfo)
 {
     try
     {
         IntPtr       result       = default(IntPtr);
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *marshalledGetWin32HandleInfo = default(SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *);
         IntPtr marshalledHandle = default(IntPtr);
         commandCache = extendedHandle.commandCache;
         marshalledGetWin32HandleInfo = (SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo>());
         getWin32HandleInfo.MarshalTo(marshalledGetWin32HandleInfo);
         SharpVk.Interop.Khronos.VkDeviceGetSemaphoreWin32HandleDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkDeviceGetSemaphoreWin32HandleDelegate>("vkGetSemaphoreWin32HandleKHR", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledGetWin32HandleInfo, &marshalledHandle);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = marshalledHandle;
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="swapchains">
 /// </param>
 /// <param name="metadata">
 /// </param>
 public static unsafe void SetHdrMetadata(this SharpVk.Device extendedHandle, ArrayProxy <SharpVk.Khronos.Swapchain>?swapchains, ArrayProxy <SharpVk.Multivendor.HdrMetadata>?metadata)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Swapchain *      marshalledSwapchains = default(SharpVk.Interop.Khronos.Swapchain *);
         SharpVk.Interop.Multivendor.HdrMetadata *marshalledMetadata   = default(SharpVk.Interop.Multivendor.HdrMetadata *);
         commandCache = extendedHandle.commandCache;
         if (swapchains.IsNull())
         {
             marshalledSwapchains = null;
         }
         else
         {
             if (swapchains.Value.Contents == ProxyContents.Single)
             {
                 marshalledSwapchains = (SharpVk.Interop.Khronos.Swapchain *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.Swapchain>());
                 *(SharpVk.Interop.Khronos.Swapchain *)(marshalledSwapchains) = swapchains.Value.GetSingleValue()?.handle ?? default(SharpVk.Interop.Khronos.Swapchain);
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.Khronos.Swapchain *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Khronos.Swapchain>(Interop.HeapUtil.GetLength(swapchains.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(swapchains.Value)); index++)
                 {
                     fieldPointer[index] = swapchains.Value[index]?.handle ?? default(SharpVk.Interop.Khronos.Swapchain);
                 }
                 marshalledSwapchains = fieldPointer;
             }
         }
         if (metadata.IsNull())
         {
             marshalledMetadata = null;
         }
         else
         {
             if (metadata.Value.Contents == ProxyContents.Single)
             {
                 marshalledMetadata = (SharpVk.Interop.Multivendor.HdrMetadata *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.HdrMetadata>());
                 metadata.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.Multivendor.HdrMetadata *)(marshalledMetadata));
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.Multivendor.HdrMetadata *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Multivendor.HdrMetadata>(Interop.HeapUtil.GetLength(metadata.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(metadata.Value)); index++)
                 {
                     metadata.Value[index].MarshalTo(&fieldPointer[index]);
                 }
                 marshalledMetadata = fieldPointer;
             }
         }
         SharpVk.Interop.Multivendor.VkDeviceSetHdrMetadataDelegate commandDelegate = commandCache.Cache.vkSetHdrMetadataEXT;
         commandDelegate(extendedHandle.handle, (uint)(Interop.HeapUtil.GetLength(swapchains)), marshalledSwapchains, marshalledMetadata);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #9
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void UpdateDescriptorSetWithTemplate(this SharpVk.Device extendedHandle, SharpVk.DescriptorSet descriptorSet, SharpVk.Khronos.DescriptorUpdateTemplate descriptorUpdateTemplate, IntPtr data)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         commandCache = extendedHandle.commandCache;
         SharpVk.Interop.Khronos.VkDeviceUpdateDescriptorSetWithTemplateDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkDeviceUpdateDescriptorSetWithTemplateDelegate>("vkUpdateDescriptorSetWithTemplateKHR", "instance");
         commandDelegate(extendedHandle.handle, descriptorSet?.handle ?? default(SharpVk.Interop.DescriptorSet), descriptorUpdateTemplate?.handle ?? default(SharpVk.Interop.Khronos.DescriptorUpdateTemplate), data.ToPointer());
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 public static unsafe void UninitializePerformanceApi(this SharpVk.Device extendedHandle)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         commandCache = extendedHandle.commandCache;
         SharpVk.Interop.Intel.VkDeviceUninitializePerformanceApiDelegate commandDelegate = commandCache.Cache.vkUninitializePerformanceApiINTEL;
         commandDelegate(extendedHandle.handle);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #11
0
 /// <summary>
 /// Query an address of a buffer
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="info">
 /// An instance of the VkBufferDeviceAddressInfoEXT structure
 /// specifying the buffer to retrieve an address for.
 /// </param>
 public static unsafe void GetBufferDeviceAddress(this SharpVk.Device extendedHandle, SharpVk.Multivendor.BufferDeviceAddressInfo info)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.BufferDeviceAddressInfo *marshalledInfo = default(SharpVk.Interop.Multivendor.BufferDeviceAddressInfo *);
         commandCache   = extendedHandle.commandCache;
         marshalledInfo = (SharpVk.Interop.Multivendor.BufferDeviceAddressInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.BufferDeviceAddressInfo>());
         info.MarshalTo(marshalledInfo);
         SharpVk.Interop.Multivendor.VkDeviceGetBufferDeviceAddressDelegate commandDelegate = commandCache.Cache.vkGetBufferDeviceAddressEXT;
         commandDelegate(extendedHandle.handle, marshalledInfo);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #12
0
 /// <summary>
 /// Get the handle for an image view for a specific descriptor type
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="info">
 /// Describes the image view to query and type of handle.
 /// </param>
 public static unsafe void GetImageViewHandle(this SharpVk.Device extendedHandle, SharpVk.NVidia.Experimental.ImageViewHandleInfo info)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.NVidia.Experimental.ImageViewHandleInfo *marshalledInfo = default(SharpVk.Interop.NVidia.Experimental.ImageViewHandleInfo *);
         commandCache   = extendedHandle.commandCache;
         marshalledInfo = (SharpVk.Interop.NVidia.Experimental.ImageViewHandleInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.NVidia.Experimental.ImageViewHandleInfo>());
         info.MarshalTo(marshalledInfo);
         SharpVk.Interop.NVidia.Experimental.VkDeviceGetImageViewHandleDelegate commandDelegate = commandCache.Cache.vkGetImageViewHandleNVX;
         commandDelegate(extendedHandle.handle, marshalledInfo);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #13
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void SetHdrMetadata(this SharpVk.Device extendedHandle, SharpVk.Khronos.Swapchain[] swapchains, SharpVk.Multivendor.HdrMetadata[] metadata)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Swapchain *      marshalledSwapchains = default(SharpVk.Interop.Khronos.Swapchain *);
         SharpVk.Interop.Multivendor.HdrMetadata *marshalledMetadata   = default(SharpVk.Interop.Multivendor.HdrMetadata *);
         commandCache = extendedHandle.commandCache;
         if (swapchains != null)
         {
             var fieldPointer = (SharpVk.Interop.Khronos.Swapchain *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Khronos.Swapchain>(swapchains.Length).ToPointer());
             for (int index = 0; index < (uint)(swapchains.Length); index++)
             {
                 fieldPointer[index] = swapchains[index]?.handle ?? default(SharpVk.Interop.Khronos.Swapchain);
             }
             marshalledSwapchains = fieldPointer;
         }
         else
         {
             marshalledSwapchains = null;
         }
         if (metadata != null)
         {
             var fieldPointer = (SharpVk.Interop.Multivendor.HdrMetadata *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Multivendor.HdrMetadata>(metadata.Length).ToPointer());
             for (int index = 0; index < (uint)(metadata.Length); index++)
             {
                 metadata[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledMetadata = fieldPointer;
         }
         else
         {
             marshalledMetadata = null;
         }
         SharpVk.Interop.Multivendor.VkDeviceSetHdrMetadataDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Multivendor.VkDeviceSetHdrMetadataDelegate>("vkSetHdrMetadataEXT", "instance");
         commandDelegate(extendedHandle.handle, (uint)(swapchains?.Length ?? 0), marshalledSwapchains, marshalledMetadata);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #14
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void DebugMarkerSetObjectTag(this SharpVk.Device extendedHandle, SharpVk.Multivendor.DebugMarkerObjectTagInfo tagInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DebugMarkerObjectTagInfo *marshalledTagInfo = default(SharpVk.Interop.Multivendor.DebugMarkerObjectTagInfo *);
         commandCache      = extendedHandle.commandCache;
         marshalledTagInfo = (SharpVk.Interop.Multivendor.DebugMarkerObjectTagInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DebugMarkerObjectTagInfo>());
         tagInfo.MarshalTo(marshalledTagInfo);
         SharpVk.Interop.Multivendor.VkDeviceDebugMarkerSetObjectTagDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Multivendor.VkDeviceDebugMarkerSetObjectTagDelegate>("vkDebugMarkerSetObjectTagEXT", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledTagInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="nameInfo">
 /// </param>
 public static unsafe void SetDebugUtilsObjectName(this SharpVk.Device extendedHandle, SharpVk.Multivendor.DebugUtilsObjectNameInfo nameInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DebugUtilsObjectNameInfo *marshalledNameInfo = default(SharpVk.Interop.Multivendor.DebugUtilsObjectNameInfo *);
         commandCache       = extendedHandle.commandCache;
         marshalledNameInfo = (SharpVk.Interop.Multivendor.DebugUtilsObjectNameInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DebugUtilsObjectNameInfo>());
         nameInfo.MarshalTo(marshalledNameInfo);
         SharpVk.Interop.Multivendor.VkDeviceSetDebugUtilsObjectNameDelegate commandDelegate = commandCache.Cache.vkSetDebugUtilsObjectNameEXT;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledNameInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 public static unsafe void ImportSemaphoreWin32Handle(this SharpVk.Device extendedHandle, SharpVk.Khronos.ImportSemaphoreWin32HandleInfo importSemaphoreWin32HandleInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.ImportSemaphoreWin32HandleInfo *marshalledImportSemaphoreWin32HandleInfo = default(SharpVk.Interop.Khronos.ImportSemaphoreWin32HandleInfo *);
         commandCache = extendedHandle.commandCache;
         marshalledImportSemaphoreWin32HandleInfo = (SharpVk.Interop.Khronos.ImportSemaphoreWin32HandleInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.ImportSemaphoreWin32HandleInfo>());
         importSemaphoreWin32HandleInfo.MarshalTo(marshalledImportSemaphoreWin32HandleInfo);
         SharpVk.Interop.Khronos.VkDeviceImportSemaphoreWin32HandleDelegate commandDelegate = commandCache.Cache.vkImportSemaphoreWin32HandleKHR;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledImportSemaphoreWin32HandleInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #17
0
 /// <summary>
 /// Initialize a device for performance queries
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="initializeInfo">
 /// The initialization parameters.
 /// </param>
 public static unsafe void InitializePerformanceApi(this SharpVk.Device extendedHandle, SharpVk.Intel.InitializePerformanceApiInfo initializeInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Intel.InitializePerformanceApiInfo *marshalledInitializeInfo = default(SharpVk.Interop.Intel.InitializePerformanceApiInfo *);
         commandCache             = extendedHandle.commandCache;
         marshalledInitializeInfo = (SharpVk.Interop.Intel.InitializePerformanceApiInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Intel.InitializePerformanceApiInfo>());
         initializeInfo.MarshalTo(marshalledInitializeInfo);
         SharpVk.Interop.Intel.VkDeviceInitializePerformanceApiDelegate commandDelegate = commandCache.Cache.vkInitializePerformanceApiINTEL;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledInitializeInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #18
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void ImportFenceFileDescriptor(this SharpVk.Device extendedHandle, SharpVk.Khronos.ImportFenceFileDescriptorInfo importFenceFileDescriptorInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.ImportFenceFileDescriptorInfo *marshalledImportFenceFileDescriptorInfo = default(SharpVk.Interop.Khronos.ImportFenceFileDescriptorInfo *);
         commandCache = extendedHandle.commandCache;
         marshalledImportFenceFileDescriptorInfo = (SharpVk.Interop.Khronos.ImportFenceFileDescriptorInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.ImportFenceFileDescriptorInfo>());
         importFenceFileDescriptorInfo.MarshalTo(marshalledImportFenceFileDescriptorInfo);
         SharpVk.Interop.Khronos.VkDeviceImportFenceFileDescriptorDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkDeviceImportFenceFileDescriptorDelegate>("vkImportFenceFdKHR", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledImportFenceFileDescriptorInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #19
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void DisplayPowerControl(this SharpVk.Device extendedHandle, SharpVk.Khronos.Display display, SharpVk.Multivendor.DisplayPowerInfo displayPowerInfo)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.DisplayPowerInfo *marshalledDisplayPowerInfo = default(SharpVk.Interop.Multivendor.DisplayPowerInfo *);
         commandCache = extendedHandle.commandCache;
         marshalledDisplayPowerInfo = (SharpVk.Interop.Multivendor.DisplayPowerInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DisplayPowerInfo>());
         displayPowerInfo.MarshalTo(marshalledDisplayPowerInfo);
         SharpVk.Interop.Multivendor.VkDeviceDisplayPowerControlDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Multivendor.VkDeviceDisplayPowerControlDelegate>("vkDisplayPowerControlEXT", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, display?.handle ?? default(SharpVk.Interop.Khronos.Display), marshalledDisplayPowerInfo);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #20
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="bindInfos">
 /// </param>
 public static unsafe void BindAccelerationStructureMemory(this SharpVk.Device extendedHandle, ArrayProxy <SharpVk.NVidia.BindAccelerationStructureMemoryInfo>?bindInfos)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo *marshalledBindInfos = default(SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo *);
         commandCache = extendedHandle.commandCache;
         if (bindInfos.IsNull())
         {
             marshalledBindInfos = null;
         }
         else
         {
             if (bindInfos.Value.Contents == ProxyContents.Single)
             {
                 marshalledBindInfos = (SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo>());
                 bindInfos.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo *)(marshalledBindInfos));
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.NVidia.BindAccelerationStructureMemoryInfo>(Interop.HeapUtil.GetLength(bindInfos.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(bindInfos.Value)); index++)
                 {
                     bindInfos.Value[index].MarshalTo(&fieldPointer[index]);
                 }
                 marshalledBindInfos = fieldPointer;
             }
         }
         SharpVk.Interop.NVidia.VkDeviceBindAccelerationStructureMemoryDelegate commandDelegate = commandCache.Cache.vkBindAccelerationStructureMemoryNV;
         Result methodResult = commandDelegate(extendedHandle.handle, (uint)(Interop.HeapUtil.GetLength(bindInfos)), marshalledBindInfos);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #21
0
 /// <summary>
 /// Query performance capabilities of the device
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="parameter">
 /// The parameter to query.
 /// </param>
 public static unsafe SharpVk.Intel.PerformanceValue GetPerformanceParameter(this SharpVk.Device extendedHandle, SharpVk.Intel.PerformanceParameterType parameter)
 {
     try
     {
         SharpVk.Intel.PerformanceValue result = default(SharpVk.Intel.PerformanceValue);
         CommandCache commandCache             = default(CommandCache);
         SharpVk.Interop.Intel.PerformanceValue marshalledValue = default(SharpVk.Interop.Intel.PerformanceValue);
         commandCache = extendedHandle.commandCache;
         SharpVk.Interop.Intel.VkDeviceGetPerformanceParameterDelegate commandDelegate = commandCache.Cache.vkGetPerformanceParameterINTEL;
         Result methodResult = commandDelegate(extendedHandle.handle, parameter, &marshalledValue);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = SharpVk.Intel.PerformanceValue.MarshalFrom(&marshalledValue);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #22
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="info">
 /// </param>
 /// <param name="buffer">
 /// </param>
 public static unsafe void GetMemoryAndroidHardwareBuffer(this SharpVk.Device extendedHandle, SharpVk.Android.MemoryGetAndroidHardwareBufferInfo info, IntPtr buffer)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *marshalledInfo = default(SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *);
         IntPtr *marshalledBuffer = default(IntPtr *);
         commandCache   = extendedHandle.commandCache;
         marshalledInfo = (SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo>());
         info.MarshalTo(marshalledInfo);
         marshalledBuffer = (IntPtr *)(Interop.HeapUtil.Allocate <IntPtr>());
         *marshalledBuffer = buffer;
         SharpVk.Interop.Android.VkDeviceGetMemoryAndroidHardwareBufferDelegate commandDelegate = commandCache.Cache.vkGetMemoryAndroidHardwareBufferANDROID;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledInfo, marshalledBuffer);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #23
0
 internal Fence(SharpVk.Device parent, SharpVk.Interop.Fence handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #24
0
 internal IndirectCommandsLayout(SharpVk.Device parent, SharpVk.Interop.NVidia.Experimental.IndirectCommandsLayout handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #25
0
 /// <summary>
 /// Create a new device instance.
 /// </summary>
 /// <param name="flags">
 /// Reserved for future use.
 /// </param>
 /// <param name="enabledLayerNames">
 /// ppEnabledLayerNames is deprecated and ignored. See Device Layer
 /// Deprecation.
 /// </param>
 /// <param name="enabledExtensionNames">
 /// An array of enabledExtensionCount strings containing the names of
 /// extensions to enable for the created device. See the Extensions
 /// section for further details.
 /// </param>
 /// <param name="enabledFeatures">
 /// Null or a PhysicalDeviceFeatures structure that contains boolean
 /// indicators of all the features to be enabled. Refer to the Features
 /// section for further details.
 /// </param>
 /// <param name="allocator">
 /// An optional AllocationCallbacks instance that controls host memory
 /// allocation.
 /// </param>
 public unsafe SharpVk.Device CreateDevice(ArrayProxy <SharpVk.DeviceQueueCreateInfo>?queueCreateInfos, ArrayProxy <string>?enabledLayerNames, ArrayProxy <string>?enabledExtensionNames, SharpVk.DeviceCreateFlags?flags = default(SharpVk.DeviceCreateFlags?), SharpVk.PhysicalDeviceFeatures?enabledFeatures = default(SharpVk.PhysicalDeviceFeatures?), SharpVk.Khronos.PhysicalDeviceFeatures2?physicalDeviceFeatures2Khr = null, SharpVk.Khronos.Experimental.DeviceGroupDeviceCreateInfo?deviceGroupDeviceCreateInfoKhx = null, SharpVk.AllocationCallbacks?allocator = default(SharpVk.AllocationCallbacks?))
 {
     try
     {
         SharpVk.Device result = default(SharpVk.Device);
         SharpVk.Interop.DeviceCreateInfo *marshalledCreateInfo = default(SharpVk.Interop.DeviceCreateInfo *);
         void *nextPointer = default(void *);
         SharpVk.Interop.AllocationCallbacks *marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         SharpVk.Interop.Device marshalledDevice = default(SharpVk.Interop.Device);
         if (physicalDeviceFeatures2Khr != null)
         {
             SharpVk.Interop.Khronos.PhysicalDeviceFeatures2 *extensionPointer = default(SharpVk.Interop.Khronos.PhysicalDeviceFeatures2 *);
             extensionPointer = (SharpVk.Interop.Khronos.PhysicalDeviceFeatures2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.PhysicalDeviceFeatures2>());
             physicalDeviceFeatures2Khr.Value.MarshalTo(extensionPointer);
             extensionPointer->Next = nextPointer;
             nextPointer            = extensionPointer;
         }
         if (deviceGroupDeviceCreateInfoKhx != null)
         {
             SharpVk.Interop.Khronos.Experimental.DeviceGroupDeviceCreateInfo *extensionPointer = default(SharpVk.Interop.Khronos.Experimental.DeviceGroupDeviceCreateInfo *);
             extensionPointer = (SharpVk.Interop.Khronos.Experimental.DeviceGroupDeviceCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.Experimental.DeviceGroupDeviceCreateInfo>());
             deviceGroupDeviceCreateInfoKhx.Value.MarshalTo(extensionPointer);
             extensionPointer->Next = nextPointer;
             nextPointer            = extensionPointer;
         }
         marshalledCreateInfo        = (SharpVk.Interop.DeviceCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.DeviceCreateInfo>());
         marshalledCreateInfo->SType = StructureType.DeviceCreateInfo;
         marshalledCreateInfo->Next  = nextPointer;
         if (flags != null)
         {
             marshalledCreateInfo->Flags = flags.Value;
         }
         else
         {
             marshalledCreateInfo->Flags = default(SharpVk.DeviceCreateFlags);
         }
         marshalledCreateInfo->QueueCreateInfoCount = (uint)(Interop.HeapUtil.GetLength(queueCreateInfos));
         if (queueCreateInfos.IsNull())
         {
             marshalledCreateInfo->QueueCreateInfos = null;
         }
         else
         {
             if (queueCreateInfos.Value.Contents == ProxyContents.Single)
             {
                 marshalledCreateInfo->QueueCreateInfos = (SharpVk.Interop.DeviceQueueCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.DeviceQueueCreateInfo>());
                 queueCreateInfos.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.DeviceQueueCreateInfo *)(marshalledCreateInfo->QueueCreateInfos));
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.DeviceQueueCreateInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.DeviceQueueCreateInfo>(Interop.HeapUtil.GetLength(queueCreateInfos.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(queueCreateInfos.Value)); index++)
                 {
                     queueCreateInfos.Value[index].MarshalTo(&fieldPointer[index]);
                 }
                 marshalledCreateInfo->QueueCreateInfos = fieldPointer;
             }
         }
         marshalledCreateInfo->EnabledLayerCount     = (uint)(Interop.HeapUtil.GetLength(enabledLayerNames));
         marshalledCreateInfo->EnabledLayerNames     = Interop.HeapUtil.MarshalTo(enabledLayerNames);
         marshalledCreateInfo->EnabledExtensionCount = (uint)(Interop.HeapUtil.GetLength(enabledExtensionNames));
         marshalledCreateInfo->EnabledExtensionNames = Interop.HeapUtil.MarshalTo(enabledExtensionNames);
         if (enabledFeatures != null)
         {
             marshalledCreateInfo->EnabledFeatures = (SharpVk.Interop.PhysicalDeviceFeatures *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PhysicalDeviceFeatures>());
             enabledFeatures.Value.MarshalTo(marshalledCreateInfo->EnabledFeatures);
         }
         else
         {
             marshalledCreateInfo->EnabledFeatures = default(SharpVk.Interop.PhysicalDeviceFeatures *);
         }
         if (allocator != null)
         {
             marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>());
             allocator.Value.MarshalTo(marshalledAllocator);
         }
         else
         {
             marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         }
         SharpVk.Interop.VkPhysicalDeviceCreateDeviceDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.VkPhysicalDeviceCreateDeviceDelegate>("vkCreateDevice", "");
         Result methodResult = commandDelegate(this.handle, marshalledCreateInfo, marshalledAllocator, &marshalledDevice);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = new SharpVk.Device(this, marshalledDevice);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
예제 #26
0
 internal Event(SharpVk.Device parent, SharpVk.Interop.Event handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #27
0
 internal DescriptorSetLayout(SharpVk.Device parent, SharpVk.Interop.DescriptorSetLayout handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #28
0
 internal DeviceMemory(SharpVk.Device parent, SharpVk.Interop.DeviceMemory handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #29
0
 internal QueryPool(SharpVk.Device parent, SharpVk.Interop.QueryPool handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }
예제 #30
0
 internal PipelineLayout(SharpVk.Device parent, SharpVk.Interop.PipelineLayout handle)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = parent.commandCache;
 }