Fix gfx::memory_usage(texture)
This commit is contained in:
parent
c639e533fe
commit
23f818078f
1 changed files with 4 additions and 1 deletions
|
|
@ -610,7 +610,10 @@ namespace psemek::gfx
|
||||||
template <std::size_t D, GLenum Target>
|
template <std::size_t D, GLenum Target>
|
||||||
std::size_t memory_usage(basic_texture<D, Target> const & texture)
|
std::size_t memory_usage(basic_texture<D, Target> const & texture)
|
||||||
{
|
{
|
||||||
return texture.width() * texture.height() * texture.depth() * pixel_size(texture.internal_format());
|
auto size = texture.width() * texture.height() * texture.depth();
|
||||||
|
if (size == 0)
|
||||||
|
return 0;
|
||||||
|
return size * pixel_size(texture.internal_format());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue