rendering

This commit is contained in:
Kbz-8
2022-12-19 17:16:50 +01:00
parent f1e0499564
commit 54fc452aa2
13 changed files with 259 additions and 87 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 18:28:08 by maldavid #+# #+# */
/* Updated: 2022/12/18 00:28:52 by maldavid ### ########.fr */
/* Updated: 2022/12/19 15:38:45 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,7 +18,7 @@ namespace mlx
void VBO::setData(uint32_t size, const void* data)
{
if(size > _size)
core::error::report(e_kind::error, "Vulkan : trying to store to much data in a vertex buffer (%d on %d)", size, _size);
core::error::report(e_kind::error, "Vulkan : trying to store to much data in a vertex buffer (%d bytes in %d bytes)", size, _size);
if(data == nullptr)
core::error::report(e_kind::warning, "Vulkan : mapping null data in a vertex buffer");
@@ -27,23 +27,5 @@ namespace mlx
mapMem(&temp);
std::memcpy(temp, data, static_cast<size_t>(size));
unmapMem();
_used_size += size;
}
void VBO::setSubData(uint32_t offset, uint32_t size, const void* data)
{
if(size + _used_size > _size)
core::error::report(e_kind::error, "Vulkan : trying to store to much data in a vertex buffer (%d on %d)", size + _used_size, _size);
if(data == nullptr)
core::error::report(e_kind::warning, "Vulkan : mapping null data in a vertex buffer");
void* temp = nullptr;
mapMem(&temp, size, offset);
std::memcpy(temp, data, static_cast<size_t>(size));
unmapMem();
_used_size += size;
}
}