Implemented Mipmaps
This commit is contained in:
+12
-7
@@ -120,7 +120,7 @@ namespace vapp{
|
||||
|
||||
class Vulkan{
|
||||
private:
|
||||
#pragma region Fields
|
||||
#pragma region PrivateFields
|
||||
GLFWwindow *window;
|
||||
uint32_t _width, _height;
|
||||
|
||||
@@ -173,6 +173,7 @@ namespace vapp{
|
||||
VkDescriptorPool descriptorPool;
|
||||
std::vector<VkDescriptorSet> descriptorSets;
|
||||
|
||||
int32_t mipLevels;
|
||||
VkImage textureImage;
|
||||
VkDeviceMemory textureImageMemory;
|
||||
|
||||
@@ -183,7 +184,7 @@ namespace vapp{
|
||||
VkDeviceMemory depthImageMemory;
|
||||
VkImageView depthImageView;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region PrivateFunctions
|
||||
bool checkValidationLayerSupport();
|
||||
std::vector<const char*> getRequiredExtensions();
|
||||
|
||||
@@ -212,11 +213,12 @@ namespace vapp{
|
||||
void createDepthResources();
|
||||
VkCommandBuffer beginSingleTimeCommands();
|
||||
void endSingleTimeCommands(VkCommandBuffer commandBuffer);
|
||||
void transitionImageLayout(VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout);
|
||||
void transitionImageLayout(VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout, uint32_t mipLevels);
|
||||
void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height);
|
||||
void createImage(uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage& image, VkDeviceMemory &imageMemory);
|
||||
void createImage(uint32_t width, uint32_t height, uint32_t mipLevels, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage& image, VkDeviceMemory &imageMemory);
|
||||
void generateMipmaps(VkImage image, VkFormat imageFormat, int32_t texWidth, int32_t texHeight, uint32_t mipLevels);
|
||||
void createTextureImage();
|
||||
VkImageView createImageView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags);
|
||||
VkImageView createImageView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags, uint32_t mipLevels);
|
||||
void createTextureImageView();
|
||||
void createTextureSampler();
|
||||
uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
|
||||
@@ -240,8 +242,9 @@ namespace vapp{
|
||||
void initVulkan();
|
||||
void mainLoop();
|
||||
void cleanup();
|
||||
|
||||
#pragma endregion
|
||||
public:
|
||||
#pragma region PublicFields
|
||||
#ifdef DEBUG
|
||||
const bool enableValidationLayers = true;
|
||||
#else
|
||||
@@ -251,8 +254,10 @@ namespace vapp{
|
||||
bool framebufferResized = false;
|
||||
std::string MODEL_PATH;
|
||||
std::string TEXTURE_PATH;
|
||||
|
||||
#pragma endregion
|
||||
#pragma region PublicFunctions
|
||||
void run(const char *windowName, const uint32_t width = 800, const uint32_t height = 600);
|
||||
#pragma endregion
|
||||
};
|
||||
} // vapp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user