aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gltf.cpp4
-rw-r--r--src/vk-renderer.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/gltf.cpp b/src/gltf.cpp
index 537e4e1..9b55cbb 100644
--- a/src/gltf.cpp
+++ b/src/gltf.cpp
@@ -118,7 +118,7 @@ void gltf::load_textures(const std::filesystem::path &path) {
const auto &gltf_image = gltf_images[image_index];
auto filepath = (path / gltf_image["uri"].get<std::string>()).string();
auto& image = images[image_index];
- image.data = stbi_load(filepath.c_str(), &image.x, &image.y, &image.channels, 4);
+ image.data = stbi_load(filepath.c_str(), &image.width, &image.height, &image.channels, 4);
}
// const auto &gltf_samplers = gltf_json["samplers"];
@@ -143,7 +143,7 @@ void gltf::load_textures(const std::filesystem::path &path) {
// sampler = samplers[sampler_index];
// }
- auto *texture = vkrenderer::create_2d_texture(static_cast<uint32_t>(image.x), static_cast<uint32_t>(image.y), VK_FORMAT_R8G8B8A8_UNORM, sampler);
+ auto *texture = vkrenderer::create_2d_texture(static_cast<uint32_t>(image.width), static_cast<uint32_t>(image.height), VK_FORMAT_R8G8B8A8_UNORM, sampler);
texture->update(image.data);
diff --git a/src/vk-renderer.cpp b/src/vk-renderer.cpp
index 54c667f..77e461d 100644
--- a/src/vk-renderer.cpp
+++ b/src/vk-renderer.cpp
@@ -130,7 +130,6 @@ void vkrenderer::update_images() {
vkrenderer::api.image_barrier(command_buffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, texture->device_image);
vkrenderer::api.copy_buffer(command_buffer, staging_buffer->device_buffer, texture->device_image, 0, offset);
vkrenderer::api.image_barrier(command_buffer, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, texture->device_image);
- break;
}
vkrenderer::api.end_record(command_buffer);