1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/*
* gulkan
* Copyright 2018 Collabora Ltd.
* Author: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
* SPDX-License-Identifier: MIT
*/
#include "gulkan.h"
static void
_test_minimal ()
{
GulkanInstance *instance = gulkan_instance_new ();
g_assert_nonnull (instance);
g_assert (gulkan_instance_create (instance, NULL));
GulkanDevice *device = gulkan_device_new ();
g_assert_nonnull (device);
g_assert (gulkan_device_create (device, instance,
VK_NULL_HANDLE, NULL));
g_object_unref (device);
g_object_unref (instance);
}
static void
_test_extensions ()
{
GulkanInstance *instance = gulkan_instance_new ();
g_assert_nonnull (instance);
g_assert (gulkan_instance_create (instance, NULL));
GulkanDevice *device = gulkan_device_new ();
g_assert_nonnull (device);
GSList *extensions = NULL;
extensions = g_slist_append (extensions, "VK_KHR_external_memory_fd");
g_assert (gulkan_device_create (device, instance,
VK_NULL_HANDLE, extensions));
g_slist_free (extensions);
g_object_unref (device);
g_object_unref (instance);
}
int
main ()
{
_test_minimal ();
_test_extensions ();
return 0;
}
|