]> git.tdb.fi Git - libs/gl.git/commitdiff
Allow texture mipmap levels to be specified in datafiles
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2021 00:24:14 +0000 (02:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2021 00:36:53 +0000 (02:36 +0200)
This appears to have been missed in 03d3984 which removed the filtering
heuristic from storage/allocate.

source/texture1d.cpp
source/texture1d.h
source/texture2d.cpp
source/texture2d.h
source/texture3d.cpp
source/texture3d.h
source/texturecube.cpp
source/texturecube.h

index 38dc8a8bde5644ef5841bd52d7ae5636a7e40bbf..7163aa7a78d846ed834c32abcdb67fcc99201aa8 100644 (file)
@@ -151,6 +151,7 @@ void Texture1D::Loader::init()
 {
        add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
+       add("storage", &Loader::storage_levels);
 }
 
 void Texture1D::Loader::raw_data(const string &data)
@@ -163,5 +164,10 @@ void Texture1D::Loader::storage(PixelFormat fmt, unsigned w)
        obj.storage(fmt, w);
 }
 
+void Texture1D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned l)
+{
+       obj.storage(fmt, w, l);
+}
+
 } // namespace GL
 } // namespace Msp
index 52a768759eba68cd26149d61b12c1060161b5460..eb16696f988811ca237d7c0bebd2e158622c6cbb 100644 (file)
@@ -19,6 +19,7 @@ public:
 
                void raw_data(const std::string &);
                void storage(PixelFormat, unsigned);
+               void storage_levels(PixelFormat, unsigned, unsigned);
        };
 
 private:
index abdfe0d1569ca50d7f06e15531e5e01997cb47bc..72c84428ab6115ec4823a62d0264e0e21e989886 100644 (file)
@@ -210,6 +210,7 @@ void Texture2D::Loader::init()
 {
        add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
+       add("storage", &Loader::storage_levels);
 }
 
 void Texture2D::Loader::raw_data(const string &data)
@@ -222,6 +223,11 @@ void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h)
        obj.storage(fmt, w, h);
 }
 
+void Texture2D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned h, unsigned l)
+{
+       obj.storage(fmt, w, h, l);
+}
+
 
 Texture2D::AsyncLoader::AsyncLoader(Texture2D &t, IO::Seekable &i):
        texture(t),
index aec31678b03a341efa7891ba0a0277f12cd9c624..092f12ba47aaa77167aaf8ee67648045dc0f8328 100644 (file)
@@ -26,6 +26,7 @@ public:
 
                void raw_data(const std::string &);
                void storage(PixelFormat, unsigned, unsigned);
+               void storage_levels(PixelFormat, unsigned, unsigned, unsigned);
        };
 
 private:
index 48b358c2edd2ad0e2a899138713b8bb5d82135c9..c8f59a094a0fed550a37a5721ae26329941a54ae 100644 (file)
@@ -247,6 +247,7 @@ void Texture3D::Loader::init()
 {
        add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
+       add("storage", &Loader::storage_levels);
 }
 
 void Texture3D::Loader::raw_data(const string &data)
@@ -259,5 +260,10 @@ void Texture3D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigne
        obj.storage(fmt, w, h, d);
 }
 
+void Texture3D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned h, unsigned d, unsigned l)
+{
+       obj.storage(fmt, w, h, d, l);
+}
+
 } // namespace GL
 } // namespace Msp
index 7847c2fc7b7889027fad0553aee364967e4517bf..ce63a55ed04d9755d1087b93bc1508b8fdcc5723 100644 (file)
@@ -24,6 +24,7 @@ public:
 
                void raw_data(const std::string &);
                void storage(PixelFormat, unsigned, unsigned, unsigned);
+               void storage_levels(PixelFormat, unsigned, unsigned, unsigned, unsigned);
        };
 
 private:
index bac60ffdd9612317ecfd3af6251ff78ef1aa3c93..0613a39a8ebba335a56f42a9ec958c9a796ac45e 100644 (file)
@@ -271,6 +271,7 @@ void TextureCube::Loader::init()
        add("image_data", &Loader::image_data);
        add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
+       add("storage", &Loader::storage_levels);
 }
 
 void TextureCube::Loader::external_image(TextureCubeFace face, const string &fn)
@@ -301,6 +302,11 @@ void TextureCube::Loader::storage(PixelFormat fmt, unsigned s)
        obj.storage(fmt, s);
 }
 
+void TextureCube::Loader::storage_levels(PixelFormat fmt, unsigned s, unsigned l)
+{
+       obj.storage(fmt, s, l);
+}
+
 
 void operator>>(const LexicalConverter &conv, TextureCubeFace &face)
 {
index dabf2b8883690228c9e12e9babe232a95326015e..7659917dadec259a27281c8774679d85175aba68 100644 (file)
@@ -46,6 +46,7 @@ public:
                void image_data(TextureCubeFace, const std::string &);
                void raw_data(TextureCubeFace, const std::string &);
                void storage(PixelFormat, unsigned);
+               void storage_levels(PixelFormat, unsigned, unsigned);
        };
 
 private: