Skip to content

Commit 2a18620

Browse files
authored
Merge branch 'master' into extract_selectDeviceMemoryType
2 parents 94bfb2d + 46c89ff commit 2a18620

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

modules/magma/Buffer.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ namespace magma
1515
{
1616
return Buffer<>(Deleter{magma::Device<claws::no_delete>(*this)},
1717
vk::Device::createBuffer(
18-
{flags, size, usage, vk::SharingMode::eExclusive, static_cast<uint32_t>(queueFamilies.size()), queueFamilies.data()}));
18+
{flags, size, usage, vk::SharingMode::eConcurrent, static_cast<uint32_t>(queueFamilies.size()), queueFamilies.data()}));
1919
}
2020

2121
inline auto impl::Device::createBuffer(vk::BufferCreateFlags flags, vk::DeviceSize size, vk::BufferUsageFlags usage) const
2222
{
2323
return Buffer<>(Deleter{magma::Device<claws::no_delete>(*this)},
24-
vk::Device::createBuffer({flags, size, usage, vk::SharingMode::eConcurrent, 0, nullptr}));
24+
vk::Device::createBuffer({flags, size, usage, vk::SharingMode::eExclusive, 0, nullptr}));
2525
}
2626
};

modules/magma/CreateInfo.hpp

+35
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,41 @@ namespace magma
8080
}
8181
};
8282

83+
///
84+
/// \brief Constructs a CreateInfo struct using the given arguments
85+
///
86+
/// If present, `stype` and `pnext` are auto-filled by vulkan-hpp, and should not be given
87+
/// Lists are automaticly decomposed into a (size, pointer) pair
88+
/// Supported list types are:
89+
/// - std::array
90+
/// - std::vector
91+
/// - magma::SingleValListRef (should be created using asListRef)
92+
/// - magma::EmptyList (passes (0, nullptr))
93+
///
94+
template<class CreateInfo, class... T>
95+
constexpr CreateInfo makeCreateInfo(T &&... args)
96+
{
97+
return StructBuilder<CreateInfo>::make(std::forward<T>(args)...);
98+
}
99+
100+
///
101+
/// \brief Constructs a CreateInfo struct using the given arguments
102+
///
103+
/// If present, `stype` and `pnext` are auto-filled by vulkan-hpp, and should not be given
104+
/// `flags` is set to `{}` (aka 0 in the C API) contrary to `magma::makeCreateInfo`
105+
/// Lists are automaticly decomposed into a (size, pointer) pair
106+
/// Supported list types are:
107+
/// - std::array
108+
/// - std::vector
109+
/// - magma::SingleValListRef (should be created using asListRef)
110+
/// - magma::EmptyList (passes (0, nullptr))
111+
///
112+
template<class CreateInfo, class... T>
113+
constexpr CreateInfo makeCreateInfoNoFlags(T &&... args)
114+
{
115+
return StructBuilder<CreateInfo, true>::make(std::forward<T>(args)...);
116+
}
117+
83118
template<class T>
84119
constexpr auto asListRef(T const &val) noexcept
85120
{

0 commit comments

Comments
 (0)