Use 8 bit default textures instead of float

This commit is contained in:
Guillaume Meunier
2024-02-18 09:03:46 +01:00
parent 9fc95dbd17
commit 2df3595a86
4 changed files with 24 additions and 18 deletions
+5 -1
View File
@@ -23,6 +23,7 @@
#include <memory>
#include <span>
#include <spdlog/spdlog.h>
#include <stdexcept>
#include <variant>
#include <vulkan/vulkan_raii.hpp>
#include <ktxvulkan.h>
@@ -463,12 +464,15 @@ void image_loader::load(std::span<const std::byte> bytes, bool srgb)
}
// Load raw pixel data
void image_loader::load(const void * pixels, vk::Extent3D extent_, vk::Format format_)
void image_loader::load(const void * pixels, size_t size, vk::Extent3D extent_, vk::Format format_)
{
extent = extent_;
format = format_;
image_view_type = vk::ImageViewType::e2D;
if (size < extent.width * extent.height * extent.depth * bytes_per_pixel(format))
throw std::invalid_argument("size");
do_load_raw(pixels, extent_, format_);
create_image_view();