[vk] use static_vector instead of small_vector for TFB and other bindings (#3641)

MK8D is a big offender, taking up lots of time memcpy'ing and memmov'ing small_vector<> AND to add salt to the wound it doesn't even do heap allocations (no game does I think) - so basically useless waste of compute time in hot path for NO reason :^)

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3641
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: DraVee <chimera@dravee.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-03-06 15:05:05 +01:00 committed by crueter
parent c70b857c4f
commit 2ed1328c93
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
2 changed files with 33 additions and 30 deletions

View file

@ -14,9 +14,12 @@
#include <mutex>
#include <numeric>
#include <span>
#include <ankerl/unordered_dense.h>
#include <vector>
#include <ankerl/unordered_dense.h>
#include <boost/container/static_vector.hpp>
#include <boost/container/small_vector.hpp>
#include "common/common_types.h"
#include "common/div_ceil.h"
#include "common/literals.h"
@ -94,10 +97,10 @@ static constexpr Binding NULL_BINDING{
template <typename Buffer>
struct HostBindings {
boost::container::small_vector<Buffer*, NUM_VERTEX_BUFFERS> buffers;
boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> offsets;
boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> sizes;
boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> strides;
boost::container::static_vector<Buffer*, NUM_VERTEX_BUFFERS> buffers;
boost::container::static_vector<u64, NUM_VERTEX_BUFFERS> offsets;
boost::container::static_vector<u64, NUM_VERTEX_BUFFERS> sizes;
boost::container::static_vector<u64, NUM_VERTEX_BUFFERS> strides;
u32 min_index{NUM_VERTEX_BUFFERS};
u32 max_index{0};
};