mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 15:30:21 +01:00
fix(instancing): keep batches correct after load-time classification
This commit is contained in:
@@ -376,7 +376,7 @@ class opengl33_renderer : public gfx_renderer {
|
||||
// cell's buckets are merged here keyed by (TModel3d*, skins), so that
|
||||
// Render_Instanced() runs once per unique model across the whole pass instead
|
||||
// of once per cell -- collapsing many tiny instanced draws into a few large
|
||||
// batches. Reused every pass; cleared at the top of Render(scene::basic_region*).
|
||||
// batches. Reused every pass; the vectors are emptied (not freed) at the top of Render(scene::basic_region*).
|
||||
scene::basic_cell::instance_bucket_map m_frame_instance_buckets;
|
||||
renderpass_config m_colorpass; // parametrs of most recent color pass
|
||||
std::array<renderpass_config, 3> m_shadowpass; // parametrs of most recent shadowmap pass for each of csm stages
|
||||
@@ -426,6 +426,11 @@ class opengl33_renderer : public gfx_renderer {
|
||||
// reused across calls -- clear() retains capacity, so once it has grown to
|
||||
// the largest batch seen, steady-state frames perform no allocation here.
|
||||
std::vector<glm::mat4> m_instance_modelviews;
|
||||
// further persistent scratch buffers for Render_Instanced(): culled instances paired with their
|
||||
// squared distance, and the lod bounds of the drawn model which split them into lod bands
|
||||
std::vector<std::pair<float, glm::mat4>> m_instance_survivors;
|
||||
std::vector<float> m_instance_lodbounds;
|
||||
std::vector<TSubModel const *> m_instance_lodpending;
|
||||
gl::scene_ubs scene_ubs;
|
||||
gl::model_ubs model_ubs;
|
||||
gl::light_ubs light_ubs;
|
||||
|
||||
Reference in New Issue
Block a user