/// <summary> /// Acquire the performance query capability /// </summary> /// <param name="extendedHandle"> /// The Device handle to extend. /// </param> /// <param name="type"> /// One of the VkPerformanceConfigurationTypeINTEL type of performance /// configuration that will be acquired. /// </param> public static unsafe SharpVk.Intel.PerformanceConfiguration AcquirePerformanceConfiguration(this SharpVk.Device extendedHandle, SharpVk.Intel.PerformanceConfigurationType type) { try { SharpVk.Intel.PerformanceConfiguration result = default(SharpVk.Intel.PerformanceConfiguration); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Intel.PerformanceConfigurationAcquireInfo *marshalledAcquireInfo = default(SharpVk.Interop.Intel.PerformanceConfigurationAcquireInfo *); void *nextPointer = default(void *); SharpVk.Interop.Intel.PerformanceConfiguration marshalledConfiguration = default(SharpVk.Interop.Intel.PerformanceConfiguration); commandCache = extendedHandle.commandCache; marshalledAcquireInfo = (SharpVk.Interop.Intel.PerformanceConfigurationAcquireInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Intel.PerformanceConfigurationAcquireInfo>()); marshalledAcquireInfo->SType = StructureType.PerformanceConfigurationAcquireInfo; marshalledAcquireInfo->Next = nextPointer; marshalledAcquireInfo->Type = type; SharpVk.Interop.Intel.VkDeviceAcquirePerformanceConfigurationDelegate commandDelegate = commandCache.Cache.vkAcquirePerformanceConfigurationINTEL; Result methodResult = commandDelegate(extendedHandle.handle, marshalledAcquireInfo, &marshalledConfiguration); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = new SharpVk.Intel.PerformanceConfiguration(extendedHandle, marshalledConfiguration); return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> /// <param name="extendedHandle"> /// The Queue handle to extend. /// </param> public static unsafe void SetPerformanceConfiguration(this SharpVk.Queue extendedHandle, SharpVk.Intel.PerformanceConfiguration configuration) { try { CommandCache commandCache = default(CommandCache); commandCache = extendedHandle.commandCache; SharpVk.Interop.Intel.VkQueueSetPerformanceConfigurationDelegate commandDelegate = commandCache.Cache.vkQueueSetPerformanceConfigurationINTEL; Result methodResult = commandDelegate(extendedHandle.handle, configuration?.handle ?? default(SharpVk.Interop.Intel.PerformanceConfiguration)); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } } finally { Interop.HeapUtil.FreeAll(); } }