fixing performance issues

This commit is contained in:
2023-08-02 12:50:50 +02:00
parent c497645ee9
commit a70bec4740
36 changed files with 629 additions and 431 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/31 13:18:50 by maldavid #+# #+# */
/* Updated: 2023/04/03 14:22:35 by maldavid ### ########.fr */
/* Updated: 2023/08/02 05:27:27 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,13 +25,12 @@ namespace mlx
void init(uint32_t width, uint32_t height, class Renderer& renderer) noexcept;
void setPixel(uint32_t x, uint32_t y, int color) noexcept;
void setPixel(uint32_t x, uint32_t y, uint32_t color) noexcept;
void present() noexcept;
void render(class Renderer& renderer) noexcept;
VkDescriptorSet getDescriptorSet() noexcept;
inline VkDescriptorSet getDescriptorSet() noexcept { return _texture.getSet(); }
void clear();
void destroy() noexcept;
~PixelPutPipeline();
@@ -39,7 +38,9 @@ namespace mlx
private:
Texture _texture;
Buffer _buffer;
void* _map = nullptr;
// using vector as CPU map and not directly writting to mapped buffer to improve performances
std::vector<uint32_t> _cpu_map;
void* _buffer_map = nullptr;
uint32_t _width = 0;
uint32_t _height = 0;
bool _has_been_modified = true;