anv: Enable fast depth clears

Provides an FPS increase of ~30% on the Sascha triangle and multisampling
demos.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
This commit is contained in:
Nanley Chery
2016-10-07 12:07:31 -07:00
parent 78d074b87a
commit d8aacc24cc
2 changed files with 35 additions and 2 deletions

View File

@@ -155,5 +155,18 @@ 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 };
}