summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pass.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2016-10-07 12:07:31 -0700
committerNanley Chery <[email protected]>2016-10-07 12:54:18 -0700
commitd8aacc24cc37dc435e250668aba0817c36996ad1 (patch)
treede29be15d16e9acf5f973c0cd8abaea15a75ca78 /src/intel/vulkan/anv_pass.c
parent78d074b87a75d599e65ef34f5b866da577b80de3 (diff)
anv: Enable fast depth clears
Provides an FPS increase of ~30% on the Sascha triangle and multisampling demos. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pass.c')
-rw-r--r--src/intel/vulkan/anv_pass.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c
index 69c3c7e96b7..595c2ea67d7 100644
--- a/src/intel/vulkan/anv_pass.c
+++ b/src/intel/vulkan/anv_pass.c
@@ -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 };
}