优化内存读取
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user