Skip to content
Snippets Groups Projects
Commit 6ede8534 authored by Vanessa Karolek's avatar Vanessa Karolek
Browse files

[#94] add ppm texture as png file, load png file

parent 01d45489
Branches
Tags
1 merge request!77Resolve "SAF-R Module"
Pipeline #26381 passed
...@@ -153,13 +153,12 @@ int main(int argc, const char** argv) { ...@@ -153,13 +153,12 @@ int main(int argc, const char** argv) {
{ "VK_KHR_swapchain" } { "VK_KHR_swapchain" }
); );
vkcv::asset::TextureData texData = vkcv::asset::loadTexture("textures/texture.ppm"); vkcv::asset::TextureData texData = vkcv::asset::loadTexture("textures/texture.png");
vkcv::Image texture = core.createImage(vk::Format::eR8G8B8A8Srgb, 800, 600); vkcv::Image texture = core.createImage(vk::Format::eR8G8B8A8Srgb, 800, 600);
texture.fill( texData.data.data()); texture.fill( texData.data.data());
texture.generateMipChainImmediate(); texture.generateMipChainImmediate();
texture.switchLayout(vk::ImageLayout::eShaderReadOnlyOptimal); texture.switchLayout(vk::ImageLayout::eShaderReadOnlyOptimal);
const auto& context = core.getContext(); const auto& context = core.getContext();
auto triangleIndexBuffer = core.createBuffer<uint16_t>(vkcv::BufferType::INDEX, 3, vkcv::BufferMemoryType::DEVICE_LOCAL); auto triangleIndexBuffer = core.createBuffer<uint16_t>(vkcv::BufferType::INDEX, 3, vkcv::BufferMemoryType::DEVICE_LOCAL);
......
projects/saf_r/textures/texture.png

130 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment