From ee0b68588c7de1c42ed0d9fc4d77f7a5faaf92fc Mon Sep 17 00:00:00 2001 From: Lillian Salehi Date: Sun, 6 Oct 2024 04:52:10 -0500 Subject: [PATCH] Update Documentation and remove duplicate includes caused by global headers --- src/DeviceLibrary.cpp | 4 ++-- src/debug/VulkanDebugLibs.cpp | 10 +++------- src/global.h | 2 ++ src/main.cpp | 4 +--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/DeviceLibrary.cpp b/src/DeviceLibrary.cpp index cde17ee..422d726 100644 --- a/src/DeviceLibrary.cpp +++ b/src/DeviceLibrary.cpp @@ -112,6 +112,7 @@ namespace DeviceControl { void DeviceLibrary::createLogicalDevice(VkDevice& device) { // Describe how many queues we want for a single family (1) here, right now we are solely interested in graphics capabilites, // but Compute Shaders, transfer ops, decode and encode operations can also queued with setup! We also assign each queue a priority. + // We do this by looping over all the queueFamilies and sorting them by indices to fill the queue at the end! QueueFamilyIndices indices = findQueueFamilies(physicalDevice); std::vector queueCreateInfos; @@ -130,11 +131,10 @@ namespace DeviceControl { queueCreateInfos.push_back(queueCreateSingularInfo); } VkDeviceCreateInfo createDeviceInfo = {}; - VkPhysicalDeviceFeatures emptyFeatures = {}; createDeviceInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; createDeviceInfo.pQueueCreateInfos = queueCreateInfos.data(); createDeviceInfo.queueCreateInfoCount = static_cast(queueCreateInfos.size()); - createDeviceInfo.pEnabledFeatures = &emptyFeatures; + createDeviceInfo.pEnabledFeatures = &deviceFeatures; createDeviceInfo.enabledExtensionCount = 0; diff --git a/src/debug/VulkanDebugLibs.cpp b/src/debug/VulkanDebugLibs.cpp index 746d859..d3ba2c6 100644 --- a/src/debug/VulkanDebugLibs.cpp +++ b/src/debug/VulkanDebugLibs.cpp @@ -1,14 +1,10 @@ -#include -#include -#include -#define GLFW_INCLUDE_VULKAN -#include - #include "../global.h" using namespace Debug; +#include +#include +#include #include -#include // This is our messenger object! It handles passing along debug messages to the debug callback we will also set. VkDebugUtilsMessengerEXT debugMessenger; diff --git a/src/global.h b/src/global.h index f6436d0..7fd8fef 100644 --- a/src/global.h +++ b/src/global.h @@ -8,6 +8,8 @@ #include namespace Global { + // Global variables and includes we are going to use almost everywhere, validation layers hook into everything, and you need to check if they are enabled first, + // so that's one obvious global, as well as the glfw includes! extern const std::vector validationLayers; extern const bool enableValidationLayers; } diff --git a/src/main.cpp b/src/main.cpp index d69a3a6..ca3d572 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,6 @@ +#include "DeviceLibrary.h" // Device Library includes global, redundant to include with it here #include "debug/VulkanDebugLibs.h" -#include "DeviceLibrary.h" -#include "debug/VulkanDebugLibs.h" -#include "global.h" #include #include