Setting up initView for Vulkan#

Usually, the initView in the PowerVR SDK Vulkan demos is structured as follows:

  1. Create the instance, surface, swapchain, device, and queues with PVRUtils helpers. These can be created with various levels of detail with different helpers, but usually use pvr::utils::createInstance(…), pvr::utils::createSurface(…), pvr::utils::createDeviceAndQueues(…), and pvr::utils::createSwapchainAndDepthStencilImageView(…).

  2. Create DescriptorSetLayout objects depending on the needs of the application using pvrvk::Device::createDescriptorSetLayout(…).

  3. Create DescriptorSet objects based on the layouts using pvrvk::Device::createDescriptorSet(…).

  4. Create memory objects such as Buffer and Image using pvrvk::Device::createBuffer and pvrutils::uploadTexture(...).

  5. Populate the DescriptorSet objects with the memory objects using the function pvrvk::Device::updateDescriptorSets(…).

  6. Create PipelineLayout objects using the descriptor layouts using pvrvk::Device::createPipelineLayout(…).

  7. Configure PipelineCreateInfo objects (amongst others using those shader strings) and create the pipelines.

  8. Configure the VertexAttributes and VertexBindings usually using helper utilities such as pvr::utils::CreateInputAssemblyFromXXXXX(…). This will automatically populate the VertexInput area of the pipeline based on our models.

  9. Create the pipelines: myDevice->createPipeline(…).