Presumably the texture author knows which colorspace the texture uses.
In particular this made it impossible to load non-color textures such
as normal maps which require a linear colorspace if the srgb flag was
set in the containing resource collection.
void Texture1D::Loader::storage(PixelFormat fmt, unsigned w)
{
- if(srgb)
- fmt = get_srgb_pixelformat(fmt);
obj.storage(fmt, w);
}
void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h)
{
- if(srgb)
- fmt = get_srgb_pixelformat(fmt);
obj.storage(fmt, w, h);
}
void Texture3D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned d)
{
- if(srgb)
- fmt = get_srgb_pixelformat(fmt);
obj.storage(fmt, w, h, d);
}
void TextureCube::Loader::storage(PixelFormat fmt, unsigned s)
{
- if(srgb)
- fmt = get_srgb_pixelformat(fmt);
obj.storage(fmt, s);
}