4 * this is public domain without any warranties of any kind
7 /* XXX: KEEP AN EYE ON ABBREVIATIONS, ALWAYS */
8 /*----------------------------------------------------------------------------*/
11 #define vk_whole_sz 0xffffffffffffffff
12 #define vk_q_fam_ignored 0xffffffff
13 /*----------------------------------------------------------------------------*/
14 #define VK_VERSION_MAJOR(x) (x >> 22)
15 #define VK_VERSION_MINOR(x) ((x >> 12) & 0x3ff)
16 #define VK_VERSION_PATCH(x) (x & 0xfff)
17 /*----------------------------------------------------------------------------*/
18 /* opaque or not defined */
25 struct vk_buf_barrier_t
;
26 struct vk_mem_barrier_t
;
34 struct vk_pl_layout_t
;
38 struct vk_specialization_info_t
;
39 struct vk_dset_layout_t
;
42 /*----------------------------------------------------------------------------*/
43 struct vk_offset_2d_t
{
47 struct vk_offset_3d_t
{
52 struct vk_extent_2d_t
{
56 struct vk_extent_3d_t
{
62 struct vk_offset_2d_t offset
;
63 struct vk_extent_2d_t extent
;
65 struct vk_instance_create_info_t
{
69 void *app_info
; /* allow easy hidden driver optimizations: no! */
71 u8
**enabled_layer_names
;
73 u8
**enabled_ext_names
;
75 #define VK_MAX_EXT_NAME_SZ 256
76 struct vk_ext_props_t
{
77 u8 name
[VK_MAX_EXT_NAME_SZ
];
80 #define VK_MAX_DESC_SZ 256
81 struct vk_layer_props_t
{
82 u8 name
[VK_MAX_EXT_NAME_SZ
];
84 u32 implementation_version
;
85 u8 desc
[VK_MAX_DESC_SZ
];
87 struct vk_phydev_limits_t
{
102 float not_used_14
[6];
106 struct vk_phydev_sparse_props_t
{
109 #define VK_MAX_PHYDEV_NAME_SZ 256
110 #define VK_UUID_SZ 16
111 struct vk_phydev_props_core_t
{
117 u8 name
[VK_MAX_PHYDEV_NAME_SZ
];
118 u8 pl_cache_uuid
[VK_UUID_SZ
];
119 struct vk_phydev_limits_t limits
;
120 struct vk_phydev_sparse_props_t sparse_props
;
122 /* the vulkan 1.1 version */
123 struct vk_phydev_props_t
{
126 struct vk_phydev_props_core_t core
;
128 struct vk_q_fam_props_core_t
{
131 u32 timestamp_valid_bits
;
132 struct vk_extent_3d_t min_img_transfer_granularity
;
134 struct vk_q_fam_props_t
{
137 struct vk_q_fam_props_core_t core
;
139 struct vk_phydev_features_t
{
142 struct vk_dev_q_create_info_t
{
150 struct vk_dev_create_info_t
{
154 u32 q_create_infos_n
;
155 struct vk_dev_q_create_info_t
*q_create_infos
;
159 u8
**enabled_ext_names
;
162 struct vk_cp_create_info_t
{
168 struct vk_xcb_surf_create_info_t
{
175 struct vk_phydev_surf_info_t
{
180 struct vk_surf_texel_mem_blk_conf_core_t
{
184 struct vk_surf_texel_mem_blk_conf_t
{
187 struct vk_surf_texel_mem_blk_conf_core_t core
;
189 struct vk_mem_type_t
{
193 struct vk_mem_heap_t
{
197 #define VK_MEM_TYPES_N_MAX 32
198 #define VK_MEM_HEAPS_N_MAX 16
199 struct vk_phydev_mem_props_core_t
{
201 struct vk_mem_type_t mem_types
[VK_MEM_TYPES_N_MAX
];
203 struct vk_mem_heap_t mem_heaps
[VK_MEM_HEAPS_N_MAX
];
205 struct vk_phydev_mem_props_t
{
208 struct vk_phydev_mem_props_core_t core
;
210 struct vk_texel_mem_blk_fmt_props_core_t
{
211 u32 linear_tiling_features
;
212 u32 optimal_tiling_features
;
215 struct vk_texel_mem_blk_fmt_props_t
{
218 struct vk_texel_mem_blk_fmt_props_core_t core
;
220 struct vk_surf_caps_core_t
{
223 struct vk_extent_2d_t current_extent
;
224 struct vk_extent_2d_t img_extent_min
;
225 struct vk_extent_2d_t img_extent_max
;
226 u32 img_array_layers_n_max
;
227 u32 supported_transforms
;
228 u32 current_transform
;
229 u32 supported_composite_alpha
;
230 u32 supported_img_usage_flags
;
232 struct vk_surf_caps_t
{
235 struct vk_surf_caps_core_t core
;
237 struct vk_swpchn_create_info_t
{
241 struct vk_surf_t
*surf
;
243 u32 img_texel_mem_blk_fmt
;
245 struct vk_extent_2d_t img_extent
;
248 u32 img_sharing_mode
;
255 struct vk_swpchn_t
*old_swpchn
;
257 struct vk_img_create_info_t
{
262 u32 texel_mem_blk_fmt
;
263 struct vk_extent_3d_t extent
;
266 u32 samples_n
; /* flags */
274 struct vk_img_mem_rqmts_info_t
{
277 struct vk_img_t
*img
;
279 struct vk_mem_rqmts_core_t
{
282 /* idxs of bits are idxs in mem types of vk_phydev_mem_props_core_t */
285 struct vk_mem_rqmts_t
{
288 struct vk_mem_rqmts_core_t core
;
290 struct vk_mem_alloc_info_t
{
294 u32 mem_type_idx
; /* in the physical device array of memory types */
296 struct vk_bind_img_mem_info_t
{
299 struct vk_img_t
*img
;
300 struct vk_dev_mem_t
*mem
;
303 struct vk_img_subrsrc_range_t
{
307 u32 base_array_layer
;
310 struct vk_img_mem_barrier_t
{
319 struct vk_img_t
*img
;
320 struct vk_img_subrsrc_range_t subrsrc_range
;
322 struct vk_cb_alloc_info_t
{
329 struct vk_cb_begin_info_t
{
335 struct vk_submit_info_t
{
339 struct vk_sem_t
**wait_sems
;
340 u32
* wait_dst_stages
;
342 struct vk_cb_t
**cbs
;
344 struct vk_sem_t
**signal_sems
;
346 struct vk_img_subrsrc_t
{
351 struct vk_subrsrc_layout_t
{
358 struct vk_img_subrsrc_layers_t
{
361 u32 base_array_layer
;
364 struct vk_acquire_next_img_info_t
{
367 struct vk_swpchn_t
*swpchn
;
369 struct vk_sem_t
*sem
;
370 struct vk_fence_t
*fence
;
373 struct vk_img_blit_t
{
374 struct vk_img_subrsrc_layers_t src_subrsrc
;
375 struct vk_offset_3d_t src_offsets
[2];
376 struct vk_img_subrsrc_layers_t dst_subrsrc
;
377 struct vk_offset_3d_t dst_offsets
[2];
379 struct vk_present_info_t
{
383 struct vk_sem_t
**wait_sems
;
385 struct vk_swpchn_t
**swpchns
;
389 struct vk_sem_create_info_t
{
394 struct vk_comp_map_t
{
400 struct vk_imgview_create_info_t
{
404 struct vk_img_t
*img
;
407 struct vk_comp_map_t comps
;
408 struct vk_img_subrsrc_range_t subrsrc_range
;
410 struct vk_at_desc_t
{
419 u32 stencil_store_op
;
429 struct vk_sp_desc_t
{
436 struct vk_at_ref_t
*input_ats
;
438 struct vk_at_ref_t
*color_ats
;
439 struct vk_at_ref_t
*resolve_ats
;
440 struct vk_at_ref_t
*depth_stencil_ats
;
453 struct vk_rp_create_info_t
{
458 struct vk_at_desc_t
*ats
;
460 struct vk_sp_desc_t
*sps
;
462 struct vk_sp_dep_t
*deps
;
463 u32 correlated_viewmasks_n
;
464 u32
*correlated_viewmasks
;
466 struct vk_sp_begin_info_t
{
471 struct vk_sp_end_info_t
{
475 struct vk_fb_create_info_t
{
481 struct vk_imgview_t
*ats
;
486 struct vk_shmod_create_info_t
{
490 size_t code_sz
; /* bytes_n */
493 struct vk_pl_sh_stage_create_info_t
{
498 struct vk_shmod_t
*shmod
;
500 struct vk_specialization_t
*specialization_info
; /* later */
502 struct vk_pl_vtx_input_state_create_info_t
{
511 struct vk_pl_input_assembly_state_create_info_t
{
516 u32 prim_restart_ena
;
518 /* XXX: this does define a _transformation_ from "normalized" coords ! */
519 struct vk_viewport_t
{
527 struct vk_pl_viewport_state_create_info_t
{
532 struct vk_viewport_t
*viewports
;
534 struct vk_rect_2d_t
*scissors
;
536 struct vk_pl_raster_state_create_info_t
{
541 u32 raster_discard_ena
;
546 f32 depth_bias_constant_factor
;
547 f32 depth_bias_clamp
;
548 f32 depth_bias_slope_factor
;
551 struct vk_pl_multisample_state_create_info_t
{
555 u32 raster_samples_n
; /* flag */
556 u32 sample_shading_ena
;
557 f32 sample_shading_min
;
559 u32 alpha_to_coverage_ena
;
560 u32 alpha_to_one_ena
;
562 struct vk_pl_color_blend_at_state_t
{
565 u32 src_color_blend_factor
;
566 u32 dst_color_blend_factor
;
567 /* normalized integer */
570 u32 src_alpha_blend_factor
;
571 u32 dst_alpha_blend_factor
;
574 /* normalized integer */
575 /* XXX: must always be set, blending enabled or disabled */
576 u32 color_write_mask
;
578 struct vk_pl_color_blend_state_create_info_t
{
586 struct vk_pl_color_blend_at_state_t
*ats
;
589 struct vk_pushconst_range_t
{
594 struct vk_pl_layout_create_info_t
{
599 struct vk_dset_layout_t
**layouts
;
600 u32 pushconst_ranges_n
;
601 struct vk_pushconst_range_t
*ranges
;
603 struct vk_gfx_pl_create_info_t
{
608 struct vk_pl_sh_stage_create_info_t
*sh_stages
;
609 struct vk_pl_vtx_input_state_create_info_t
*vtx_input_state
;
610 struct vk_pl_input_assembly_state_create_info_t
*input_assembly_state
;
612 struct vk_pl_viewport_state_create_info_t
*viewport_state
;
613 struct vk_pl_raster_state_create_info_t
*raster_state
;
614 struct vk_pl_multisample_state_create_info_t
*multisample_state
;
616 struct vk_pl_color_blend_state_create_info_t
*color_blend_state
;
618 struct vk_pl_layout_t
*layout
;
621 struct vk_pl_t
*base_pl
;
624 union vk_clr_color_val_t
{
629 struct vk_clr_depth_stencil_val_t
{
634 union vk_clr_color_val_t color
;
635 struct vk_clr_depth_stencil_val_t depth_stencil
;
637 struct vk_rp_begin_info_t
{
642 struct vk_rect_2d_t render_area
;
644 union vk_clr_val_t
*clr_vals
;
646 struct vk_fence_create_info_t
{