17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 13:49:19 +02:00

Draw the instances from the GPU with multi draws, the model block of each draw read by its number

This commit is contained in:
2026-10-18 00:47:05 +02:00
parent 7221c153dd
commit 494304903f
18 changed files with 609 additions and 64 deletions

View File

@@ -353,6 +353,13 @@ geometry_bank::draw_indirect( gfx::geometry_handle const &Geometry, std::intptr_
draw_indirect_( Geometry, Offset, Streams );
}
// draws chunks of the bank with Count commands from Offset in the bound draw indirect buffer, in one call
bool
geometry_bank::draw_indirect_multi( gfx::geometry_handle const &Geometry, std::intptr_t const Offset, std::uint32_t const Count, std::uint32_t const Stride ) {
// template method implementation
return draw_indirect_multi_( Geometry, Offset, Count, Stride );
}
// frees subclass-specific resources associated with the bank, typically called when the bank wasn't in use for a period of time
void
geometry_bank::release() {
@@ -515,6 +522,18 @@ geometrybank_manager::draw_indirect( gfx::geometry_handle const &Geometry, std::
bankrecord.first->draw_indirect( Geometry, Offset, Streams );
}
// draws chunks of the bank of the specified one with Count commands from Offset in the bound draw indirect buffer, in one call
bool
geometrybank_manager::draw_indirect_multi( gfx::geometry_handle const &Geometry, std::intptr_t const Offset, std::uint32_t const Count, std::uint32_t const Stride ) {
if( Geometry == null_handle ) { return false; }
auto &bankrecord = bank( Geometry );
bankrecord.second = m_garbagecollector.timestamp();
return bankrecord.first->draw_indirect_multi( Geometry, Offset, Count, Stride );
}
// provides direct access to index data of specfied chunk
gfx::index_array const &
geometrybank_manager::indices( gfx::geometry_handle const &Geometry ) const {