17ec681f3Smrg/* 27ec681f3Smrg * Copyright © 2021 Raspberry Pi 37ec681f3Smrg * 47ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a 57ec681f3Smrg * copy of this software and associated documentation files (the "Software"), 67ec681f3Smrg * to deal in the Software without restriction, including without limitation 77ec681f3Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 87ec681f3Smrg * and/or sell copies of the Software, and to permit persons to whom the 97ec681f3Smrg * Software is furnished to do so, subject to the following conditions: 107ec681f3Smrg * 117ec681f3Smrg * The above copyright notice and this permission notice (including the next 127ec681f3Smrg * paragraph) shall be included in all copies or substantial portions of the 137ec681f3Smrg * Software. 147ec681f3Smrg * 157ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 177ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 187ec681f3Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 197ec681f3Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 207ec681f3Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 217ec681f3Smrg * IN THE SOFTWARE. 227ec681f3Smrg */ 237ec681f3Smrg 247ec681f3Smrg/* This file generates the per-v3d-version function prototypes. It must only 257ec681f3Smrg * be included from v3dv_private.h. 267ec681f3Smrg */ 277ec681f3Smrg 287ec681f3Smrg#ifndef V3DV_PRIVATE_H 297ec681f3Smrg#error This file is included by means other than v3dv_private.h 307ec681f3Smrg#endif 317ec681f3Smrg 327ec681f3Smrg/* Used at v3dv_cmd_buffer */ 337ec681f3Smrgvoid 347ec681f3Smrgv3dX(job_emit_binning_flush)(struct v3dv_job *job); 357ec681f3Smrg 367ec681f3Smrgvoid 377ec681f3Smrgv3dX(cmd_buffer_emit_color_write_mask)(struct v3dv_cmd_buffer *cmd_buffer); 387ec681f3Smrg 397ec681f3Smrgvoid 407ec681f3Smrgv3dX(cmd_buffer_end_render_pass_secondary)(struct v3dv_cmd_buffer *cmd_buffer); 417ec681f3Smrg 427ec681f3Smrgvoid 437ec681f3Smrgv3dX(job_emit_clip_window)(struct v3dv_job *job, const VkRect2D *rect); 447ec681f3Smrg 457ec681f3Smrgvoid 467ec681f3Smrgv3dX(cmd_buffer_emit_render_pass_rcl)(struct v3dv_cmd_buffer *cmd_buffer); 477ec681f3Smrg 487ec681f3Smrgvoid 497ec681f3Smrgv3dX(cmd_buffer_emit_viewport)(struct v3dv_cmd_buffer *cmd_buffer); 507ec681f3Smrg 517ec681f3Smrgvoid 527ec681f3Smrgv3dX(cmd_buffer_emit_stencil)(struct v3dv_cmd_buffer *cmd_buffer); 537ec681f3Smrg 547ec681f3Smrgvoid 557ec681f3Smrgv3dX(cmd_buffer_emit_depth_bias)(struct v3dv_cmd_buffer *cmd_buffer); 567ec681f3Smrg 577ec681f3Smrgvoid 587ec681f3Smrgv3dX(cmd_buffer_emit_line_width)(struct v3dv_cmd_buffer *cmd_buffer); 597ec681f3Smrg 607ec681f3Smrgvoid 617ec681f3Smrgv3dX(cmd_buffer_emit_sample_state)(struct v3dv_cmd_buffer *cmd_buffer); 627ec681f3Smrg 637ec681f3Smrgvoid 647ec681f3Smrgv3dX(cmd_buffer_emit_blend)(struct v3dv_cmd_buffer *cmd_buffer); 657ec681f3Smrg 667ec681f3Smrgvoid 677ec681f3Smrgv3dX(cmd_buffer_emit_varyings_state)(struct v3dv_cmd_buffer *cmd_buffer); 687ec681f3Smrg 697ec681f3Smrgvoid 707ec681f3Smrgv3dX(cmd_buffer_emit_configuration_bits)(struct v3dv_cmd_buffer *cmd_buffer); 717ec681f3Smrg 727ec681f3Smrgvoid 737ec681f3Smrgv3dX(job_emit_binning_prolog)(struct v3dv_job *job, 747ec681f3Smrg const struct v3dv_frame_tiling *tiling, 757ec681f3Smrg uint32_t layers); 767ec681f3Smrg 777ec681f3Smrgvoid 787ec681f3Smrgv3dX(cmd_buffer_execute_inside_pass)(struct v3dv_cmd_buffer *primary, 797ec681f3Smrg uint32_t cmd_buffer_count, 807ec681f3Smrg const VkCommandBuffer *cmd_buffers); 817ec681f3Smrg 827ec681f3Smrgvoid 837ec681f3Smrgv3dX(cmd_buffer_emit_occlusion_query)(struct v3dv_cmd_buffer *cmd_buffer); 847ec681f3Smrg 857ec681f3Smrgvoid 867ec681f3Smrgv3dX(cmd_buffer_emit_gl_shader_state)(struct v3dv_cmd_buffer *cmd_buffer); 877ec681f3Smrg 887ec681f3Smrg 897ec681f3Smrgvoid 907ec681f3Smrgv3dX(cmd_buffer_emit_draw)(struct v3dv_cmd_buffer *cmd_buffer, 917ec681f3Smrg struct v3dv_draw_info *info); 927ec681f3Smrg 937ec681f3Smrg 947ec681f3Smrgvoid 957ec681f3Smrgv3dX(cmd_buffer_emit_index_buffer)(struct v3dv_cmd_buffer *cmd_buffer); 967ec681f3Smrg 977ec681f3Smrgvoid 987ec681f3Smrgv3dX(cmd_buffer_emit_draw_indexed)(struct v3dv_cmd_buffer *cmd_buffer, 997ec681f3Smrg uint32_t indexCount, 1007ec681f3Smrg uint32_t instanceCount, 1017ec681f3Smrg uint32_t firstIndex, 1027ec681f3Smrg int32_t vertexOffset, 1037ec681f3Smrg uint32_t firstInstance); 1047ec681f3Smrg 1057ec681f3Smrgvoid 1067ec681f3Smrgv3dX(cmd_buffer_emit_draw_indirect)(struct v3dv_cmd_buffer *cmd_buffer, 1077ec681f3Smrg struct v3dv_buffer *buffer, 1087ec681f3Smrg VkDeviceSize offset, 1097ec681f3Smrg uint32_t drawCount, 1107ec681f3Smrg uint32_t stride); 1117ec681f3Smrg 1127ec681f3Smrgvoid 1137ec681f3Smrgv3dX(cmd_buffer_emit_indexed_indirect)(struct v3dv_cmd_buffer *cmd_buffer, 1147ec681f3Smrg struct v3dv_buffer *buffer, 1157ec681f3Smrg VkDeviceSize offset, 1167ec681f3Smrg uint32_t drawCount, 1177ec681f3Smrg uint32_t stride); 1187ec681f3Smrg 1197ec681f3Smrgvoid 1207ec681f3Smrgv3dX(get_hw_clear_color)(const VkClearColorValue *color, 1217ec681f3Smrg uint32_t internal_type, 1227ec681f3Smrg uint32_t internal_size, 1237ec681f3Smrg uint32_t *hw_color); 1247ec681f3Smrg 1257ec681f3Smrgvoid 1267ec681f3Smrgv3dX(cmd_buffer_render_pass_setup_render_target)(struct v3dv_cmd_buffer *cmd_buffer, 1277ec681f3Smrg int rt, 1287ec681f3Smrg uint32_t *rt_bpp, 1297ec681f3Smrg uint32_t *rt_type, 1307ec681f3Smrg uint32_t *rt_clamp); 1317ec681f3Smrg 1327ec681f3Smrg/* Used at v3dv_device */ 1337ec681f3Smrg 1347ec681f3Smrgvoid 1357ec681f3Smrgv3dX(pack_sampler_state)(struct v3dv_sampler *sampler, 1367ec681f3Smrg const VkSamplerCreateInfo *pCreateInfo, 1377ec681f3Smrg const VkSamplerCustomBorderColorCreateInfoEXT *bc_info); 1387ec681f3Smrg 1397ec681f3Smrgvoid 1407ec681f3Smrgv3dX(framebuffer_compute_internal_bpp_msaa)(const struct v3dv_framebuffer *framebuffer, 1417ec681f3Smrg const struct v3dv_subpass *subpass, 1427ec681f3Smrg uint8_t *max_bpp, bool *msaa); 1437ec681f3Smrg 1447ec681f3Smrg#ifdef DEBUG 1457ec681f3Smrgvoid 1467ec681f3Smrgv3dX(device_check_prepacked_sizes)(void); 1477ec681f3Smrg#endif 1487ec681f3Smrg 1497ec681f3Smrg/* Used at v3dv_format */ 1507ec681f3Smrgconst struct v3dv_format * 1517ec681f3Smrgv3dX(get_format)(VkFormat); 1527ec681f3Smrg 1537ec681f3Smrgvoid 1547ec681f3Smrgv3dX(get_internal_type_bpp_for_output_format)(uint32_t format, 1557ec681f3Smrg uint32_t *type, 1567ec681f3Smrg uint32_t *bpp); 1577ec681f3Smrg 1587ec681f3Smrgbool 1597ec681f3Smrgv3dX(format_supports_tlb_resolve)(const struct v3dv_format *format); 1607ec681f3Smrg 1617ec681f3Smrgbool 1627ec681f3Smrgv3dX(format_supports_blending)(const struct v3dv_format *format); 1637ec681f3Smrg 1647ec681f3Smrgbool 1657ec681f3Smrgv3dX(tfu_supports_tex_format)(uint32_t tex_format); 1667ec681f3Smrg 1677ec681f3Smrg/* Used at v3dv_image */ 1687ec681f3Smrg 1697ec681f3Smrgvoid 1707ec681f3Smrgv3dX(pack_texture_shader_state)(struct v3dv_device *device, 1717ec681f3Smrg struct v3dv_image_view *iview); 1727ec681f3Smrg 1737ec681f3Smrgvoid 1747ec681f3Smrgv3dX(pack_texture_shader_state_from_buffer_view)(struct v3dv_device *device, 1757ec681f3Smrg struct v3dv_buffer_view *buffer_view); 1767ec681f3Smrg 1777ec681f3Smrg/* Used at v3dv_meta_* */ 1787ec681f3Smrg 1797ec681f3Smrguint32_t 1807ec681f3Smrgv3dX(zs_buffer_from_aspect_bits)(VkImageAspectFlags aspects); 1817ec681f3Smrg 1827ec681f3Smrguint8_t 1837ec681f3Smrgv3dX(get_internal_depth_type)(VkFormat format); 1847ec681f3Smrg 1857ec681f3Smrgstruct v3dv_meta_framebuffer; 1867ec681f3Smrg 1877ec681f3Smrgvoid 1887ec681f3Smrgv3dX(meta_emit_copy_image_to_buffer_rcl)(struct v3dv_job *job, 1897ec681f3Smrg struct v3dv_buffer *buffer, 1907ec681f3Smrg struct v3dv_image *image, 1917ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 1927ec681f3Smrg const VkBufferImageCopy2KHR *region); 1937ec681f3Smrg 1947ec681f3Smrgvoid 1957ec681f3Smrgv3dX(meta_emit_resolve_image_rcl)(struct v3dv_job *job, 1967ec681f3Smrg struct v3dv_image *dst, 1977ec681f3Smrg struct v3dv_image *src, 1987ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 1997ec681f3Smrg const VkImageResolve2KHR *region); 2007ec681f3Smrg 2017ec681f3Smrgvoid 2027ec681f3Smrgv3dX(meta_emit_copy_buffer)(struct v3dv_job *job, 2037ec681f3Smrg struct v3dv_bo *dst, 2047ec681f3Smrg struct v3dv_bo *src, 2057ec681f3Smrg uint32_t dst_offset, 2067ec681f3Smrg uint32_t src_offset, 2077ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2087ec681f3Smrg uint32_t format, 2097ec681f3Smrg uint32_t item_size); 2107ec681f3Smrg 2117ec681f3Smrgvoid 2127ec681f3Smrgv3dX(meta_emit_copy_buffer_rcl)(struct v3dv_job *job, 2137ec681f3Smrg struct v3dv_bo *dst, 2147ec681f3Smrg struct v3dv_bo *src, 2157ec681f3Smrg uint32_t dst_offset, 2167ec681f3Smrg uint32_t src_offset, 2177ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2187ec681f3Smrg uint32_t format, 2197ec681f3Smrg uint32_t item_size); 2207ec681f3Smrg 2217ec681f3Smrgvoid 2227ec681f3Smrgv3dX(meta_emit_copy_image_rcl)(struct v3dv_job *job, 2237ec681f3Smrg struct v3dv_image *dst, 2247ec681f3Smrg struct v3dv_image *src, 2257ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2267ec681f3Smrg const VkImageCopy2KHR *region); 2277ec681f3Smrg 2287ec681f3Smrgvoid 2297ec681f3Smrgv3dX(meta_emit_tfu_job)(struct v3dv_cmd_buffer *cmd_buffer, 2307ec681f3Smrg struct v3dv_image *dst, 2317ec681f3Smrg uint32_t dst_mip_level, 2327ec681f3Smrg uint32_t dst_layer, 2337ec681f3Smrg struct v3dv_image *src, 2347ec681f3Smrg uint32_t src_mip_level, 2357ec681f3Smrg uint32_t src_layer, 2367ec681f3Smrg uint32_t width, 2377ec681f3Smrg uint32_t height, 2387ec681f3Smrg const struct v3dv_format *format); 2397ec681f3Smrg 2407ec681f3Smrgvoid 2417ec681f3Smrgv3dX(meta_emit_clear_image_rcl)(struct v3dv_job *job, 2427ec681f3Smrg struct v3dv_image *image, 2437ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2447ec681f3Smrg const union v3dv_clear_value *clear_value, 2457ec681f3Smrg VkImageAspectFlags aspects, 2467ec681f3Smrg uint32_t min_layer, 2477ec681f3Smrg uint32_t max_layer, 2487ec681f3Smrg uint32_t level); 2497ec681f3Smrg 2507ec681f3Smrgvoid 2517ec681f3Smrgv3dX(meta_emit_fill_buffer_rcl)(struct v3dv_job *job, 2527ec681f3Smrg struct v3dv_bo *bo, 2537ec681f3Smrg uint32_t offset, 2547ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2557ec681f3Smrg uint32_t data); 2567ec681f3Smrg 2577ec681f3Smrgvoid 2587ec681f3Smrgv3dX(meta_emit_copy_buffer_to_image_rcl)(struct v3dv_job *job, 2597ec681f3Smrg struct v3dv_image *image, 2607ec681f3Smrg struct v3dv_buffer *buffer, 2617ec681f3Smrg struct v3dv_meta_framebuffer *framebuffer, 2627ec681f3Smrg const VkBufferImageCopy2KHR *region); 2637ec681f3Smrg 2647ec681f3Smrgvoid 2657ec681f3Smrgv3dX(get_internal_type_bpp_for_image_aspects)(VkFormat vk_format, 2667ec681f3Smrg VkImageAspectFlags aspect_mask, 2677ec681f3Smrg uint32_t *internal_type, 2687ec681f3Smrg uint32_t *internal_bpp); 2697ec681f3Smrg 2707ec681f3Smrgstruct v3dv_job * 2717ec681f3Smrgv3dX(meta_copy_buffer)(struct v3dv_cmd_buffer *cmd_buffer, 2727ec681f3Smrg struct v3dv_bo *dst, 2737ec681f3Smrg uint32_t dst_offset, 2747ec681f3Smrg struct v3dv_bo *src, 2757ec681f3Smrg uint32_t src_offset, 2767ec681f3Smrg const VkBufferCopy2KHR *region); 2777ec681f3Smrg 2787ec681f3Smrgvoid 2797ec681f3Smrgv3dX(meta_fill_buffer)(struct v3dv_cmd_buffer *cmd_buffer, 2807ec681f3Smrg struct v3dv_bo *bo, 2817ec681f3Smrg uint32_t offset, 2827ec681f3Smrg uint32_t size, 2837ec681f3Smrg uint32_t data); 2847ec681f3Smrg 2857ec681f3Smrgvoid 2867ec681f3Smrgv3dX(meta_framebuffer_init)(struct v3dv_meta_framebuffer *fb, 2877ec681f3Smrg VkFormat vk_format, 2887ec681f3Smrg uint32_t internal_type, 2897ec681f3Smrg const struct v3dv_frame_tiling *tiling); 2907ec681f3Smrg 2917ec681f3Smrg/* Used at v3dv_pipeline */ 2927ec681f3Smrgvoid 2937ec681f3Smrgv3dX(pipeline_pack_state)(struct v3dv_pipeline *pipeline, 2947ec681f3Smrg const VkPipelineColorBlendStateCreateInfo *cb_info, 2957ec681f3Smrg const VkPipelineDepthStencilStateCreateInfo *ds_info, 2967ec681f3Smrg const VkPipelineRasterizationStateCreateInfo *rs_info, 2977ec681f3Smrg const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *pv_info, 2987ec681f3Smrg const VkPipelineMultisampleStateCreateInfo *ms_info); 2997ec681f3Smrgvoid 3007ec681f3Smrgv3dX(pipeline_pack_compile_state)(struct v3dv_pipeline *pipeline, 3017ec681f3Smrg const VkPipelineVertexInputStateCreateInfo *vi_info, 3027ec681f3Smrg const VkPipelineVertexInputDivisorStateCreateInfoEXT *vd_info); 3037ec681f3Smrg/* Used at v3dv_queue */ 3047ec681f3Smrgvoid 3057ec681f3Smrgv3dX(job_emit_noop)(struct v3dv_job *job); 3067ec681f3Smrg 3077ec681f3Smrg/* Used at v3dv_descriptor_set, and other descriptor set utils */ 3087ec681f3Smrguint32_t v3dX(descriptor_bo_size)(VkDescriptorType type); 3097ec681f3Smrg 3107ec681f3Smrguint32_t v3dX(max_descriptor_bo_size)(void); 3117ec681f3Smrg 3127ec681f3Smrguint32_t v3dX(combined_image_sampler_texture_state_offset)(void); 3137ec681f3Smrg 3147ec681f3Smrguint32_t v3dX(combined_image_sampler_sampler_state_offset)(void); 315