From c403a71564def731f4d3b80d6ff63f08aa3c7ea3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 11 Mar 2026 20:45:05 +0000 Subject: Reuse vertex array objects for common structures with DSA Slashes the number of VAOs required and the amount of setup required. --- game/scenary/illuminator.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'game/scenary/illuminator.h') diff --git a/game/scenary/illuminator.h b/game/scenary/illuminator.h index 200ba40..7b6e7ad 100644 --- a/game/scenary/illuminator.h +++ b/game/scenary/illuminator.h @@ -11,8 +11,8 @@ class Location; class Illuminator : public Asset, public Renderable, public StdTypeDefs { Mesh::Ptr bodyMesh; Texture::Ptr texture; - glVertexArray instanceVAO; - std::optional instancesSpotLightVAO, instancesPointLightVAO; + std::shared_ptr instanceVAO, instancesSpotLightVAO, instancesPointLightVAO; + static std::weak_ptr commonInstanceVAO, commonInstancesSpotLightVAO, commonInstancesPointLightVAO; public: [[nodiscard]] std::any createAt(const Location &) const override; @@ -42,7 +42,6 @@ public: bool persist(Persistence::PersistenceStore & store) override; }; -public: using LocationVertex = std::pair; mutable InstanceVertices instances; mutable InstanceVertices instancesSpotLight; -- cgit v1.3