17ec681f3Smrg/*
27ec681f3Smrg * Copyright 2019 Google LLC
37ec681f3Smrg * SPDX-License-Identifier: MIT
47ec681f3Smrg *
57ec681f3Smrg * based in part on anv and radv which are:
67ec681f3Smrg * Copyright © 2015 Intel Corporation
77ec681f3Smrg * Copyright © 2016 Red Hat.
87ec681f3Smrg * Copyright © 2016 Bas Nieuwenhuizen
97ec681f3Smrg */
107ec681f3Smrg
117ec681f3Smrg#ifndef VN_RENDER_PASS_H
127ec681f3Smrg#define VN_RENDER_PASS_H
137ec681f3Smrg
147ec681f3Smrg#include "vn_common.h"
157ec681f3Smrg
167ec681f3Smrgstruct vn_present_src_attachment {
177ec681f3Smrg   bool acquire;
187ec681f3Smrg   uint32_t index;
197ec681f3Smrg
207ec681f3Smrg   VkPipelineStageFlags src_stage_mask;
217ec681f3Smrg   VkAccessFlags src_access_mask;
227ec681f3Smrg
237ec681f3Smrg   VkPipelineStageFlags dst_stage_mask;
247ec681f3Smrg   VkAccessFlags dst_access_mask;
257ec681f3Smrg};
267ec681f3Smrg
277ec681f3Smrgstruct vn_render_pass {
287ec681f3Smrg   struct vn_object_base base;
297ec681f3Smrg
307ec681f3Smrg   VkExtent2D granularity;
317ec681f3Smrg
327ec681f3Smrg   /* track attachments that have PRESENT_SRC as their initialLayout or
337ec681f3Smrg    * finalLayout
347ec681f3Smrg    */
357ec681f3Smrg   uint32_t acquire_count;
367ec681f3Smrg   uint32_t release_count;
377ec681f3Smrg   uint32_t present_src_count;
387ec681f3Smrg   struct vn_present_src_attachment present_src_attachments[];
397ec681f3Smrg};
407ec681f3SmrgVK_DEFINE_NONDISP_HANDLE_CASTS(vn_render_pass,
417ec681f3Smrg                               base.base,
427ec681f3Smrg                               VkRenderPass,
437ec681f3Smrg                               VK_OBJECT_TYPE_RENDER_PASS)
447ec681f3Smrg
457ec681f3Smrgstruct vn_framebuffer {
467ec681f3Smrg   struct vn_object_base base;
477ec681f3Smrg
487ec681f3Smrg   uint32_t image_view_count;
497ec681f3Smrg   VkImageView image_views[];
507ec681f3Smrg};
517ec681f3SmrgVK_DEFINE_NONDISP_HANDLE_CASTS(vn_framebuffer,
527ec681f3Smrg                               base.base,
537ec681f3Smrg                               VkFramebuffer,
547ec681f3Smrg                               VK_OBJECT_TYPE_FRAMEBUFFER)
557ec681f3Smrg
567ec681f3Smrg#endif /* VN_RENDER_PASS_H */
57