adding profiler

This commit is contained in:
Kbz-8
2024-01-10 18:32:40 +01:00
parent 6648bd427f
commit 91661fd206
23 changed files with 1325 additions and 535 deletions

View File

@@ -20,6 +20,7 @@ namespace mlx
void GraphicsSupport::clearRenderData() noexcept
{
MLX_PROFILE_FUNCTION();
_textures_to_render.clear();
_pixel_put_pipeline.clear();
_text_put_pipeline->clear();
@@ -27,16 +28,19 @@ namespace mlx
void GraphicsSupport::pixelPut(int x, int y, uint32_t color) noexcept
{
MLX_PROFILE_FUNCTION();
_pixel_put_pipeline.setPixel(x, y, color);
}
void GraphicsSupport::stringPut(int x, int y, int color, std::string str)
{
MLX_PROFILE_FUNCTION();
_text_put_pipeline->put(x, y, color, str);
}
void GraphicsSupport::texturePut(Texture* texture, int x, int y)
{
MLX_PROFILE_FUNCTION();
_textures_to_render.emplace_back(texture, x, y);
auto it = std::find(_textures_to_render.begin(), _textures_to_render.end() - 1, _textures_to_render.back());
if(it != _textures_to_render.end() - 1)
@@ -45,6 +49,7 @@ namespace mlx
void GraphicsSupport::loadFont(const std::filesystem::path& filepath, float scale)
{
MLX_PROFILE_FUNCTION();
_text_put_pipeline->loadFont(filepath, scale);
}
}