现在才是代码完成。

This commit is contained in:
xsl
2025-10-20 15:27:33 +08:00
parent d2da523636
commit e6a776665f
6 changed files with 323 additions and 167 deletions
+4 -4
View File
@@ -652,12 +652,12 @@ uint32_t Application::findMemoryType(VkPhysicalDevice physicalDevice, uint32_t t
throw std::runtime_error("Failed to find suitable memory type!");
}
Texture Application::loadTexture(std::string path, Texture tex)
Texture Application::loadTexture(std::string path, Texture& tex)
{
std::vector<char> data = readFile(path);
std::vector<unsigned char> data = readFileEx(path);
std::vector<unsigned char> image;
unsigned w, h;
unsigned error = lodepng::decode(image, w, h, data.data(), LCT_RGBA, 8);
unsigned error = lodepng::decode(image, w, h, data, LCT_RGBA, 8);
processWithVulkan(image.data(), w, h, w * 4, image.size(), tex, true);
return tex;
}
@@ -770,7 +770,7 @@ void Application::processWithVulkan(uint8_t* data, int width, int height, int ro
}
updateTexture(device, physicalDevice, commandPool, queue, data, width, height,
updateTexture(device, physicalDevice, commandPool, graphicsQueue, data, width, height,
rowStride, dataSize, out_texture);
}