attachments_offset = size;
size += pCreateInfo->attachmentCount * sizeof(pass->attachments[0]);
- pass = anv_alloc2(&device->alloc, pAllocator, size, 8,
+ pass = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
pass->subpass_attachments =
- anv_alloc2(&device->alloc, pAllocator,
+ vk_alloc2(&device->alloc, pAllocator,
subpass_attachment_count * sizeof(uint32_t), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass->subpass_attachments == NULL) {
- anv_free2(&device->alloc, pAllocator, pass);
+ vk_free2(&device->alloc, pAllocator, pass);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_render_pass, pass, _pass);
- anv_free2(&device->alloc, pAllocator, pass->subpass_attachments);
- anv_free2(&device->alloc, pAllocator, pass);
+ vk_free2(&device->alloc, pAllocator, pass->subpass_attachments);
+ vk_free2(&device->alloc, pAllocator, pass);
}
void anv_GetRenderAreaGranularity(
VkRenderPass renderPass,
VkExtent2D* pGranularity)
{
+ ANV_FROM_HANDLE(anv_render_pass, pass, renderPass);
+
+ /* This granularity satisfies HiZ fast clear alignment requirements
+ * for all sample counts.
+ */
+ for (unsigned i = 0; i < pass->subpass_count; ++i) {
+ if (pass->subpasses[i].depth_stencil_attachment !=
+ VK_ATTACHMENT_UNUSED) {
+ *pGranularity = (VkExtent2D) { .width = 8, .height = 4 };
+ return;
+ }
+ }
+
*pGranularity = (VkExtent2D) { 1, 1 };
}