Commit f89c2ca0 authored by Florian Oetke's avatar Florian Oetke
Browse files

fixed move operators

parent 308a750e
Pipeline #2688 passed with stage
in 9 minutes and 31 seconds
...@@ -56,7 +56,10 @@ namespace mirrage::graphic { ...@@ -56,7 +56,10 @@ namespace mirrage::graphic {
}; };
struct Image_dimensions { struct Image_dimensions {
Image_dimensions(std::int32_t width, std::int32_t height, std::int32_t depth, std::int32_t layers) Image_dimensions(std::int32_t width = 1,
std::int32_t height = 1,
std::int32_t depth = 1,
std::int32_t layers = 1)
: width(width), height(height), depth(depth), layers(layers) : width(width), height(height), depth(depth), layers(layers)
{ {
} }
...@@ -71,22 +74,28 @@ namespace mirrage::graphic { ...@@ -71,22 +74,28 @@ namespace mirrage::graphic {
template <> template <>
struct Image_dimensions_t<Image_type::single_1d> : Image_dimensions { struct Image_dimensions_t<Image_type::single_1d> : Image_dimensions {
Image_dimensions_t(std::int32_t width) : Image_dimensions(width, 1, 1, 1) {} Image_dimensions_t(std::int32_t width = 1) : Image_dimensions(width, 1, 1, 1) {}
}; };
template <> template <>
struct Image_dimensions_t<Image_type::single_2d> : Image_dimensions { struct Image_dimensions_t<Image_type::single_2d> : Image_dimensions {
Image_dimensions_t(std::int32_t width, std::int32_t height) : Image_dimensions(width, height, 1, 1) {} Image_dimensions_t(std::int32_t width = 1, std::int32_t height = 1)
: Image_dimensions(width, height, 1, 1)
{
}
}; };
template <> template <>
struct Image_dimensions_t<Image_type::array_2d> : Image_dimensions { struct Image_dimensions_t<Image_type::array_2d> : Image_dimensions {
Image_dimensions_t(std::int32_t width, std::int32_t height, std::int32_t layers) Image_dimensions_t(std::int32_t width = 1, std::int32_t height = 1, std::int32_t layers = 1)
: Image_dimensions(width, height, 1, layers) : Image_dimensions(width, height, 1, layers)
{ {
} }
}; };
template <> template <>
struct Image_dimensions_t<Image_type::cubemap> : Image_dimensions { struct Image_dimensions_t<Image_type::cubemap> : Image_dimensions {
Image_dimensions_t(std::int32_t width, std::int32_t height) : Image_dimensions(width, height, 1, 6) {} Image_dimensions_t(std::int32_t width = 1, std::int32_t height = 1)
: Image_dimensions(width, height, 1, 6)
{
}
}; };
...@@ -123,7 +132,7 @@ namespace mirrage::graphic { ...@@ -123,7 +132,7 @@ namespace mirrage::graphic {
private: private:
friend class Device; friend class Device;
const vk::Device& _device; const vk::Device* _device;
vk::UniqueFence _fence; vk::UniqueFence _fence;
Fence(const vk::Device& device, bool signaled); Fence(const vk::Device& device, bool signaled);
......
...@@ -30,14 +30,14 @@ namespace mirrage::graphic { ...@@ -30,14 +30,14 @@ namespace mirrage::graphic {
} }
Fence::operator bool() const { return _device.getFenceStatus(*_fence) == vk::Result::eSuccess; } Fence::operator bool() const { return _device->getFenceStatus(*_fence) == vk::Result::eSuccess; }
void Fence::reset() { _device.resetFences({*_fence}); } void Fence::reset() { _device->resetFences({*_fence}); }
void Fence::wait() { _device.waitForFences({*_fence}, true, std::numeric_limits<std::uint64_t>::max()); } void Fence::wait() { _device->waitForFences({*_fence}, true, std::numeric_limits<std::uint64_t>::max()); }
Fence::Fence(const vk::Device& device, bool signaled) Fence::Fence(const vk::Device& device, bool signaled)
: _device(device) : _device(&device)
, _fence(_device.createFenceUnique({signaled ? vk::FenceCreateFlags{vk::FenceCreateFlagBits::eSignaled} , _fence(_device->createFenceUnique({signaled ? vk::FenceCreateFlags{vk::FenceCreateFlagBits::eSignaled}
: vk::FenceCreateFlags{}})) : vk::FenceCreateFlags{}}))
{ {
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment