Browse Source

Vk: GCC 4.8, stop it, it's not Monday today.

pull/234/head
Vladimír Vondruš 6 years ago
parent
commit
55ec24062d
  1. 13
      src/Magnum/Vk/Device.cpp
  2. 9
      src/Magnum/Vk/Enums.cpp
  3. 13
      src/Magnum/Vk/Instance.cpp

13
src/Magnum/Vk/Device.cpp

@ -119,7 +119,10 @@ DeviceCreateInfo::DeviceCreateInfo(Instance& instance, const Flags flags): Devic
DeviceCreateInfo::DeviceCreateInfo(NoInitT) noexcept {}
DeviceCreateInfo::DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& info): _physicalDevice{physicalDevice}, _info{info} {}
DeviceCreateInfo::DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& info): _physicalDevice{physicalDevice},
/* Can't use {} with GCC 4.8 here because it tries to initialize the first
member instead of doing a copy */
_info(info) {}
DeviceCreateInfo::~DeviceCreateInfo() = default;
@ -308,7 +311,13 @@ Device::Device(Instance& instance, const DeviceCreateInfo& info):
Device::Device(NoCreateT): _handle{}, _functionPointers{} {}
Device::Device(Device&& other) noexcept: _handle{other._handle}, _flags{other._flags}, _version{other._version}, _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, _functionPointers{other._functionPointers} {
Device::Device(Device&& other) noexcept: _handle{other._handle},
_flags{other._flags}, _version{other._version},
_extensionStatus{other._extensionStatus}, _state{std::move(other._state)},
/* Can't use {} with GCC 4.8 here because it tries to initialize the first
member instead of doing a copy */
_functionPointers(other._functionPointers)
{
other._handle = nullptr;
other._functionPointers = {};
}

9
src/Magnum/Vk/Enums.cpp

@ -59,24 +59,27 @@ constexpr VkIndexType IndexTypeMapping[]{
static_assert(VK_FORMAT_UNDEFINED == 0, "VK_FORMAT_UNDEFINED is assumed to be 0");
constexpr VkFormat VertexFormatMapping[] {
/* GCC 4.8 doesn't like just a {} for default enum values */
#define _c(input, format) VK_FORMAT_ ## format,
#define _s(input) {},
#define _s(input) VkFormat{},
#include "Magnum/Vk/Implementation/vertexFormatMapping.hpp"
#undef _s
#undef _c
};
constexpr VkFormat PixelFormatMapping[] {
/* GCC 4.8 doesn't like just a {} for default enum values */
#define _c(input, format) VK_FORMAT_ ## format,
#define _s(input) {},
#define _s(input) VkFormat{},
#include "Magnum/Vk/Implementation/pixelFormatMapping.hpp"
#undef _s
#undef _c
};
constexpr VkFormat CompressedPixelFormatMapping[] {
/* GCC 4.8 doesn't like just a {} for default enum values */
#define _c(input, format) VK_FORMAT_ ## format,
#define _s(input) {},
#define _s(input) VkFormat{},
#include "Magnum/Vk/Implementation/compressedPixelFormatMapping.hpp"
#undef _s
#undef _c

13
src/Magnum/Vk/Instance.cpp

@ -142,7 +142,10 @@ InstanceCreateInfo::InstanceCreateInfo(const Int argc, const char** const argv,
InstanceCreateInfo::InstanceCreateInfo(NoInitT) noexcept {}
InstanceCreateInfo::InstanceCreateInfo(const VkInstanceCreateInfo& info): _info{info} {}
InstanceCreateInfo::InstanceCreateInfo(const VkInstanceCreateInfo& info):
/* Can't use {} with GCC 4.8 here because it tries to initialize the first
member instead of doing a copy */
_info(info) {}
InstanceCreateInfo::~InstanceCreateInfo() = default;
@ -300,7 +303,13 @@ Instance::Instance(const InstanceCreateInfo& info): _flags{HandleFlag::DestroyOn
Instance::Instance(NoCreateT): _handle{}, _functionPointers{} {}
Instance::Instance(Instance&& other) noexcept: _handle{other._handle}, _flags{other._flags}, _version{other._version}, _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, _functionPointers{other._functionPointers} {
Instance::Instance(Instance&& other) noexcept: _handle{other._handle},
_flags{other._flags}, _version{other._version},
_extensionStatus{other._extensionStatus}, _state{std::move(other._state)},
/* Can't use {} with GCC 4.8 here because it tries to initialize the first
member instead of doing a copy */
_functionPointers(other._functionPointers)
{
other._handle = nullptr;
other._functionPointers = {};
}

Loading…
Cancel
Save