Changeset b794178 in opengl-game for vulkan-game.hpp


Ignore:
Timestamp:
Oct 17, 2019, 9:30:18 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
e83b155
Parents:
771b33a
Message:

In vulkangame, add the ability to create vulkan resoirces and descriptor sets for shader uniforms (images and ubos)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.hpp

    r771b33a rb794178  
    66#include "game-gui-sdl.hpp"
    77#include "graphics-pipeline_vulkan.hpp"
     8
     9#include "vulkan-utils.hpp"
    810
    911#ifdef NDEBUG
     
    4042
    4143      SDL_version sdlVersion;
    42       SDL_Window* window;
    43       SDL_Renderer* renderer;
     44      SDL_Window* window = nullptr;
     45      SDL_Renderer* renderer = nullptr;
     46
     47      SDL_Texture* uiOverlay = nullptr;
    4448
    4549      VkInstance instance;
     
    5963      VkRenderPass renderPass;
    6064      VkCommandPool commandPool;
     65
     66      // TODO: Create these (and wrap them inside a VulkanImage)
     67      VkImage depthImage;
     68      VkDeviceMemory depthImageMemory;
     69      VkImageView depthImageView;
     70
     71      VkSampler textureSampler;
     72
     73      vector<VkDescriptorBufferInfo> uniformBufferInfoList;
     74
     75      // These are currently to store the MVP matrix
     76      // I should figure out if it makes sense to use them for other uniforms in the future
     77      // If not, I should rename them to better indicate their purpose.
     78      // I should also decide if I can use these for all shaders, or if I need a separapte set of buffers for each one
     79      vector<VkBuffer> uniformBuffers;
     80      vector<VkDeviceMemory> uniformBuffersMemory;
     81
     82      VulkanImage floorTextureImage;
     83      VkDescriptorImageInfo floorTextureImageDescriptor;
     84
     85      VulkanImage sdlOverlayImage;
     86      VkDescriptorImageInfo sdlOverlayImageDescriptor;
    6187
    6288      bool framebufferResized = false;
     
    83109      VkFormat findDepthFormat();
    84110      void createCommandPool();
     111      void createVulkanResources();
     112      void createTextureSampler();
     113      void createUniformBuffers();
    85114
    86115      void cleanupSwapChain();
Note: See TracChangeset for help on using the changeset viewer.