Refactor PD::Li Pools system, Upgrade PD::Pool and add better logging
- Add ResetFast to Pool using c++20 concept - Add Put function to Pool - Use Pool Index instead of pointers in Command - Add accessor to Li Pools to prevent wrong command usage - Add Command Formatter - Use ResetFast for all Pools - Add Reset func to Li::Vertex (for ResetFast) - Add Pool Expandor and Put funcs to Lithium pools - Add getters for GfxDriverBase to PD::Li Pools
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <pd/lithium/atlas.hpp>
|
||||
#include <pd/lithium/command.hpp>
|
||||
#include <pd/lithium/rect.hpp>
|
||||
#include <pd/lithium/texture.hpp>
|
||||
#include <pd/lithium/vertex.hpp>
|
||||
@@ -106,4 +107,16 @@ struct std::formatter<PD::Li::AtlasState> : std::formatter<std::string> {
|
||||
}
|
||||
return std::format_to(ctx.out(), "{}", ret);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct std::formatter<PD::Li::Command> : std::formatter<std::string> {
|
||||
constexpr auto parse(std::format_parse_context& ctx) { return ctx.begin(); }
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const PD::Li::Command& value, FormatContext& ctx) const {
|
||||
return std::format_to(ctx.out(), "[0x{:X}, 0x{:X}] [{}, {}] 0x{:X}",
|
||||
(PD::ptr)value.FirstVertex, (PD::ptr)value.FirstIndex,
|
||||
value.VertexCount, value.IndexCount, value.Tex);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user