load instance functions
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "instance/gryphn_instance.h"
|
||||
#include "commands/command_buffer/vulkan_command_buffer.h"
|
||||
|
||||
gnReturnCode gnCreateOutputDeviceFn(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo) {
|
||||
gnReturnCode createOutputDevice(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo) {
|
||||
outputDevice->outputDevice = malloc(sizeof(gnPlatformOutputDevice));
|
||||
|
||||
VkDeviceQueueCreateInfo* queueCreateInfos = malloc(sizeof(VkDeviceQueueCreateInfo) * deviceInfo.queueInfoCount);
|
||||
@@ -90,11 +90,11 @@ gnReturnCode gnCreateOutputDeviceFn(gnOutputDeviceHandle outputDevice, gnInstanc
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
void gnWaitForDeviceFn(const gnOutputDeviceHandle device) {
|
||||
void waitForDevice(const gnOutputDeviceHandle device) {
|
||||
vkDeviceWaitIdle(device->outputDevice->device);
|
||||
}
|
||||
|
||||
void gnDestroyOutputDeviceFn(gnOutputDeviceHandle device) {
|
||||
void destroyOutputDevice(gnOutputDeviceHandle device) {
|
||||
vkDestroyCommandPool(device->outputDevice->device, device->outputDevice->transferCommandPool, NULL);
|
||||
vkDestroyDevice(device->outputDevice->device, NULL);
|
||||
free(device->outputDevice);
|
||||
|
@@ -15,3 +15,8 @@ typedef struct gnPlatformOutputDevice_t {
|
||||
|
||||
VkCommandBuffer gnBeginVulkanTransferOperation(gnDevice device);
|
||||
void gnEndVulkanTransferOperation(gnDevice device, VkCommandBuffer commandBuffer);
|
||||
|
||||
|
||||
gnReturnCode createOutputDevice(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo);
|
||||
void waitForDevice(const gnOutputDeviceHandle device);
|
||||
void destroyOutputDevice(gnOutputDeviceHandle device);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <output_device/vulkan_device_extensions.h>
|
||||
#include <vulkan_surface/vulkan_surface.h>
|
||||
|
||||
gnPhysicalDevice* gnGetPhysicalDevicesFn(gnInstanceHandle instance, uint32_t* deviceCount) {
|
||||
gnPhysicalDevice* getPhysicalDevices(gnInstanceHandle instance, uint32_t* deviceCount) {
|
||||
vkEnumeratePhysicalDevices(instance->instance->vk_instance, deviceCount, NULL);
|
||||
if (deviceCount == 0)
|
||||
return NULL;
|
||||
@@ -49,7 +49,7 @@ gnPhysicalDevice* gnGetPhysicalDevicesFn(gnInstanceHandle instance, uint32_t* de
|
||||
return outputDevices;
|
||||
}
|
||||
|
||||
gnBool gnQueueCanPresentToSurfaceFn(const gnPhysicalDevice device, uint32_t queueIndex, gnWindowSurfaceHandle windowSurface) {
|
||||
gnBool queueCanPresentToSurface(const gnPhysicalDevice device, uint32_t queueIndex, gnWindowSurfaceHandle windowSurface) {
|
||||
VkBool32 supportsPresent = VK_FALSE;
|
||||
vkGetPhysicalDeviceSurfaceSupportKHR(device.physicalDevice->device, queueIndex, windowSurface->windowSurface->surface, &supportsPresent);
|
||||
if (supportsPresent)
|
||||
|
@@ -5,3 +5,6 @@
|
||||
typedef struct gnPlatformPhysicalDevice_t {
|
||||
VkPhysicalDevice device;
|
||||
} gnPlatformPhysicalDevice;
|
||||
|
||||
gnPhysicalDevice* getPhysicalDevices(gnInstanceHandle instance, uint32_t* deviceCount);
|
||||
gnBool queueCanPresentToSurface(const gnPhysicalDevice device, uint32_t queueIndex, gnWindowSurfaceHandle windowSurface);
|
||||
|
Reference in New Issue
Block a user