Resolve warnings from gcc.

Resolves #505
This commit is contained in:
Andreas Süßenbach
2020-02-11 15:39:46 +01:00
committed by Markus Tavenrath
parent f1d3380e31
commit b08af45046
7 changed files with 134 additions and 123 deletions

View File

@@ -55,7 +55,7 @@ int main(int /*argc*/, char ** /*argv*/)
std::vector<vk::UniqueHandle<vk::CommandBuffer, vk::DispatchLoaderDynamic>>::allocator_type dynamicVectorAllocator;
vk::UniqueHandle<vk::CommandBuffer, vk::DispatchLoaderDynamic> dynamicCommandBuffer = std::move(device->allocateCommandBuffersUnique({}, dynamicVectorAllocator, vk::DispatchLoaderDynamic()).front());
}
catch (vk::SystemError err)
catch (vk::SystemError const& err)
{
std::cout << "vk::SystemError: " << err.what() << std::endl;
exit(-1);

View File

@@ -23,7 +23,7 @@
#include <iostream>
#include <map>
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE;
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
int main(int /*argc*/, char ** /*argv*/)
{
@@ -47,7 +47,7 @@ int main(int /*argc*/, char ** /*argv*/)
// function pointer specialization for device
VULKAN_HPP_DEFAULT_DISPATCHER.init(device);
}
catch (vk::SystemError err)
catch (vk::SystemError const& err)
{
std::cout << "vk::SystemError: " << err.what() << std::endl;
exit(-1);

View File

@@ -25,7 +25,7 @@
static char const* AppName = "NoExceptions";
static char const* EngineName = "Vulkan.hpp";
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE;
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
int main(int /*argc*/, char ** /*argv*/)
{

View File

@@ -31,7 +31,11 @@ static char const* EngineName = "Vulkan.hpp";
// unknow compiler... just ignore the warnings for yourselves ;)
#endif
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE;
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
template <typename T>
void unused(T const&)
{}
int main(int /*argc*/, char ** /*argv*/)
{
@@ -84,24 +88,31 @@ int main(int /*argc*/, char ** /*argv*/)
// simple calls, getting structure back
vk::PhysicalDeviceFeatures2 a = physicalDevice.getFeatures2();
unused(a);
// complex calls, getting StructureChain back
auto c = physicalDevice.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVariablePointerFeatures>();
vk::PhysicalDeviceFeatures2 & c0 = c.get<vk::PhysicalDeviceFeatures2>();
unused(c0);
auto t0 = c.get<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVariablePointerFeatures>();
unused(t0);
auto d = physicalDevice.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVariablePointerFeatures>();
vk::PhysicalDeviceFeatures2 & d0 = d.get<vk::PhysicalDeviceFeatures2>();
unused(d0);
vk::PhysicalDeviceVariablePointerFeatures & d1 = d.get<vk::PhysicalDeviceVariablePointerFeatures>();
unused(d1);
auto t1 = d.get<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVariablePointerFeatures>();
unused(t1);
using StructureChain = vk::StructureChain<vk::QueueFamilyProperties2, vk::QueueFamilyCheckpointPropertiesNV>;
using AllocatorType = std::vector<StructureChain>::allocator_type;
auto qfd = physicalDevice.getQueueFamilyProperties2<StructureChain, AllocatorType>(VULKAN_HPP_DEFAULT_DISPATCHER);
unused(qfd);
}
catch (vk::SystemError err)
catch (vk::SystemError const& err)
{
std::cout << "vk::SystemError: " << err.what() << std::endl;
exit(-1);

View File

@@ -19,7 +19,7 @@
#include "vulkan/vulkan.hpp"
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE;
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
#if defined(__x86_64__) || defined(_M_X64)
// On 32-bit systems the test is ambiguous.