优化内存读取

This commit is contained in:
xsl
2025-11-29 11:35:56 +08:00
parent 9c71e40c97
commit 1859706412
814 changed files with 911 additions and 128 deletions
+7 -2
View File
@@ -8,6 +8,7 @@
struct Texture
{
std::string name;
VkSampler sampler;
VkImage image;
VkImageLayout image_layout;
@@ -15,6 +16,9 @@ struct Texture
VkImageView view;
uint32_t width, height;
uint32_t mip_levels;
VkBuffer stagingBuffer = VK_NULL_HANDLE;
VkDeviceMemory stagingBufferMemory = VK_NULL_HANDLE;
VkDevice device;
};
class Application : public AppBase
@@ -74,9 +78,10 @@ protected:
protected:
Texture loadTexture(std::string path, Texture& tex, bool srgb);
void loadTexture(std::string path, Texture& tex, bool srgb);
void loadTexture(std::vector<unsigned char>& image_data, size_t image_size, int w, int h, Texture& tex, bool srgb);
#ifdef _WIN32
Texture loadTextureExample(std::wstring path, Texture& tex, bool srgb);
void loadTextureExample(std::wstring path, Texture& tex, bool srgb);
#endif
uint32_t findMemoryType(VkPhysicalDevice physicalDevice, uint32_t typeFilter,