diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-09-12 22:04:54 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-09-12 22:04:54 +0200 |
| commit | 15069341c7c8c36c7371ea1de4b63ed52034b3a8 (patch) | |
| tree | 41d3640acdf4de9baf8f3bfd86afb91be2a9ab1f /include | |
| parent | 1bb6caa5c8cb97f23f84ac9f3d4aa6c38b6d901c (diff) | |
Fix texture uploading bug
Diffstat (limited to 'include')
| -rw-r--r-- | include/gltf.hpp | 4 | ||||
| -rw-r--r-- | include/vk-renderer.hpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/gltf.hpp b/include/gltf.hpp index 2f7377a..6e89509 100644 --- a/include/gltf.hpp +++ b/include/gltf.hpp @@ -16,8 +16,8 @@ struct node { };
struct raw_image {
- int32_t x;
- int32_t y;
+ int32_t width;
+ int32_t height;
int32_t channels;
uint8_t *data;
};
diff --git a/include/vk-renderer.hpp b/include/vk-renderer.hpp index 6c6d2f0..ab15cd1 100644 --- a/include/vk-renderer.hpp +++ b/include/vk-renderer.hpp @@ -131,9 +131,11 @@ class RingBuffer { [[nodiscard]]size_t alloc(size_t alloc_size) { assert(alloc_size > 0 && alloc_size <= buffer_size); - if (ptr <= buffer_size - alloc_size) { + auto alloc_offset = ptr; + + if (alloc_offset <= buffer_size - alloc_size) { ptr += alloc_size; - return ptr; + return alloc_offset; } return invalid_alloc; |
