npv: correct coarse sync of vulkan image acquisition
[nyanmp.git] / npv / nyanvk / consts.h
blob522aad5e6023ec7b219d6f27fa632f928f2824b8
1 #ifndef NYANVK_CONSTS_H
2 #define NYANVK_CONSTS_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 /*
9 * 64 bits platforms: enums do default to 32 bits, but can go up to 64 bits
10 * based on the range of vals they hold. this is important for
11 * vulkan ABI which we will fix.
12 * _individually_, each val is defaulted to 32bits, if possible, and signed
13 * or not.
14 * XXX: All vulkan enums use 32 bits storage
16 enum {
17 /* extension number 2 or index 1, return code 4, error */
18 vk_out_of_date = -(1000000000 + 1000 + 4),
19 vk_err_fragmented_pool = -12,
20 vk_err_fmt_not_supported = -11,
21 vk_err_too_many_objs = -10,
22 vk_err_incompatible_drv = -9,
23 vk_err_feature_not_present = -8,
24 vk_err_ext_not_present = -7,
25 vk_err_layer_not_present = -6,
26 vk_err_mmap_failed = -5,
27 vk_err_dev_lost = -4,
28 vk_err_ini_failed = -3,
29 vk_err_out_of_dev_mem = -2,
30 vk_err_out_of_host_mem = -1,
31 /*--------------------------------------------------------------------*/
32 vk_success = 0,
33 vk_not_ready = 1,
34 vk_timeout = 2,
35 vk_incomplete = 5,
36 /* extension number 2 or index 1, return code 3 */
37 vk_suboptimal = 1000000000 + 1000 + 3,
38 vk_r_enum_max = 0x7fffffff
40 enum {
41 vk_struct_type_instance_create_info = 1,
42 vk_struct_type_dev_q_create_info = 2,
43 vk_struct_type_dev_create_info = 3,
44 vk_struct_type_submit_info = 4,
45 vk_struct_type_mem_alloc_info = 5,
46 vk_struct_type_fence_create_info = 8,
47 vk_struct_type_sem_create_info = 9,
48 vk_struct_type_img_create_info = 14,
49 vk_struct_type_imgview_create_info = 15,
50 vk_struct_type_shmod_create_info = 16,
51 vk_struct_type_pl_sh_stage_create_info = 18,
52 vk_struct_type_pl_vtx_input_state_create_info = 19,
53 vk_struct_type_pl_input_assembly_state_create_info = 20,
54 vk_struct_type_pl_viewport_state_create_info = 22,
55 vk_struct_type_pl_raster_state_create_info = 23,
56 vk_struct_type_pl_multisample_state_create_info = 24,
57 vk_struct_type_pl_color_blend_state_create_info = 26,
58 vk_struct_type_gfx_pl_create_info = 28,
59 vk_struct_type_pl_layout_create_info = 30,
60 vk_struct_type_fb_create_info = 37,
61 vk_struct_type_cp_create_info = 39,
62 vk_struct_type_cb_alloc_info = 40,
63 vk_struct_type_cb_begin_info = 42,
64 vk_struct_type_rp_begin_info = 43,
65 vk_struct_type_img_mem_barrier = 45,
66 /* extension number 2 or index 1, offset 0 */
67 vk_struct_type_swpchn_create_info = 1000000000 + 1000 + 0,
68 /* extension number 2 or index 1, offset 1 */
69 vk_struct_type_present_info = 1000000000 + 1000 + 1,
70 /* extension number 6 or index 5, offset 0 */
71 vk_struct_type_xcb_surf_create_info = 1000000000 + 5000 + 0,
72 /* extension number 60 or index 59, offset 1 */
73 vk_struct_type_phydev_props = 1000000000 + 59000 + 1,
74 /* extension number 60 or index 59, offset 5 */
75 vk_struct_type_q_fam_props = 1000000000 + 59000 + 5,
76 /* extension number 60 or index 59, offset 6 */
77 vk_struct_type_phydev_mem_props = 1000000000 + 59000 + 6,
78 /* extension number 60 or index 59, offset 10 */
79 vk_struct_type_acquire_next_img_info = 1000000000 + 59000 + 10,
80 /* extension number 110 or index 109, offset 0 */
81 vk_struct_type_at_desc = 1000000000 + 109000 + 0,
82 /* extension number 110 or index 109, offset 1 */
83 vk_struct_type_at_ref = 1000000000 + 109000 + 1,
84 /* extension number 110 or index 109, offset 2 */
85 vk_struct_type_sp_desc = 1000000000 + 109000 + 2,
86 /* extension number 110 or index 109, offset 4 */
87 vk_struct_type_rp_create_info = 1000000000 + 109000 + 4,
88 /* extension number 110 or index 109, offset 5 */
89 vk_struct_type_sp_begin_info = 1000000000 + 109000 + 5,
90 /* extension number 110 or index 109, offset 6 */
91 vk_struct_type_sp_end_info = 1000000000 + 109000 + 6,
92 /* extension number 120 or index 119, offset 0 */
93 vk_struct_type_phydev_surf_info = 1000000000 + 119000 + 0,
94 /* extension number 120 or index 119, offset 1 */
95 vk_struct_type_surf_caps = 1000000000 + 119000 + 1,
96 /* extension number 120 or index 119, offset 2 */
97 vk_struct_type_surf_texel_mem_blk_conf = 1000000000 + 119000 + 2,
98 /* extension number 147 or index 146, offset 1 */
99 vk_struct_type_img_mem_rqmts_info = 1000000000 + 146000 + 1,
100 /* extension number 147 or index 146, offset 3 */
101 vk_struct_type_mem_rqmts = 1000000000 + 146000 + 3,
102 /* extension number 158 or index 157, offset 1 */
103 vk_struct_type_bind_img_mem_info = 1000000000 + 157000 + 1,
104 vk_struct_type_enum_max = 0x7fffffff
106 enum {
107 vk_phydev_type_other = 0,
108 vk_phydev_type_integrated_gpu = 1,
109 vk_phydev_type_discrete_gpu = 2,
110 vk_phydev_type_virtual_gpu = 3,
111 vk_phydev_type_cpu = 4,
112 vk_phydev_type_enum_max = 0x7fffffff
114 enum {
115 vk_q_gfx_bit = 0x00000001,
116 vk_q_compute_bit = 0x00000002,
117 vk_q_transfer_bit = 0x00000004,
118 vk_q_sparse_binding_bit = 0x00000008,
119 vk_q_protected_bit = 0x00000010,
120 vk_q_flag_bits_enum_max = 0x7fffffff
122 enum {
123 vk_cp_create_transient_bit = 0x00000001,
124 vk_cp_create_reset_cb_bit = 0x00000002,
125 vk_cp_create_flag_bits_enum_max = 0x7fffffff
127 enum {
128 vk_texel_mem_blk_fmt_undefined = 0,
129 vk_texel_mem_blk_fmt_b8g8r8a8_unorm = 44,
130 vk_texel_mem_blk_fmt_b8g8r8a8_srgb = 50,
131 vk_texel_mem_blk_fmt_enum_max = 0x7fffffff
133 enum {
134 vk_color_space_srgb_nonlinear = 0,
135 vk_color_space_enum_max = 0x7fffffff
137 enum {
138 vk_mem_prop_dev_local_bit = 0x00000001,
139 vk_mem_prop_host_visible_bit = 0x00000002,
140 vk_mem_prop_host_cached_bit = 0x00000008,
141 vk_mem_prop_bits_enum_max = 0x7fffffff
143 enum {
144 vk_mem_heap_dev_local_bit = 0x00000001,
145 vk_mem_heap_multi_instance_bit = 0x00000002,
146 vk_mem_heap_bits_enum_max = 0x7fffffff
148 enum {
149 vk_surf_transform_identity_bit = 0x00000001,
150 vk_surf_transform_bits_enum_max = 0x7fffffff
152 enum {
153 vk_composite_alpha_opaque_bit = 0x00000001,
154 vk_composite_alpha_bits_enum_max = 0x7fffffff
156 enum {
157 vk_img_usage_transfer_src_bit = 0x00000001,
158 vk_img_usage_transfer_dst_bit = 0x00000002,
159 vk_img_usage_color_attachment_bit = 0x00000010,
160 vk_img_usage_bits_enum_max = 0x7fffffff
162 enum {
163 vk_sharing_mode_exclusive = 0,
164 vk_sharing_mode_enum_max = 0x7fffffff
166 enum {
167 vk_present_mode_immediate = 0,
168 vk_present_mode_mailbox = 1,
169 vk_present_mode_fifo = 2,
170 vk_present_mode_fifo_relaxed = 3,
171 vk_present_mode_enum_max = 0x7fffffff
173 enum {
174 vk_img_type_2d = 1,
175 vk_img_type_enum_max = 0x7fffffff
177 enum {
178 vk_samples_n_1_bit = 0x00000001,
179 vk_samples_n_bits_enum_max = 0x7fffffff
181 enum {
182 vk_img_tiling_optimal = 0,
183 vk_img_tiling_linear = 1,
184 vk_img_tiling_enum_max = 0x7fffffff
186 enum {
187 vk_img_create_flag_2d_array_compatible_bit = 0x00000002,
188 vk_img_create_flag_enum_max = 0x7fffffff
190 enum {
191 vk_img_layout_undefined = 0,
192 vk_img_layout_general = 1,
193 vk_img_layout_color_at_optimal = 2,
194 /* extension number 2 or index 1, offset 2 */
195 vk_img_layout_present = 1000000000 + 1000 + 2,
196 vk_img_layout_enum_n_max = 0x7fffffff
198 enum {
199 /* more */
200 vk_pl_stage_top_of_pipe_bit = (1 << 0),
201 vk_pl_stage_bottom_of_pipe_bit = (1 << 13),
202 vk_pl_stage_bits_enum_max = 0x7fffffff
204 enum {
205 vk_img_aspect_color_bit = 1,
206 vk_img_aspect_bits_enum_max = 0x7fffffff
208 enum {
209 vk_cb_lvl_primary = 0,
210 vk_cb_lvl_enum_max = 0x7fffffff
212 enum {
213 vk_cb_usage_one_time_submit_bit = 0x00000001,
214 vk_cb_usage_enum_max = 0x7fffffff
216 enum {
217 vk_comp_swizzle_identity = 0,
218 vk_comp_swizzle_enum_max = 0x7fffffff
220 enum {
221 vk_imgview_type_2d = 1,
222 vk_imgview_type_enum_max = 0x7fffffff
224 enum {
225 vk_at_load_op_load = 0,
226 vk_at_load_op_clr = 1,
227 vk_at_load_op_dont_care = 2,
228 vk_at_load_op_enum_max = 0x7fffffff
230 enum {
231 vk_at_store_op_store = 0,
232 vk_at_store_op_dont_care = 1,
233 vk_at_store_op_enum_max = 0x7fffffff
235 enum {
236 vk_pl_bind_point_gfx = 0,
237 vk_pl_bind_point_compute = 1,
238 vk_pl_bind_point_enum_max = 0x7fffffff
240 enum {
241 vk_sh_stage_vtx_bit = 0x00000001,
242 vk_sh_stage_frag_bit = 0x00000010,
243 /* meh */
244 vk_sh_stage_compute_bit = 0x00000020,
245 vk_sh_stage_bits_enum_max = 0x7fffffff
247 enum {
248 vk_prim_topology_triangle_list = 3,
249 /* more */
250 vk_prim_topology_enum_max = 0x7fffffff
252 enum {
253 vk_logic_op_copy = 3,
254 vk_logic_op_enum_max = 0x7fffffff
256 enum {
257 vk_color_comp_r_bit = 0x00000001,
258 vk_color_comp_p_bit = 0x00000002,
259 vk_color_comp_b_bit = 0x00000004,
260 vk_color_comp_a_bit = 0x00000008,
261 vk_color_comp_bits_enum_max = 0x7fffffff
263 enum {
264 vk_blend_factor_zero = 0,
265 vk_blend_factor_one = 1,
266 vk_blend_factor_src_alpha = 6,
267 vk_blend_factor_one_minus_src_alpha = 7,
268 vk_blend_factor_enum_max = 0x7fffffff
270 enum {
271 vk_blend_op_add = 0,
272 vk_blend_op_substract = 1,
273 vk_blend_op_reverse_substract = 2,
274 vk_blend_op_min = 3,
275 vk_blend_op_max = 4,
276 vk_blend_op_enum_max = 0x7fffffff
278 enum {
279 vk_sp_contents_inline = 0,
280 /* more? */
281 vk_sp_contents_enum_max = 0x7fffffff
283 enum {
284 vk_polygon_mode_fill = 0,
285 /* more */
286 vk_polygon_mode_enum_max = 0x7fffffff
288 enum {
289 vk_cull_mode_none = 0,
290 vk_cull_mode_front_bit = 0x00000001,
291 vk_cull_mode_back_bit = 0x00000002,
292 vk_cull_mode_bits_enum_max = 0x7fffffff
294 enum {
295 vk_front_face_counter_clockwise = 0,
296 vk_front_face_clockwise = 1,
297 vk_front_face_enum_max = 0x7fffffff
299 enum {
300 vk_fence_create_signaled_bit = 0x00000001,
301 vk_fence_create_flag_bits_enum_max = 0x7fffffff
303 #endif