From: Mikko Rasa Date: Sun, 19 Dec 2021 11:26:00 +0000 (+0200) Subject: InstanceArray doesn't need to refresh the vertex arrays X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=5003bcfeb0832ec2d0f74f4149bc97888a70a900 InstanceArray doesn't need to refresh the vertex arrays That's done in Renderer since 9b3bce7. --- diff --git a/source/core/bufferable.h b/source/core/bufferable.h index f11d51fa..25d29fd8 100644 --- a/source/core/bufferable.h +++ b/source/core/bufferable.h @@ -41,7 +41,7 @@ private: Bufferable *next_in_buffer = 0; Bufferable *prev_in_buffer = 0; mutable bool location_dirty = false; - mutable bool dirty = false; + mutable uint8_t dirty = 0; protected: Bufferable() = default; @@ -63,11 +63,11 @@ public: std::size_t get_required_buffer_size(bool = false) const; /** Uploads new data into the buffer if necessary. */ - void refresh() const { if(dirty) upload_data(0); } + void refresh(unsigned f) const { if(dirty&(1<get_vertices().refresh(); if(instance_buffer->get_size()==0) instance_buffer->storage(instance_data.get_required_buffer_size(), STREAMING); - instance_data.refresh(); Renderer::Push push(renderer); method->apply(renderer);