Linux fixes

main
noah metz 2024-10-14 21:29:35 -06:00
parent 38b7a2f954
commit 0060a381ad
3 changed files with 9 additions and 2 deletions

@ -8,7 +8,11 @@
#define GLFW_INCLUDE_VULKAN #define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#ifdef __APPLE__
#define GLFW_EXPOSE_NATIVE_COCOA #define GLFW_EXPOSE_NATIVE_COCOA
#endif
#include <GLFW/glfw3native.h> #include <GLFW/glfw3native.h>
#define GLM_FORCE_RADIANS #define GLM_FORCE_RADIANS

@ -1,4 +1,5 @@
#include "render.h" #include "render.h"
#include "arpa/inet.h"
#include "pipeline.h" #include "pipeline.h"
#include "vk_mem_alloc.h" #include "vk_mem_alloc.h"
#include "vulkan/vk_enum_string_helper.h" #include "vulkan/vk_enum_string_helper.h"

@ -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;
} }
} }