11 std::uint32_t _textureFlags)
13 std::make_shared<texture>(_width, _height,
false, 1, _format, _textureFlags),
36 cached_size_ = {_width, _height};
41 std::vector<fbo_attachment> attachments;
42 attachments.reserve(textures.size());
43 for(
const auto& tex : textures)
45 attachments.emplace_back();
46 auto& back = attachments.back();
48 back.generate_mips = tex->info.format < texture_format::UnknownDepth;
56 std::vector<attachment> buffer;
57 buffer.reserve(textures.size());
60 for(
const auto& tex : textures)
62 size = {tex.texture->info.width, tex.texture->info.height};
64 buffer.emplace_back();
65 auto& att = buffer.back();
66 att.init(tex.texture->native_handle(), access::Write, tex.layer, 1, tex.mip, (tex.generate_mips ? BGFX_RESOLVE_AUTO_GEN_MIPS : BGFX_RESOLVE_NONE));
82 return textures_[
index];
93 return get_attachment(
index).texture;
98 return textures_.size();
frame_buffer_handle handle_
std::shared_ptr< texture > ptr
bgfx::TextureFormat::Enum texture_format
frame_buffer_handle create_frame_buffer(uint16_t _width, uint16_t _height, texture_format _format, uint64_t _textureFlags)
Hash specialization for batch_key to enable use in std::unordered_map.
auto get_texture(std::uint32_t index=0) const -> const gfx::texture::ptr &
auto get_attachment_count() const -> size_t
auto get_attachments() const -> const std::vector< fbo_attachment > &
void populate(const std::vector< texture::ptr > &textures)
auto get_attachment(std::uint32_t index=0) const -> const fbo_attachment &
auto get_size() const -> usize32_t