Path: blob/21.2-virgl/src/amd/vulkan/radv_pass.c
7170 views
/*1* Copyright © 2016 Red Hat.2* Copyright © 2016 Bas Nieuwenhuizen3*4* based in part on anv driver which is:5* Copyright © 2015 Intel Corporation6*7* Permission is hereby granted, free of charge, to any person obtaining a8* copy of this software and associated documentation files (the "Software"),9* to deal in the Software without restriction, including without limitation10* the rights to use, copy, modify, merge, publish, distribute, sublicense,11* and/or sell copies of the Software, and to permit persons to whom the12* Software is furnished to do so, subject to the following conditions:13*14* The above copyright notice and this permission notice (including the next15* paragraph) shall be included in all copies or substantial portions of the16* Software.17*18* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR19* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,20* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL21* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER22* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING23* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS24* IN THE SOFTWARE.25*/26#include "radv_private.h"2728#include "vk_util.h"2930static void31radv_render_pass_add_subpass_dep(struct radv_render_pass *pass, const VkSubpassDependency2 *dep)32{33uint32_t src = dep->srcSubpass;34uint32_t dst = dep->dstSubpass;3536/* Ignore subpass self-dependencies as they allow the app to call37* vkCmdPipelineBarrier() inside the render pass and the driver should38* only do the barrier when called, not when starting the render pass.39*/40if (src == dst)41return;4243/* Accumulate all ingoing external dependencies to the first subpass. */44if (src == VK_SUBPASS_EXTERNAL)45dst = 0;4647if (dst == VK_SUBPASS_EXTERNAL) {48if (dep->dstStageMask != VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT)49pass->end_barrier.src_stage_mask |= dep->srcStageMask;50pass->end_barrier.src_access_mask |= dep->srcAccessMask;51pass->end_barrier.dst_access_mask |= dep->dstAccessMask;52} else {53if (dep->dstStageMask != VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT)54pass->subpasses[dst].start_barrier.src_stage_mask |= dep->srcStageMask;55pass->subpasses[dst].start_barrier.src_access_mask |= dep->srcAccessMask;56pass->subpasses[dst].start_barrier.dst_access_mask |= dep->dstAccessMask;57}58}5960static void61radv_render_pass_add_implicit_deps(struct radv_render_pass *pass)62{63/* From the Vulkan 1.0.39 spec:64*65* If there is no subpass dependency from VK_SUBPASS_EXTERNAL to the66* first subpass that uses an attachment, then an implicit subpass67* dependency exists from VK_SUBPASS_EXTERNAL to the first subpass it is68* used in. The implicit subpass dependency only exists if there69* exists an automatic layout transition away from initialLayout.70* The subpass dependency operates as if defined with the71* following parameters:72*73* VkSubpassDependency implicitDependency = {74* .srcSubpass = VK_SUBPASS_EXTERNAL;75* .dstSubpass = firstSubpass; // First subpass attachment is used in76* .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;77* .dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;78* .srcAccessMask = 0;79* .dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |80* VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |81* VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |82* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |83* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;84* .dependencyFlags = 0;85* };86*87* Similarly, if there is no subpass dependency from the last subpass88* that uses an attachment to VK_SUBPASS_EXTERNAL, then an implicit89* subpass dependency exists from the last subpass it is used in to90* VK_SUBPASS_EXTERNAL. The implicit subpass dependency only exists91* if there exists an automatic layout transition into finalLayout.92* The subpass dependency operates as if defined with the following93* parameters:94*95* VkSubpassDependency implicitDependency = {96* .srcSubpass = lastSubpass; // Last subpass attachment is used in97* .dstSubpass = VK_SUBPASS_EXTERNAL;98* .srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;99* .dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;100* .srcAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |101* VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |102* VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |103* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |104* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;105* .dstAccessMask = 0;106* .dependencyFlags = 0;107* };108*/109for (uint32_t i = 0; i < pass->subpass_count; i++) {110struct radv_subpass *subpass = &pass->subpasses[i];111bool add_ingoing_dep = false, add_outgoing_dep = false;112113for (uint32_t j = 0; j < subpass->attachment_count; j++) {114struct radv_subpass_attachment *subpass_att = &subpass->attachments[j];115if (subpass_att->attachment == VK_ATTACHMENT_UNUSED)116continue;117118struct radv_render_pass_attachment *pass_att = &pass->attachments[subpass_att->attachment];119uint32_t initial_layout = pass_att->initial_layout;120uint32_t stencil_initial_layout = pass_att->stencil_initial_layout;121uint32_t final_layout = pass_att->final_layout;122uint32_t stencil_final_layout = pass_att->stencil_final_layout;123124/* The implicit subpass dependency only exists if125* there exists an automatic layout transition away126* from initialLayout.127*/128if (pass_att->first_subpass_idx == i && !subpass->has_ingoing_dep &&129((subpass_att->layout != initial_layout) ||130(subpass_att->layout != stencil_initial_layout))) {131add_ingoing_dep = true;132}133134/* The implicit subpass dependency only exists if135* there exists an automatic layout transition into136* finalLayout.137*/138if (pass_att->last_subpass_idx == i && !subpass->has_outgoing_dep &&139((subpass_att->layout != final_layout) ||140(subpass_att->layout != stencil_final_layout))) {141add_outgoing_dep = true;142}143}144145if (add_ingoing_dep) {146const VkSubpassDependency2KHR implicit_ingoing_dep = {147.srcSubpass = VK_SUBPASS_EXTERNAL,148.dstSubpass = i, /* first subpass attachment is used in */149.srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,150.dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,151.srcAccessMask = 0,152.dstAccessMask =153VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |154VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |155VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,156.dependencyFlags = 0,157};158159radv_render_pass_add_subpass_dep(pass, &implicit_ingoing_dep);160}161162if (add_outgoing_dep) {163const VkSubpassDependency2KHR implicit_outgoing_dep = {164.srcSubpass = i, /* last subpass attachment is used in */165.dstSubpass = VK_SUBPASS_EXTERNAL,166.srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,167.dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,168.srcAccessMask =169VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |170VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |171VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,172.dstAccessMask = 0,173.dependencyFlags = 0,174};175176radv_render_pass_add_subpass_dep(pass, &implicit_outgoing_dep);177}178}179}180181static void182radv_render_pass_compile(struct radv_render_pass *pass)183{184for (uint32_t i = 0; i < pass->subpass_count; i++) {185struct radv_subpass *subpass = &pass->subpasses[i];186187for (uint32_t j = 0; j < subpass->attachment_count; j++) {188struct radv_subpass_attachment *subpass_att = &subpass->attachments[j];189if (subpass_att->attachment == VK_ATTACHMENT_UNUSED)190continue;191192struct radv_render_pass_attachment *pass_att = &pass->attachments[subpass_att->attachment];193194pass_att->first_subpass_idx = VK_SUBPASS_EXTERNAL;195pass_att->last_subpass_idx = VK_SUBPASS_EXTERNAL;196}197}198199for (uint32_t i = 0; i < pass->subpass_count; i++) {200struct radv_subpass *subpass = &pass->subpasses[i];201uint32_t color_sample_count = 1, depth_sample_count = 1;202203/* We don't allow depth_stencil_attachment to be non-NULL and204* be VK_ATTACHMENT_UNUSED. This way something can just check205* for NULL and be guaranteed that they have a valid206* attachment.207*/208if (subpass->depth_stencil_attachment &&209subpass->depth_stencil_attachment->attachment == VK_ATTACHMENT_UNUSED)210subpass->depth_stencil_attachment = NULL;211212if (subpass->ds_resolve_attachment &&213subpass->ds_resolve_attachment->attachment == VK_ATTACHMENT_UNUSED)214subpass->ds_resolve_attachment = NULL;215216if (subpass->vrs_attachment && subpass->vrs_attachment->attachment == VK_ATTACHMENT_UNUSED)217subpass->vrs_attachment = NULL;218219for (uint32_t j = 0; j < subpass->attachment_count; j++) {220struct radv_subpass_attachment *subpass_att = &subpass->attachments[j];221if (subpass_att->attachment == VK_ATTACHMENT_UNUSED)222continue;223224struct radv_render_pass_attachment *pass_att = &pass->attachments[subpass_att->attachment];225226if (i < pass_att->first_subpass_idx)227pass_att->first_subpass_idx = i;228pass_att->last_subpass_idx = i;229}230231subpass->has_color_att = false;232for (uint32_t j = 0; j < subpass->color_count; j++) {233struct radv_subpass_attachment *subpass_att = &subpass->color_attachments[j];234if (subpass_att->attachment == VK_ATTACHMENT_UNUSED)235continue;236237subpass->has_color_att = true;238239struct radv_render_pass_attachment *pass_att = &pass->attachments[subpass_att->attachment];240241color_sample_count = pass_att->samples;242}243244if (subpass->depth_stencil_attachment) {245const uint32_t a = subpass->depth_stencil_attachment->attachment;246struct radv_render_pass_attachment *pass_att = &pass->attachments[a];247depth_sample_count = pass_att->samples;248}249250subpass->max_sample_count = MAX2(color_sample_count, depth_sample_count);251subpass->color_sample_count = color_sample_count;252subpass->depth_sample_count = depth_sample_count;253254/* We have to handle resolve attachments specially */255subpass->has_color_resolve = false;256if (subpass->resolve_attachments) {257for (uint32_t j = 0; j < subpass->color_count; j++) {258struct radv_subpass_attachment *resolve_att = &subpass->resolve_attachments[j];259260if (resolve_att->attachment == VK_ATTACHMENT_UNUSED)261continue;262263subpass->has_color_resolve = true;264}265}266267for (uint32_t j = 0; j < subpass->input_count; ++j) {268if (subpass->input_attachments[j].attachment == VK_ATTACHMENT_UNUSED)269continue;270271for (uint32_t k = 0; k < subpass->color_count; ++k) {272if (subpass->color_attachments[k].attachment ==273subpass->input_attachments[j].attachment) {274subpass->input_attachments[j].in_render_loop = true;275subpass->color_attachments[k].in_render_loop = true;276}277}278279if (subpass->depth_stencil_attachment && subpass->depth_stencil_attachment->attachment ==280subpass->input_attachments[j].attachment) {281subpass->input_attachments[j].in_render_loop = true;282subpass->depth_stencil_attachment->in_render_loop = true;283}284}285}286}287288static void289radv_destroy_render_pass(struct radv_device *device, const VkAllocationCallbacks *pAllocator,290struct radv_render_pass *pass)291{292vk_object_base_finish(&pass->base);293vk_free2(&device->vk.alloc, pAllocator, pass->subpass_attachments);294vk_free2(&device->vk.alloc, pAllocator, pass);295}296297static unsigned298radv_num_subpass_attachments2(const VkSubpassDescription2 *desc)299{300const VkSubpassDescriptionDepthStencilResolve *ds_resolve =301vk_find_struct_const(desc->pNext, SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);302const VkFragmentShadingRateAttachmentInfoKHR *vrs =303vk_find_struct_const(desc->pNext, FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR);304305return desc->inputAttachmentCount + desc->colorAttachmentCount +306(desc->pResolveAttachments ? desc->colorAttachmentCount : 0) +307(desc->pDepthStencilAttachment != NULL) +308(ds_resolve && ds_resolve->pDepthStencilResolveAttachment) +309(vrs && vrs->pFragmentShadingRateAttachment);310}311312static bool313vk_image_layout_depth_only(VkImageLayout layout)314{315switch (layout) {316case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL:317case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL:318return true;319default:320return false;321}322}323324/* From the Vulkan Specification 1.2.166 - VkAttachmentReference2:325*326* "If layout only specifies the layout of the depth aspect of the attachment,327* the layout of the stencil aspect is specified by the stencilLayout member328* of a VkAttachmentReferenceStencilLayout structure included in the pNext329* chain. Otherwise, layout describes the layout for all relevant image330* aspects."331*/332static VkImageLayout333stencil_ref_layout(const VkAttachmentReference2 *att_ref)334{335if (!vk_image_layout_depth_only(att_ref->layout))336return att_ref->layout;337338const VkAttachmentReferenceStencilLayoutKHR *stencil_ref =339vk_find_struct_const(att_ref->pNext, ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR);340if (!stencil_ref)341return VK_IMAGE_LAYOUT_UNDEFINED;342343return stencil_ref->stencilLayout;344}345346/* From the Vulkan Specification 1.2.184:347*348* "If the pNext chain includes a VkAttachmentDescriptionStencilLayout structure, then the349* stencilInitialLayout and stencilFinalLayout members specify the initial and final layouts of the350* stencil aspect of a depth/stencil format, and initialLayout and finalLayout only apply to the351* depth aspect. For depth-only formats, the VkAttachmentDescriptionStencilLayout structure is352* ignored. For stencil-only formats, the initial and final layouts of the stencil aspect are taken353* from the VkAttachmentDescriptionStencilLayout structure if present, or initialLayout and354* finalLayout if not present."355*356* "If format is a depth/stencil format, and either initialLayout or finalLayout does not specify a357* layout for the stencil aspect, then the application must specify the initial and final layouts358* of the stencil aspect by including a VkAttachmentDescriptionStencilLayout structure in the pNext359* chain."360*/361static VkImageLayout362stencil_desc_layout(const VkAttachmentDescription2KHR *att_desc, bool final)363{364const struct util_format_description *desc = vk_format_description(att_desc->format);365if (!util_format_has_stencil(desc))366return VK_IMAGE_LAYOUT_UNDEFINED;367368const VkAttachmentDescriptionStencilLayoutKHR *stencil_desc =369vk_find_struct_const(att_desc->pNext, ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR);370371if (stencil_desc)372return final ? stencil_desc->stencilFinalLayout : stencil_desc->stencilInitialLayout;373return final ? att_desc->finalLayout : att_desc->initialLayout;374}375376VkResult377radv_CreateRenderPass2(VkDevice _device, const VkRenderPassCreateInfo2 *pCreateInfo,378const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass)379{380RADV_FROM_HANDLE(radv_device, device, _device);381struct radv_render_pass *pass;382size_t size;383size_t attachments_offset;384385assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2);386387size = sizeof(*pass);388size += pCreateInfo->subpassCount * sizeof(pass->subpasses[0]);389attachments_offset = size;390size += pCreateInfo->attachmentCount * sizeof(pass->attachments[0]);391392pass = vk_alloc2(&device->vk.alloc, pAllocator, size, 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);393if (pass == NULL)394return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);395396memset(pass, 0, size);397398vk_object_base_init(&device->vk, &pass->base, VK_OBJECT_TYPE_RENDER_PASS);399400pass->attachment_count = pCreateInfo->attachmentCount;401pass->subpass_count = pCreateInfo->subpassCount;402pass->attachments = (struct radv_render_pass_attachment *)((uint8_t *)pass + attachments_offset);403404for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {405struct radv_render_pass_attachment *att = &pass->attachments[i];406407att->format = pCreateInfo->pAttachments[i].format;408att->samples = pCreateInfo->pAttachments[i].samples;409att->load_op = pCreateInfo->pAttachments[i].loadOp;410att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;411att->initial_layout = pCreateInfo->pAttachments[i].initialLayout;412att->final_layout = pCreateInfo->pAttachments[i].finalLayout;413att->stencil_initial_layout = stencil_desc_layout(&pCreateInfo->pAttachments[i], false);414att->stencil_final_layout = stencil_desc_layout(&pCreateInfo->pAttachments[i], true);415// att->store_op = pCreateInfo->pAttachments[i].storeOp;416// att->stencil_store_op = pCreateInfo->pAttachments[i].stencilStoreOp;417}418uint32_t subpass_attachment_count = 0;419struct radv_subpass_attachment *p;420for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) {421subpass_attachment_count += radv_num_subpass_attachments2(&pCreateInfo->pSubpasses[i]);422}423424if (subpass_attachment_count) {425pass->subpass_attachments =426vk_alloc2(&device->vk.alloc, pAllocator,427subpass_attachment_count * sizeof(struct radv_subpass_attachment), 8,428VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);429if (pass->subpass_attachments == NULL) {430radv_destroy_render_pass(device, pAllocator, pass);431return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);432}433} else434pass->subpass_attachments = NULL;435436p = pass->subpass_attachments;437for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) {438const VkSubpassDescription2 *desc = &pCreateInfo->pSubpasses[i];439struct radv_subpass *subpass = &pass->subpasses[i];440441subpass->input_count = desc->inputAttachmentCount;442subpass->color_count = desc->colorAttachmentCount;443subpass->attachment_count = radv_num_subpass_attachments2(desc);444subpass->attachments = p;445subpass->view_mask = desc->viewMask;446447if (desc->inputAttachmentCount > 0) {448subpass->input_attachments = p;449p += desc->inputAttachmentCount;450451for (uint32_t j = 0; j < desc->inputAttachmentCount; j++) {452subpass->input_attachments[j] = (struct radv_subpass_attachment){453.attachment = desc->pInputAttachments[j].attachment,454.layout = desc->pInputAttachments[j].layout,455.stencil_layout = stencil_ref_layout(&desc->pInputAttachments[j]),456};457}458}459460if (desc->colorAttachmentCount > 0) {461subpass->color_attachments = p;462p += desc->colorAttachmentCount;463464for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {465subpass->color_attachments[j] = (struct radv_subpass_attachment){466.attachment = desc->pColorAttachments[j].attachment,467.layout = desc->pColorAttachments[j].layout,468};469}470}471472if (desc->pResolveAttachments) {473subpass->resolve_attachments = p;474p += desc->colorAttachmentCount;475476for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {477subpass->resolve_attachments[j] = (struct radv_subpass_attachment){478.attachment = desc->pResolveAttachments[j].attachment,479.layout = desc->pResolveAttachments[j].layout,480};481}482}483484if (desc->pDepthStencilAttachment) {485subpass->depth_stencil_attachment = p++;486487*subpass->depth_stencil_attachment = (struct radv_subpass_attachment){488.attachment = desc->pDepthStencilAttachment->attachment,489.layout = desc->pDepthStencilAttachment->layout,490.stencil_layout = stencil_ref_layout(desc->pDepthStencilAttachment),491};492}493494const VkSubpassDescriptionDepthStencilResolve *ds_resolve =495vk_find_struct_const(desc->pNext, SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);496497if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment) {498subpass->ds_resolve_attachment = p++;499500*subpass->ds_resolve_attachment = (struct radv_subpass_attachment){501.attachment = ds_resolve->pDepthStencilResolveAttachment->attachment,502.layout = ds_resolve->pDepthStencilResolveAttachment->layout,503.stencil_layout = stencil_ref_layout(ds_resolve->pDepthStencilResolveAttachment),504};505506subpass->depth_resolve_mode = ds_resolve->depthResolveMode;507subpass->stencil_resolve_mode = ds_resolve->stencilResolveMode;508}509510const VkFragmentShadingRateAttachmentInfoKHR *vrs =511vk_find_struct_const(desc->pNext, FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR);512513if (vrs && vrs->pFragmentShadingRateAttachment) {514subpass->vrs_attachment = p++;515516*subpass->vrs_attachment = (struct radv_subpass_attachment){517.attachment = vrs->pFragmentShadingRateAttachment->attachment,518.layout = vrs->pFragmentShadingRateAttachment->layout,519};520}521}522523for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {524const VkSubpassDependency2 *dep = &pCreateInfo->pDependencies[i];525526radv_render_pass_add_subpass_dep(pass, &pCreateInfo->pDependencies[i]);527528/* Determine if the subpass has explicit dependencies from/to529* VK_SUBPASS_EXTERNAL.530*/531if (dep->srcSubpass == VK_SUBPASS_EXTERNAL && dep->dstSubpass != VK_SUBPASS_EXTERNAL) {532pass->subpasses[dep->dstSubpass].has_ingoing_dep = true;533}534535if (dep->dstSubpass == VK_SUBPASS_EXTERNAL && dep->srcSubpass != VK_SUBPASS_EXTERNAL) {536pass->subpasses[dep->srcSubpass].has_outgoing_dep = true;537}538}539540radv_render_pass_compile(pass);541542radv_render_pass_add_implicit_deps(pass);543544*pRenderPass = radv_render_pass_to_handle(pass);545546return VK_SUCCESS;547}548549void550radv_DestroyRenderPass(VkDevice _device, VkRenderPass _pass,551const VkAllocationCallbacks *pAllocator)552{553RADV_FROM_HANDLE(radv_device, device, _device);554RADV_FROM_HANDLE(radv_render_pass, pass, _pass);555556if (!_pass)557return;558559radv_destroy_render_pass(device, pAllocator, pass);560}561562void563radv_GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity)564{565pGranularity->width = 1;566pGranularity->height = 1;567}568569570