mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-10 10:51:49 +00:00
Fix a few nits
This commit is contained in:
parent
0408041547
commit
8922a41bd4
@ -205,7 +205,7 @@ auto get_vector(std::vector<T>& out, F&& f, Ts&&... ts) -> VkResult {
|
|||||||
VkResult err;
|
VkResult err;
|
||||||
do {
|
do {
|
||||||
err = f(ts..., &count, nullptr);
|
err = f(ts..., &count, nullptr);
|
||||||
if (err) {
|
if (err != VK_SUCCESS) {
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
out.resize(count);
|
out.resize(count);
|
||||||
@ -229,13 +229,13 @@ auto get_vector_noerror(F&& f, Ts&&... ts) -> std::vector<T> {
|
|||||||
|
|
||||||
const char* to_string_message_severity(VkDebugUtilsMessageSeverityFlagBitsEXT s) {
|
const char* to_string_message_severity(VkDebugUtilsMessageSeverityFlagBitsEXT s) {
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case VkDebugUtilsMessageSeverityFlagBitsEXT::VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
||||||
return "VERBOSE";
|
return "VERBOSE";
|
||||||
case VkDebugUtilsMessageSeverityFlagBitsEXT::VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
case VkDebugUtilsMessageSeverityFlagBitsEXT::VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
||||||
return "WARNING";
|
return "WARNING";
|
||||||
case VkDebugUtilsMessageSeverityFlagBitsEXT::VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
|
||||||
return "INFO";
|
return "INFO";
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
@ -1111,7 +1111,7 @@ PhysicalDeviceSelector::Suitable PhysicalDeviceSelector::is_device_suitable(Phys
|
|||||||
bool has_required_memory = false;
|
bool has_required_memory = false;
|
||||||
bool has_preferred_memory = false;
|
bool has_preferred_memory = false;
|
||||||
for (uint32_t i = 0; i < pd.mem_properties.memoryHeapCount; i++) {
|
for (uint32_t i = 0; i < pd.mem_properties.memoryHeapCount; i++) {
|
||||||
if (pd.mem_properties.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) {
|
if (pd.mem_properties.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) {
|
||||||
if (pd.mem_properties.memoryHeaps[i].size > criteria.required_mem_size) {
|
if (pd.mem_properties.memoryHeaps[i].size > criteria.required_mem_size) {
|
||||||
has_required_memory = true;
|
has_required_memory = true;
|
||||||
}
|
}
|
||||||
@ -1140,8 +1140,9 @@ detail::Result<PhysicalDevice> PhysicalDeviceSelector::select() const {
|
|||||||
|
|
||||||
#if !defined(NDEBUG)
|
#if !defined(NDEBUG)
|
||||||
// Validation
|
// Validation
|
||||||
for(const auto& node : criteria.extended_features_chain) {
|
for (const auto& node : criteria.extended_features_chain) {
|
||||||
assert(node.sType != 0 && "Features struct sType must be filled with the struct's "
|
assert(node.sType != static_cast<VkStructureType>(0) &&
|
||||||
|
"Features struct sType must be filled with the struct's "
|
||||||
"corresponding VkStructureType enum");
|
"corresponding VkStructureType enum");
|
||||||
assert(
|
assert(
|
||||||
node.sType != VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 &&
|
node.sType != VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 &&
|
||||||
|
@ -121,8 +121,7 @@ struct GenericFeaturesPNextNode {
|
|||||||
|
|
||||||
GenericFeaturesPNextNode();
|
GenericFeaturesPNextNode();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> GenericFeaturesPNextNode(T const& features) noexcept {
|
||||||
GenericFeaturesPNextNode(T const& features) noexcept {
|
|
||||||
*reinterpret_cast<T*>(this) = features;
|
*reinterpret_cast<T*>(this) = features;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +348,7 @@ class InstanceBuilder {
|
|||||||
// VkInstanceCreateInfo
|
// VkInstanceCreateInfo
|
||||||
std::vector<const char*> layers;
|
std::vector<const char*> layers;
|
||||||
std::vector<const char*> extensions;
|
std::vector<const char*> extensions;
|
||||||
VkInstanceCreateFlags flags = 0;
|
VkInstanceCreateFlags flags = static_cast<VkInstanceCreateFlags>(0);
|
||||||
std::vector<VkBaseOutStructure*> pNext_elements;
|
std::vector<VkBaseOutStructure*> pNext_elements;
|
||||||
|
|
||||||
// debug callback - use the default so it is not nullptr
|
// debug callback - use the default so it is not nullptr
|
||||||
@ -640,7 +639,7 @@ class DeviceBuilder {
|
|||||||
private:
|
private:
|
||||||
PhysicalDevice physical_device;
|
PhysicalDevice physical_device;
|
||||||
struct DeviceInfo {
|
struct DeviceInfo {
|
||||||
VkDeviceCreateFlags flags = 0;
|
VkDeviceCreateFlags flags = static_cast<VkDeviceCreateFlags>(0);
|
||||||
std::vector<VkBaseOutStructure*> pNext_chain;
|
std::vector<VkBaseOutStructure*> pNext_chain;
|
||||||
std::vector<CustomQueueDescription> queue_descriptions;
|
std::vector<CustomQueueDescription> queue_descriptions;
|
||||||
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
||||||
|
Loading…
Reference in New Issue
Block a user