summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-03-11 20:45:05 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-11 20:45:05 +0000
commitc403a71564def731f4d3b80d6ff63f08aa3c7ea3 (patch)
treee4302316295639da9a2d10181c498986c8806754 /assetFactory
parentAdd missing typename exporting base::value_type from InstanceVertices (diff)
downloadilt-c403a71564def731f4d3b80d6ff63f08aa3c7ea3.tar.bz2
ilt-c403a71564def731f4d3b80d6ff63f08aa3c7ea3.tar.xz
ilt-c403a71564def731f4d3b80d6ff63f08aa3c7ea3.zip
Reuse vertex array objects for common structures with DSA
Slashes the number of VAOs required and the amount of setup required.
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/assetFactory.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/assetFactory/assetFactory.cpp b/assetFactory/assetFactory.cpp
index b96e527..a8d6036 100644
--- a/assetFactory/assetFactory.cpp
+++ b/assetFactory/assetFactory.cpp
@@ -3,6 +3,7 @@
#include "cuboid.h"
#include "cylinder.h"
#include "filesystem.h"
+#include "gfx/gl/gldebug.h"
#include "gfx/image.h"
#include "gfx/models/texture.h"
#include "gfx/renderable.h"
@@ -26,6 +27,7 @@ AssetFactory::AssetFactory() :
std::shared_ptr<AssetFactory>
AssetFactory::loadXML(const std::filesystem::path & filename)
{
+ glDebugScope _ {0, filename.native()};
filesystem::FileStar file {filename.c_str(), "r"};
return Persistence::SAXParsePersistence {}.loadState<std::shared_ptr<AssetFactory>>(file);
}
@@ -33,6 +35,7 @@ AssetFactory::loadXML(const std::filesystem::path & filename)
AssetFactory::Assets
AssetFactory::loadAll(const std::filesystem::path & root)
{
+ glDebugScope _ {0};
return std::accumulate(std::filesystem::recursive_directory_iterator {root},
std::filesystem::recursive_directory_iterator {}, Assets {}, [](auto out, const auto & path) {
if (path.path().extension() == ".xml") {
@@ -115,6 +118,7 @@ void
AssetFactory::createTexutre() const
{
if (!textureFragments.empty() && !texture) {
+ glDebugScope _ {0};
// * layout images
std::map<const TextureFragment *, std::unique_ptr<const Image>> images;
std::transform(