From d6837defc03e431517f6616ec8e49a8eb3643011 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:00:37 +1000 Subject: Start moving more files to using ral.h --- src/systems/text.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/systems/text.h') diff --git a/src/systems/text.h b/src/systems/text.h index 19248a6..4fac0b8 100644 --- a/src/systems/text.h +++ b/src/systems/text.h @@ -5,9 +5,11 @@ #include +#include "cleanroom/types.h" #include "darray.h" #include "defines.h" #include "render_types.h" +#include "ral.h" struct core; @@ -29,7 +31,7 @@ KITC_DECL_TYPED_ARRAY(draw_text_packet) typedef struct text_system_state { font default_font; - shader glyph_shader; + shader_handle glyph_shader; u32 glyph_vbo; u32 glyph_vao; draw_text_packet_darray *draw_cmd_buf; -- cgit v1.2.3-70-g09d2 From fc35df8e999521b8be7c44800f4ff4665df3254a Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:35:11 +1000 Subject: heightmap function signatures --- src/core.h | 2 +- src/logos/jobs.h | 4 ++-- src/maths/primitives.c | 16 +++----------- src/platform/mutex.c | 2 +- src/platform/mutex.h | 12 ++++++----- src/platform/thread.h | 6 +++--- src/renderer/cleanroom/backend_vulkan.h | 7 ++++--- src/renderer/cleanroom/ral.h | 12 +++++------ src/renderer/cleanroom/renderer.h | 2 +- src/renderer/cleanroom/types.h | 13 ++++++++---- src/renderer/render_types.h | 3 ++- src/std/containers/graphs.h | 7 +++---- src/std/containers/hashset.h | 6 +++--- src/std/containers/hashtable.h | 6 +++--- src/systems/physics.h | 2 +- src/systems/terrain.h | 37 ++++++++++++++++++++++++++++----- src/systems/text.h | 2 +- src/transform_hierarchy.h | 2 +- 18 files changed, 83 insertions(+), 58 deletions(-) (limited to 'src/systems/text.h') diff --git a/src/core.h b/src/core.h index dd5a695..be88c53 100644 --- a/src/core.h +++ b/src/core.h @@ -3,8 +3,8 @@ #include "defines.h" #include "input.h" #include "ral.h" -#include "terrain.h" #include "screenspace.h" +#include "terrain.h" #include "text.h" #include "threadpool.h" diff --git a/src/logos/jobs.h b/src/logos/jobs.h index cc2c8fa..ef4eed7 100644 --- a/src/logos/jobs.h +++ b/src/logos/jobs.h @@ -1,3 +1,3 @@ /** - * Common jobs that get run -*/ \ No newline at end of file + * Common jobs that get run + */ \ No newline at end of file diff --git a/src/maths/primitives.c b/src/maths/primitives.c index 42c51ea..55ff5fc 100644 --- a/src/maths/primitives.c +++ b/src/maths/primitives.c @@ -13,20 +13,10 @@ geometry_data geo_create_plane(f32x2 extents) { vertex_format format = VERTEX_STATIC_3D; vertex_darray* vertices = vertex_darray_new(4); - vertex_darray_push( - vertices, - (vertex) {.static_3d = { - .position = - }} - ); - - return (geometry_data) { - .format = format, - .vertices = - .has_indices = true, - } -} + vertex_darray_push(vertices, (vertex){ .static_3d = { .position = } }); + return (geometry_data) { .format = format, .vertices =.has_indices = true, } +} // OLD diff --git a/src/platform/mutex.c b/src/platform/mutex.c index 9735483..2aeb825 100644 --- a/src/platform/mutex.c +++ b/src/platform/mutex.c @@ -4,6 +4,6 @@ // TODO: implement in terms of pthreads #endif -#if defined (CEL_PLATFORM_WINDOWS) +#if defined(CEL_PLATFORM_WINDOWS) // TODO: implement using win32 api #endif \ No newline at end of file diff --git a/src/platform/mutex.h b/src/platform/mutex.h index 0552ea2..a0a4208 100644 --- a/src/platform/mutex.h +++ b/src/platform/mutex.h @@ -1,12 +1,12 @@ /** * @file mutex.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ #include @@ -16,10 +16,12 @@ cel_mutex mutex_create(); void mutex_destroy(cel_mutex* mutex); -/** @brief Blocks until the mutex can be acquired. if returns false then an error occurred and can be checked (TODO) */ +/** @brief Blocks until the mutex can be acquired. if returns false then an error occurred and can + * be checked (TODO) */ bool mutex_lock(cel_mutex* mutex); -/** @brief Tries to acquire the mutex like `mutex_lock` but returns immediately if the mutex has already been locked */ +/** @brief Tries to acquire the mutex like `mutex_lock` but returns immediately if the mutex has + * already been locked */ bool mutex_try_lock(cel_mutex* mutex); /** @brief Releases a mutex. If it is already unlocked then does nothing */ diff --git a/src/platform/thread.h b/src/platform/thread.h index a3560cb..af07d3f 100644 --- a/src/platform/thread.h +++ b/src/platform/thread.h @@ -1,12 +1,12 @@ /** * @file thread.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ typedef struct cel_thread cel_thread; diff --git a/src/renderer/cleanroom/backend_vulkan.h b/src/renderer/cleanroom/backend_vulkan.h index 6798b13..c8d5777 100644 --- a/src/renderer/cleanroom/backend_vulkan.h +++ b/src/renderer/cleanroom/backend_vulkan.h @@ -3,7 +3,8 @@ #define GPU_SWAPCHAIN_IMG_COUNT 2 -typedef struct gpu_swapchain {} gpu_swapchain; +typedef struct gpu_swapchain { +} gpu_swapchain; typedef struct gpu_device { // In Vulkan we store both physical and logical device here VkPhysicalDevice physical_device; @@ -13,7 +14,8 @@ typedef struct gpu_device { VkPhysicalDeviceMemoryProperties memory; VkCommandPool pool; } gpu_device; -typedef struct gpu_pipeline {} gpu_pipeline; +typedef struct gpu_pipeline { +} gpu_pipeline; typedef struct gpu_renderpass { VkRenderPass vk_handle; @@ -21,7 +23,6 @@ typedef struct gpu_renderpass { u32 } gpu_renderpass; - typedef struct gpu_cmd_encoder { VkCommandBuffer cmd_buffer; } gpu_cmd_encoder; \ No newline at end of file diff --git a/src/renderer/cleanroom/ral.h b/src/renderer/cleanroom/ral.h index a1e9929..15eb027 100644 --- a/src/renderer/cleanroom/ral.h +++ b/src/renderer/cleanroom/ral.h @@ -5,9 +5,9 @@ * @details API that a graphics backend *must* implement * @version 0.1 * @date 2024-03-31 - * + * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -19,8 +19,8 @@ typedef struct gpu_swapchain gpu_swapchain; typedef struct gpu_device gpu_device; typedef struct gpu_pipeline gpu_pipeline; typedef struct gpu_renderpass gpu_renderpass; -typedef struct gpu_cmd_encoder gpu_cmd_encoder; // Recording -typedef struct gpu_cmd_buffer gpu_cmd_buffer; // Ready for submission +typedef struct gpu_cmd_encoder gpu_cmd_encoder; // Recording +typedef struct gpu_cmd_buffer gpu_cmd_buffer; // Ready for submission enum pipeline_kind { GRAPHICS, @@ -29,8 +29,8 @@ enum pipeline_kind { typedef struct shader_desc { const char* debug_name; - str8 filepath; // where it came from - str8 glsl; // contents + str8 filepath; // where it came from + str8 glsl; // contents } shader_desc; struct pipeline_desc { diff --git a/src/renderer/cleanroom/renderer.h b/src/renderer/cleanroom/renderer.h index 8012b49..ff342b0 100644 --- a/src/renderer/cleanroom/renderer.h +++ b/src/renderer/cleanroom/renderer.h @@ -1,7 +1,7 @@ #pragma once -#include "cleanroom/ral.h" #include "cleanroom/backend_vulkan.h" +#include "cleanroom/ral.h" typedef struct renderer2 { void* backend_state; diff --git a/src/renderer/cleanroom/types.h b/src/renderer/cleanroom/types.h index 98c2e21..b18b5b8 100644 --- a/src/renderer/cleanroom/types.h +++ b/src/renderer/cleanroom/types.h @@ -10,7 +10,8 @@ CORE_DEFINE_HANDLE(sampler_handle); CORE_DEFINE_HANDLE(shader_handle); CORE_DEFINE_HANDLE(model_handle); -typedef struct transform_hierarchy {} transform_hierarchy; +typedef struct transform_hierarchy { +} transform_hierarchy; /** @brief Texture Description - used by texture creation functions */ typedef struct texture_desc { @@ -56,7 +57,12 @@ typedef struct model bp_material; // blinn-phong #include "maths_types.h" -typedef enum vertex_format { VERTEX_STATIC_3D, VERTEX_SPRITE, VERTEX_SKINNED, VERTEX_COUNT } vertex_format; +typedef enum vertex_format { + VERTEX_STATIC_3D, + VERTEX_SPRITE, + VERTEX_SKINNED, + VERTEX_COUNT +} vertex_format; typedef union vertex { struct { @@ -79,7 +85,7 @@ typedef union vertex { vec3 normal; vec4i bone_ids; // Integer vector for bone IDs vec4 bone_weights; // Weight of each bone's influence - } skinned_3d; /** @brief vertex format for skeletal (animated) geometry in 3D */ + } skinned_3d; /** @brief vertex format for skeletal (animated) geometry in 3D */ } vertex; KITC_DECL_TYPED_ARRAY(vertex) @@ -128,7 +134,6 @@ typedef struct model { /* ral.h */ - // command buffer gubbins /* --- Backends */ diff --git a/src/renderer/render_types.h b/src/renderer/render_types.h index 387ac81..3bce88f 100644 --- a/src/renderer/render_types.h +++ b/src/renderer/render_types.h @@ -76,7 +76,8 @@ typedef struct texture { // bool is_loaded; // bool is_uploaded; // } blinn_phong_material; -// typedef blinn_phong_material material; // when we start using PBR, this will no longer be the case +// typedef blinn_phong_material material; // when we start using PBR, this will no longer be the +// case // // the default blinn-phong material. MUST be initialised with the function below // extern material DEFAULT_MATERIAL; diff --git a/src/std/containers/graphs.h b/src/std/containers/graphs.h index 47399e9..5dbec97 100644 --- a/src/std/containers/graphs.h +++ b/src/std/containers/graphs.h @@ -1,15 +1,14 @@ /** * @file graphs.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ - // Adjacency list backed graphs // Matrix backed graphs (not as useful) \ No newline at end of file diff --git a/src/std/containers/hashset.h b/src/std/containers/hashset.h index f8e7073..d153fd2 100644 --- a/src/std/containers/hashset.h +++ b/src/std/containers/hashset.h @@ -1,10 +1,10 @@ /** * @file hashset.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ \ No newline at end of file diff --git a/src/std/containers/hashtable.h b/src/std/containers/hashtable.h index c93dc19..f5d98e7 100644 --- a/src/std/containers/hashtable.h +++ b/src/std/containers/hashtable.h @@ -1,10 +1,10 @@ /** * @file hashtable.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ \ No newline at end of file diff --git a/src/systems/physics.h b/src/systems/physics.h index 5c96c6e..61d2008 100644 --- a/src/systems/physics.h +++ b/src/systems/physics.h @@ -15,7 +15,7 @@ enum collider_type { /** @brief generic collider structure */ typedef struct physics_collider { - u64 id; // ? Replace with handle? + u64 id; // ? Replace with handle? enum collider_type shape; transform transform; u8 layer; diff --git a/src/systems/terrain.h b/src/systems/terrain.h index 96875d9..6558202 100644 --- a/src/systems/terrain.h +++ b/src/systems/terrain.h @@ -1,19 +1,46 @@ /** * @file terrain.h * @author your name (you@domain.com) - * @brief + * @brief * @version 0.1 * @date 2024-04-27 - * + * * @copyright Copyright (c) 2024 - * + * */ +/* +Future: + - Chunked terrain + - Dynamic LOD +*/ + +#include "cleanroom/types.h" #include "defines.h" +#include "maths_types.h" +#include "mem.h" typedef struct terrain_state { - } terrain_state; +typedef struct heightmap { + u32x2 size; + void* image_data; +} heightmap; + bool terrain_system_init(terrain_state* state); -void terrain_system_shutdown(terrain_state* state); \ No newline at end of file +void terrain_system_shutdown(terrain_state* state); +void terrain_system_render_hmap(renderer* rend, terrain_state* state); + +heightmap heightmap_from_image(const char* filepath); +heightmap heightmap_from_perlin(/* TODO: perlin noise generation parameters */); + +/** @brief Get the height (the Y component) for a vertex at a particular coordinate in the heightmap + */ +f32 heightmap_height_at_xz(heightmap* hmap, f32 x, f32 z); + +/** @brief Calculate the normal vector of a vertex at a particular coordinate in the heightmap */ +vec3 heightmap_normal_at_xz(heightmap* hmap, f32 x, f32 z); + +/** @brief Generate the `geometry_data` for a heightmap ready to be uploaded to the GPU */ +geometry_data geo_heightmap(arena* a, heightmap heightmap); \ No newline at end of file diff --git a/src/systems/text.h b/src/systems/text.h index 4fac0b8..dc396f0 100644 --- a/src/systems/text.h +++ b/src/systems/text.h @@ -8,8 +8,8 @@ #include "cleanroom/types.h" #include "darray.h" #include "defines.h" -#include "render_types.h" #include "ral.h" +#include "render_types.h" struct core; diff --git a/src/transform_hierarchy.h b/src/transform_hierarchy.h index d77b846..0921c19 100644 --- a/src/transform_hierarchy.h +++ b/src/transform_hierarchy.h @@ -4,8 +4,8 @@ #pragma once #include "maths_types.h" -#include "render_types.h" #include "ral.h" +#include "render_types.h" #define MAX_TF_NODE_CHILDREN \ 32 /** TEMP: Make it simpler to manage children in `transform_node`s */ -- cgit v1.2.3-70-g09d2 From 74fd8a8424aeaccfaf7985f4ad2129fd54ae9fba Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 4 May 2024 13:02:31 +1000 Subject: swapchain support --- src/renderer/backends/backend_opengl.c | 2 - src/renderer/backends/backend_vulkan.c | 22 ++++- src/renderer/backends/vulkan_helpers.h | 173 ++++++++++++++++----------------- src/systems/text.h | 1 - 4 files changed, 104 insertions(+), 94 deletions(-) (limited to 'src/systems/text.h') diff --git a/src/renderer/backends/backend_opengl.c b/src/renderer/backends/backend_opengl.c index 7fc277f..4cd97b5 100644 --- a/src/renderer/backends/backend_opengl.c +++ b/src/renderer/backends/backend_opengl.c @@ -6,8 +6,6 @@ #include "file.h" #include "log.h" #include "maths_types.h" -// #include "render_types.h" -#include "cleanroom/types.h" #include "ral.h" #if CEL_REND_BACKEND_OPENGL diff --git a/src/renderer/backends/backend_vulkan.c b/src/renderer/backends/backend_vulkan.c index 900b592..08e62bf 100644 --- a/src/renderer/backends/backend_vulkan.c +++ b/src/renderer/backends/backend_vulkan.c @@ -26,6 +26,7 @@ typedef struct vulkan_context { VkInstance instance; VkAllocationCallbacks* allocator; VkSurfaceKHR surface; + vulkan_swapchain_support_info swapchain_support; arena temp_arena; gpu_device* device; @@ -181,6 +182,9 @@ bool gpu_device_create(gpu_device* out_device) { } TRACE("Physical device selected"); + // vulkan_device_query_swapchain_support(out_device->physical_device, context.surface, + // &context.swapchain_support); + // Logical device create_logical_device(out_device); // VkDeviceQueueCreateInfo queue_create_info = {}; @@ -432,6 +436,10 @@ bool select_physical_device(gpu_device* out_device) { return false; } + vkGetPhysicalDeviceProperties(out_device->physical_device, &out_device->properties); + vkGetPhysicalDeviceFeatures(out_device->physical_device, &out_device->features); + vkGetPhysicalDeviceMemoryProperties(out_device->physical_device, &out_device->memory); + return true; } @@ -449,7 +457,10 @@ bool is_physical_device_suitable(VkPhysicalDevice device) { queue_family_indices indices = find_queue_families(device); - return indices.has_graphics && indices.has_present; + vulkan_device_query_swapchain_support(device, context.surface, &context.swapchain_support); + + return indices.has_graphics && indices.has_present && context.swapchain_support.mode_count > 0 && + context.swapchain_support.format_count > 0; } queue_family_indices find_queue_families(VkPhysicalDevice device) { @@ -480,8 +491,17 @@ queue_family_indices find_queue_families(VkPhysicalDevice device) { return indices; } +const char* bool_str(bool input) { return input ? "True" : "False"; } + bool create_logical_device(gpu_device* out_device) { queue_family_indices indices = find_queue_families(out_device->physical_device); + INFO(" %s | %s | %s | %s | %s", bool_str(indices.has_graphics), bool_str(indices.has_present), + bool_str(indices.has_compute), bool_str(indices.has_transfer), + out_device->properties.deviceName); + TRACE("Graphics Family queue index: %d", indices.graphics_family_index); + TRACE("Present Family queue index: %d", indices.present_family_index); + TRACE("Compute Family queue index: %d", indices.compute_family_index); + TRACE("Transfer Family queue index: %d", indices.transfer_family_index); // Queues f32 prio_one = 1.0; diff --git a/src/renderer/backends/vulkan_helpers.h b/src/renderer/backends/vulkan_helpers.h index d91b4a9..03ee814 100644 --- a/src/renderer/backends/vulkan_helpers.h +++ b/src/renderer/backends/vulkan_helpers.h @@ -40,13 +40,6 @@ typedef struct vulkan_physical_device_requirements { bool discrete_gpu; } vulkan_physical_device_requirements; -typedef struct vulkan_physical_device_queue_family_info { - u32 graphics_family_index; - u32 present_family_index; - u32 compute_family_index; - u32 transfer_family_index; -} vulkan_physical_device_queue_family_info; - #define VULKAN_MAX_DEFAULT 32 typedef struct vulkan_swapchain_support_info { @@ -85,89 +78,89 @@ void vulkan_device_query_swapchain_support(VkPhysicalDevice device, VkSurfaceKHR } } -static bool physical_device_meets_requirements( - VkPhysicalDevice device, VkSurfaceKHR surface, const VkPhysicalDeviceProperties* properties, - const VkPhysicalDeviceFeatures* features, - const vulkan_physical_device_requirements* requirements, - vulkan_physical_device_queue_family_info* out_queue_info, - vulkan_swapchain_support_info* out_swapchain_support) { - // TODO: pass in an arena - - out_queue_info->graphics_family_index = -1; - out_queue_info->present_family_index = -1; - out_queue_info->compute_family_index = -1; - out_queue_info->transfer_family_index = -1; - - if (requirements->discrete_gpu) { - if (properties->deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { - TRACE("Device is not a physical GPU. Skipping."); - return false; - } - } - - u32 queue_family_count = 0; - vkGetPhysicalDeviceQueueFamilyProperties(device, &queue_family_count, 0); - VkQueueFamilyProperties queue_families[queue_family_count]; - vkGetPhysicalDeviceQueueFamilyProperties(device, &queue_family_count, queue_families); - - INFO("Graphics | Present | Compute | Transfer | Name"); - u8 min_transfer_score = 255; - for (u32 i = 0; i < queue_family_count; i++) { - u8 current_transfer_score = 0; - - // Graphics queue - if (queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) { - out_queue_info->graphics_family_index = i; - current_transfer_score++; - } - - // Compute queue - if (queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) { - out_queue_info->compute_family_index = i; - current_transfer_score++; - } - - // Transfer queue - if (queue_families[i].queueFlags & VK_QUEUE_TRANSFER_BIT) { - // always take the lowest score transfer index - if (current_transfer_score <= min_transfer_score) { - min_transfer_score = current_transfer_score; - out_queue_info->transfer_family_index = i; - } - } - - // Present Queue - VkBool32 supports_present = VK_FALSE; - vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &supports_present); - if (supports_present) { - out_queue_info->present_family_index = i; - } - } - - INFO(" %d | %d | %d | %d | %s", - out_queue_info->graphics_family_index != -1, out_queue_info->present_family_index != -1, - out_queue_info->compute_family_index != -1, out_queue_info->transfer_family_index != -1, - properties->deviceName); - TRACE("Graphics Family queue index: %d", out_queue_info->graphics_family_index); - TRACE("Present Family queue index: %d", out_queue_info->present_family_index); - TRACE("Compute Family queue index: %d", out_queue_info->compute_family_index); - TRACE("Transfer Family queue index: %d", out_queue_info->transfer_family_index); - - if ((!requirements->graphics || - (requirements->graphics && out_queue_info->graphics_family_index != -1))) { - INFO("Physical device meets our requirements! Proceed."); - - vulkan_device_query_swapchain_support( - device, surface, out_swapchain_support - - // TODO: error handling i.e. format count = 0 or present mode = 0 - - ); - return true; - } - - return false; -} +// static bool physical_device_meets_requirements( +// VkPhysicalDevice device, VkSurfaceKHR surface, const VkPhysicalDeviceProperties* properties, +// const VkPhysicalDeviceFeatures* features, +// const vulkan_physical_device_requirements* requirements, +// vulkan_physical_device_queue_family_info* out_queue_info, +// vulkan_swapchain_support_info* out_swapchain_support) { +// // TODO: pass in an arena + +// out_queue_info->graphics_family_index = -1; +// out_queue_info->present_family_index = -1; +// out_queue_info->compute_family_index = -1; +// out_queue_info->transfer_family_index = -1; + +// if (requirements->discrete_gpu) { +// if (properties->deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { +// TRACE("Device is not a physical GPU. Skipping."); +// return false; +// } +// } + +// u32 queue_family_count = 0; +// vkGetPhysicalDeviceQueueFamilyProperties(device, &queue_family_count, 0); +// VkQueueFamilyProperties queue_families[queue_family_count]; +// vkGetPhysicalDeviceQueueFamilyProperties(device, &queue_family_count, queue_families); + +// INFO("Graphics | Present | Compute | Transfer | Name"); +// u8 min_transfer_score = 255; +// for (u32 i = 0; i < queue_family_count; i++) { +// u8 current_transfer_score = 0; + +// // Graphics queue +// if (queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) { +// out_queue_info->graphics_family_index = i; +// current_transfer_score++; +// } + +// // Compute queue +// if (queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) { +// out_queue_info->compute_family_index = i; +// current_transfer_score++; +// } + +// // Transfer queue +// if (queue_families[i].queueFlags & VK_QUEUE_TRANSFER_BIT) { +// // always take the lowest score transfer index +// if (current_transfer_score <= min_transfer_score) { +// min_transfer_score = current_transfer_score; +// out_queue_info->transfer_family_index = i; +// } +// } + +// // Present Queue +// VkBool32 supports_present = VK_FALSE; +// vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &supports_present); +// if (supports_present) { +// out_queue_info->present_family_index = i; +// } +// } + +// INFO(" %d | %d | %d | %d | %s", +// out_queue_info->graphics_family_index != -1, out_queue_info->present_family_index != -1, +// out_queue_info->compute_family_index != -1, out_queue_info->transfer_family_index != -1, +// properties->deviceName); +// TRACE("Graphics Family queue index: %d", out_queue_info->graphics_family_index); +// TRACE("Present Family queue index: %d", out_queue_info->present_family_index); +// TRACE("Compute Family queue index: %d", out_queue_info->compute_family_index); +// TRACE("Transfer Family queue index: %d", out_queue_info->transfer_family_index); + +// if ((!requirements->graphics || +// (requirements->graphics && out_queue_info->graphics_family_index != -1))) { +// INFO("Physical device meets our requirements! Proceed."); + +// vulkan_device_query_swapchain_support( +// device, surface, out_swapchain_support + +// // TODO: error handling i.e. format count = 0 or present mode = 0 + +// ); +// return true; +// } + +// return false; +// } VKAPI_ATTR VkBool32 VKAPI_CALL vk_debug_callback( VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT flags, diff --git a/src/systems/text.h b/src/systems/text.h index dc396f0..f40cfd6 100644 --- a/src/systems/text.h +++ b/src/systems/text.h @@ -5,7 +5,6 @@ #include -#include "cleanroom/types.h" #include "darray.h" #include "defines.h" #include "ral.h" -- cgit v1.2.3-70-g09d2