Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type fixes #333

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/VkBootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ uint32_t get_dedicated_queue_index(
uint32_t get_present_queue_index(
VkPhysicalDevice const phys_device, VkSurfaceKHR const surface, std::vector<VkQueueFamilyProperties> const& families) {
for (uint32_t i = 0; i < static_cast<uint32_t>(families.size()); i++) {
VkBool32 presentSupport = false;
VkBool32 presentSupport = VK_FALSE;
if (surface != VK_NULL_HANDLE) {
VkResult res = detail::vulkan_functions().fp_vkGetPhysicalDeviceSurfaceSupportKHR(phys_device, i, surface, &presentSupport);
if (res != VK_SUCCESS) return QUEUE_INDEX_MAX_VALUE; // TODO: determine if this should fail another way
Expand Down
12 changes: 6 additions & 6 deletions src/VkBootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class PhysicalDeviceSelector;
struct Instance {
VkInstance instance = VK_NULL_HANDLE;
VkDebugUtilsMessengerEXT debug_messenger = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;
PFN_vkGetInstanceProcAddr fp_vkGetInstanceProcAddr = nullptr;
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;

Expand Down Expand Up @@ -474,7 +474,7 @@ class InstanceBuilder {
std::vector<VkValidationFeatureDisableEXT> disabled_validation_features;

// Custom allocator
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;

bool request_validation_layers = false;
bool enable_validation_layers = false;
Expand Down Expand Up @@ -752,7 +752,7 @@ struct Device {
PhysicalDevice physical_device;
VkSurfaceKHR surface = VK_NULL_HANDLE;
std::vector<VkQueueFamilyProperties> queue_families;
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;
uint32_t instance_version = VKB_VK_API_VERSION_1_0;

Expand Down Expand Up @@ -817,7 +817,7 @@ class DeviceBuilder {
VkDeviceCreateFlags flags = static_cast<VkDeviceCreateFlags>(0);
std::vector<VkBaseOutStructure*> pNext_chain;
std::vector<CustomQueueDescription> queue_descriptions;
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;
} info;
};

Expand All @@ -834,7 +834,7 @@ struct Swapchain {
uint32_t requested_min_image_count = 0;
VkPresentModeKHR present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR; // The present mode actually used when creating the swapchain.
uint32_t instance_version = VKB_VK_API_VERSION_1_0;
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;

// Returns a vector of VkImage handles to the swapchain.
Result<std::vector<VkImage>> get_images();
Expand Down Expand Up @@ -992,7 +992,7 @@ class SwapchainBuilder {
std::vector<VkPresentModeKHR> desired_present_modes;
bool clipped = true;
VkSwapchainKHR old_swapchain = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
VkAllocationCallbacks* allocation_callbacks = nullptr;
} info;
};

Expand Down