framebuffer_info.pAttachments = handle_cast<::VkImageView *>(vk_attachments);
framebuffer_info.width = self.width;
framebuffer_info.height = self.height;
- framebuffer_info.layers = 1;
+ framebuffer_info.layers = self.layers;
vk.CreateFramebuffer(framebuffer_info, handle);
{
unsigned w = 0;
unsigned h = 0;
+ unsigned l = 1;
if(const Texture2D *tex2d = dynamic_cast<const Texture2D *>(a.tex))
{
w = max(tex2d->get_width()>>a.level, 1U);
{
w = max(tex3d->get_width()>>a.level, 1U);
h = max(tex3d->get_height()>>a.level, 1U);
+ l = (a.layer<0 ? tex3d->get_depth() : 1);
}
else if(const TextureCube *tex_cube = dynamic_cast<const TextureCube *>(a.tex))
{
{
width = w;
height = h;
+ layers = l;
first = false;
}
else
{
width = min(width, w);
height = min(height, h);
+ layers = min(layers, l);
}
}
}
std::vector<Attachment> attachments;
unsigned width = 0;
unsigned height = 0;
+ unsigned layers = 0;
mutable unsigned dirty = 0;
Framebuffer(bool);
unsigned get_width() const { return width; }
unsigned get_height() const { return height; }
+ unsigned get_layers() const { return layers; }
protected:
void update() const;