|
|
@ -1,4 +1,6 @@
|
|
|
|
#include "render.h"
|
|
|
|
#include "render.h"
|
|
|
|
|
|
|
|
#include "stdio.h"
|
|
|
|
|
|
|
|
#include "string.h"
|
|
|
|
#include "pipeline.h"
|
|
|
|
#include "pipeline.h"
|
|
|
|
#include "vk_mem_alloc.h"
|
|
|
|
#include "vk_mem_alloc.h"
|
|
|
|
#include "vulkan/vulkan_core.h"
|
|
|
|
#include "vulkan/vulkan_core.h"
|
|
|
@ -17,7 +19,6 @@ const char * instance_extensions[] = {
|
|
|
|
VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME,
|
|
|
|
VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME,
|
|
|
|
VK_EXT_DEBUG_UTILS_EXTENSION_NAME,
|
|
|
|
VK_EXT_DEBUG_UTILS_EXTENSION_NAME,
|
|
|
|
VK_EXT_DEBUG_REPORT_EXTENSION_NAME,
|
|
|
|
VK_EXT_DEBUG_REPORT_EXTENSION_NAME,
|
|
|
|
"VK_EXT_metal_surface",
|
|
|
|
|
|
|
|
VK_KHR_SURFACE_EXTENSION_NAME,
|
|
|
|
VK_KHR_SURFACE_EXTENSION_NAME,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
uint32_t instance_extension_count = sizeof(instance_extensions) / sizeof(const char *);
|
|
|
|
uint32_t instance_extension_count = sizeof(instance_extensions) / sizeof(const char *);
|
|
|
@ -25,7 +26,6 @@ uint32_t instance_extension_count = sizeof(instance_extensions) / sizeof(const c
|
|
|
|
const char * device_extensions[] = {
|
|
|
|
const char * device_extensions[] = {
|
|
|
|
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
|
|
|
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
|
|
|
VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME,
|
|
|
|
VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME,
|
|
|
|
"VK_KHR_portability_subset",
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
uint32_t device_extension_count = sizeof(device_extensions) / sizeof(const char *);
|
|
|
|
uint32_t device_extension_count = sizeof(device_extensions) / sizeof(const char *);
|
|
|
|
|
|
|
|
|
|
|
@ -65,6 +65,7 @@ bool check_validation_layers(const char ** layers, uint32_t num_layers) {
|
|
|
|
VkLayerProperties* available_layers = malloc(sizeof(VkLayerProperties)*layer_count);
|
|
|
|
VkLayerProperties* available_layers = malloc(sizeof(VkLayerProperties)*layer_count);
|
|
|
|
result = vkEnumerateInstanceLayerProperties(&layer_count, available_layers);
|
|
|
|
result = vkEnumerateInstanceLayerProperties(&layer_count, available_layers);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(uint32_t i = 0; i < num_layers; i++) {
|
|
|
|
for(uint32_t i = 0; i < num_layers; i++) {
|
|
|
|
bool found = false;
|
|
|
|
bool found = false;
|
|
|
|
for(uint32_t j = 0; j < layer_count; j++) {
|
|
|
|
for(uint32_t j = 0; j < layer_count; j++) {
|
|
|
@ -74,6 +75,7 @@ bool check_validation_layers(const char ** layers, uint32_t num_layers) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(found == false) {
|
|
|
|
if(found == false) {
|
|
|
|
free(available_layers);
|
|
|
|
free(available_layers);
|
|
|
|
|
|
|
|
fprintf(stderr, "Failed to find layer %s\n", layers[i]);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|