Drawable Renderer (#1570), warnings
This commit is contained in:
committed by
Bart Louwers
parent
7dc90ae627
commit
81461bc357
@@ -14,5 +14,12 @@ MBGL_CONSTEXPR std::array<To, Size> convert(const std::array<From, Size>& from)
|
||||
return to;
|
||||
}
|
||||
|
||||
template <typename To, typename From, std::size_t Size, typename = std::enable_if_t<std::is_assignable_v<To&, From>>>
|
||||
MBGL_CONSTEXPR std::array<To, Size> cast(const std::array<From, Size>& from) {
|
||||
std::array<To, Size> to{{}};
|
||||
std::transform(std::begin(from), std::end(from), std::begin(to), [](From x){ return static_cast<To>(x); });
|
||||
return to;
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -241,7 +241,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
|
||||
}
|
||||
|
||||
gfx::DrawableUBO drawableUBO;
|
||||
drawableUBO.matrix = util::convert<float>(matrix);
|
||||
drawableUBO.matrix = util::cast<float>(matrix);
|
||||
auto uniformBuffer = context.createUniformBuffer(&drawableUBO, sizeof(drawableUBO));
|
||||
drawable.mutableUniformBuffers().addOrReplace("DrawableUBO", uniformBuffer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user