render a first frame
[vulkan-misc.git] / 2d / blit / app_state_types.h
blobc1c4653df04c408bba02ba9323dc9a3ced2b2cfd
1 #ifndef APP_STATE_TYPES_H
2 #define APP_STATE_TYPES_H
3 /*
4 * this is public domain without any warranties of any kind
5 * Sylvain BERTRAND
6 */
7 /* XXX: KEEP AN EYE ON ABBREVIATIONS, ALWAYS */
8 #include <stddef.h>
9 #include <xcb.h>
10 #include "app_core_types.h"
11 #include "nyanvk/types.h"
12 #include "nyanvk/syms_dev.h"
13 /* this is the default initial cpu rendering size */
14 #define APP_CPU_IMG_WIDTH 50
15 #define APP_CPU_IMG_HEIGHT 50
16 #define APP_WIN_WIDTH 100
17 #define APP_WIN_HEIGHT 100
18 /*----------------------------------------------------------------------------*/
19 #include "namespace/app_state_types.h"
20 /*----------------------------------------------------------------------------*/
21 constant {
22 state_run = 1,
23 state_quit = 2
26 constant {
27 swpchn_imgs_n_max = 3
30 struct swpchn_t {
31 void *vk;
33 u32 imgs_n;
34 void *imgs[swpchn_imgs_n_max];
37 struct phydev_t {
38 void *vk;
39 u8 q_fam;
40 bool is_discret_gpu;
41 struct vk_surf_texel_mem_blk_conf_core_t
42 selected_texel_mem_blk_conf_core;
43 u32 mem_types_n;
44 struct vk_mem_type_t mem_types[VK_MEM_TYPES_N_MAX];
47 struct cpu_img_t {
48 void *vk;
49 struct vk_subrsrc_layout_t layout;
50 void *dev_mem; /* TODO: we should use 1 big dev_mem chunk */
51 void *data;
54 constant {
55 sem_acquire_img_done = 0,
56 sem_blit_done = 1,
57 sems_n = 2,
60 struct dev_t {
61 void *vk;
62 struct phydev_t phydev;
63 struct swpchn_t swpchn;
64 void *q;
65 void *cp;
66 void *cbs[swpchn_imgs_n_max];
67 void *sems[sems_n];
68 struct app_cpu_img_t cpu_imgs[swpchn_imgs_n_max];
69 VK_DEV_SYMS_FULL /* should cherry pick the syms we use */
72 struct surf_t {
73 void *vk;
74 struct dev_t dev;
76 /*============================================================================*/
77 /* tmp state */
78 constant {
79 tmp_phydevs_n_max = 16,
80 tmp_phydev_q_fams_n_max = 16,
81 tmp_present_modes_n_max = 16
84 struct tmp_phydev_t {
85 void *vk;
86 u8 q_fams_n;
87 struct vk_q_fam_props_t q_fams[tmp_phydev_q_fams_n_max];
88 bool is_discret_gpu;
89 struct vk_phydev_mem_props_t mem_props;
90 bool q_fams_surf_support[tmp_phydev_q_fams_n_max];
92 /*----------------------------------------------------------------------------*/
93 #define CLEANUP
94 #include "namespace/app_state_types.h"
95 #undef CLEANUP
96 /*----------------------------------------------------------------------------*/
97 #endif /* APP_STATE_TYPES_H */