/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.NVidia.CooperativeMatrixProperties *pointer) { pointer->SType = StructureType.CooperativeMatrixProperties; pointer->Next = null; pointer->MSize = this.MSize; pointer->NSize = this.NSize; pointer->KSize = this.KSize; pointer->AType = this.AType; pointer->BType = this.BType; pointer->CType = this.CType; pointer->DType = this.DType; pointer->Scope = this.Scope; }
/// <summary> /// /// </summary> internal static unsafe CooperativeMatrixProperties MarshalFrom(SharpVk.Interop.NVidia.CooperativeMatrixProperties *pointer) { CooperativeMatrixProperties result = default(CooperativeMatrixProperties); result.MSize = pointer->MSize; result.NSize = pointer->NSize; result.KSize = pointer->KSize; result.AType = pointer->AType; result.BType = pointer->BType; result.CType = pointer->CType; result.DType = pointer->DType; result.Scope = pointer->Scope; return(result); }
/// <summary> /// Returns properties describing what cooperative matrix types are /// supported /// </summary> /// <param name="extendedHandle"> /// The PhysicalDevice handle to extend. /// </param> public static unsafe SharpVk.NVidia.CooperativeMatrixProperties[] GetCooperativeMatrixProperties(this SharpVk.PhysicalDevice extendedHandle) { try { SharpVk.NVidia.CooperativeMatrixProperties[] result = default(SharpVk.NVidia.CooperativeMatrixProperties[]); uint marshalledPropertyCount = default(uint); CommandCache commandCache = default(CommandCache); SharpVk.Interop.NVidia.CooperativeMatrixProperties *marshalledProperties = default(SharpVk.Interop.NVidia.CooperativeMatrixProperties *); commandCache = extendedHandle.commandCache; SharpVk.Interop.NVidia.VkPhysicalDeviceGetCooperativeMatrixPropertiesDelegate commandDelegate = commandCache.Cache.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV; Result methodResult = commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } marshalledProperties = (SharpVk.Interop.NVidia.CooperativeMatrixProperties *)(Interop.HeapUtil.Allocate <SharpVk.Interop.NVidia.CooperativeMatrixProperties>((uint)(marshalledPropertyCount))); commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties); if (marshalledProperties != null) { var fieldPointer = new SharpVk.NVidia.CooperativeMatrixProperties[(uint)(marshalledPropertyCount)]; for (int index = 0; index < (uint)(marshalledPropertyCount); index++) { fieldPointer[index] = SharpVk.NVidia.CooperativeMatrixProperties.MarshalFrom(&marshalledProperties[index]); } result = fieldPointer; } else { result = null; } return(result); } finally { Interop.HeapUtil.FreeAll(); } }