Beispiel #1
0
        public static string[] GetSupportedExtensions(Vk api, PhysicalDevice physicalDevice)
        {
            uint propertiesCount;

            api.EnumerateDeviceExtensionProperties(physicalDevice, (byte *)null, &propertiesCount, null).ThrowOnError();

            ExtensionProperties[] extensionProperties = new ExtensionProperties[propertiesCount];

            fixed(ExtensionProperties *pExtensionProperties = extensionProperties)
            {
                api.EnumerateDeviceExtensionProperties(physicalDevice, (byte *)null, &propertiesCount, pExtensionProperties).ThrowOnError();
            }

            return(extensionProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.ExtensionName)).ToArray());
        }
        internal unsafe string[] GetSupportedExtensions()
        {
            uint propertiesCount;

            Api.EnumerateDeviceExtensionProperties(InternalHandle, (byte *)null, &propertiesCount, null).ThrowOnError();

            var extensionProperties = new ExtensionProperties[propertiesCount];

            fixed(ExtensionProperties *pExtensionProperties = extensionProperties)
            {
                Api.EnumerateDeviceExtensionProperties(InternalHandle, (byte *)null, &propertiesCount, pExtensionProperties)
                .ThrowOnError();
            }

            return(extensionProperties.Select(x => Marshal.PtrToStringAnsi((IntPtr)x.ExtensionName)).ToArray());
        }