现在才是代码完成。
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user