10 #include <type_traits>
12 #include "flutter/fml/macros.h"
20 class HostBuffer final :
public std::enable_shared_from_this<HostBuffer>,
24 static std::shared_ptr<HostBuffer>
Create();
41 template <
class UniformType,
42 class = std::enable_if_t<std::is_standard_layout_v<UniformType>>>
44 const auto alignment =
46 return Emplace(
reinterpret_cast<const void*
>(&uniform),
63 class StorageBufferType,
64 class = std::enable_if_t<std::is_standard_layout_v<StorageBufferType>>>
66 const StorageBufferType& buffer) {
67 const auto alignment =
70 sizeof(StorageBufferType),
85 template <
class BufferType,
86 class = std::enable_if_t<std::is_standard_layout_v<BufferType>>>
88 return Emplace(
reinterpret_cast<const void*
>(&buffer),
124 mutable std::shared_ptr<DeviceBuffer> device_buffer_;
125 mutable size_t device_buffer_generation_ = 0u;
126 size_t generation_ = 1u;
130 std::shared_ptr<const DeviceBuffer> GetDeviceBuffer(