summaryrefslogtreecommitdiffstats
path: root/src/renderer.h
blob: 3a7dbad60dfe8fe3a12a681452b25427a9c967fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef VGLTF_RENDERER_H
#define VGLTF_RENDERER_H

#include "platform.h"
#include <vulkan/vulkan.h>

constexpr int VGLTF_RENDERER_MAX_SWAPCHAIN_IMAGE_COUNT = 32;
struct vgltf_renderer {
  VkInstance instance;
  VkPhysicalDevice physical_device;
  VkDevice device;
  VkQueue graphics_queue;
  VkQueue present_queue;
  VkDebugUtilsMessengerEXT debug_messenger;
  VkSurfaceKHR surface;
  VkSwapchainKHR swapchain;
  VkImage swapchain_images[VGLTF_RENDERER_MAX_SWAPCHAIN_IMAGE_COUNT];
  VkImageView swapchain_image_views[VGLTF_RENDERER_MAX_SWAPCHAIN_IMAGE_COUNT];
  VkFormat swapchain_image_format;
  VkExtent2D swapchain_extent;
  uint32_t swapchain_image_count;
  VkRenderPass render_pass;
  VkPipelineLayout pipeline_layout;
  VkPipeline graphics_pipeline;
};
bool vgltf_renderer_init(struct vgltf_renderer *renderer,
                         struct vgltf_platform *platform);
void vgltf_renderer_deinit(struct vgltf_renderer *renderer);

#endif // VGLTF_RENDERER_H
Go back to lisible.xyz