/* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once // the geometry of the streamed scenery models around the camera asked of the streamer ahead of their drawing, and kept while they're // near (modelstreaming, rendering/geometrystreamer.h): the cells within the draw range and a margin are gone through, a part of them // at a frame, and every model whose instance would be drawn from within the margin is asked for, the nearer the sooner. with // gfx.textures.streaming the data of the textures of the instances is read ahead too, where the renderer has it read so // (gfx_renderer::Prefetches_Textures()) #include #include #include #include namespace scene { class basic_section; } namespace gfx { class model_prefetch { public: static auto instance() -> model_prefetch &; // a part of the cells around the camera gone through, Whole: all of them at once (the start of the scenario). the main thread void update( glm::dvec3 const &Camera, bool const Whole ); // what the passes cost the main thread since the last call: passes, their time and the longest, in ms (the self-test) struct timing { std::uint64_t passes { 0 }; double total { 0.0 }; double longest { 0.0 }; std::uint64_t textures { 0 }; // instances whose textures were asked for }; auto take_timing() -> timing; private: std::size_t m_cursor { 0 }; timing m_timing; std::vector m_sections; }; } // namespace gfx