From 7c4483de0ee7b46981dab0459d222774524db461 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 22 Jan 2019 10:27:18 -0800 Subject: [PATCH] turnip: preliminary support for tu_GetRenderAreaGranularity Set it to tile alignments, 32x32 on 6xx. --- src/freedreno/vulkan/tu_device.c | 3 ++- src/freedreno/vulkan/tu_pass.c | 8 +++++--- src/freedreno/vulkan/tu_private.h | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 7360e58cd74..072da76a602 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -223,8 +223,9 @@ tu_physical_device_init(struct tu_physical_device *device, sprintf(device->name, "FD%d", device->gpu_id); switch (device->gpu_id) { - case 530: case 630: + device->tile_align_w = 32; + device->tile_align_h = 32; break; default: result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index 54047055a4f..e97cc2fc9d4 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -405,10 +405,12 @@ tu_DestroyRenderPass(VkDevice _device, } void -tu_GetRenderAreaGranularity(VkDevice device, +tu_GetRenderAreaGranularity(VkDevice _device, VkRenderPass renderPass, VkExtent2D *pGranularity) { - pGranularity->width = 1; - pGranularity->height = 1; + TU_FROM_HANDLE(tu_device, device, _device); + + pGranularity->width = device->physical_device->tile_align_w; + pGranularity->height = device->physical_device->tile_align_h; } diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index b9b00c76a7c..3edb9913ce2 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -295,6 +295,8 @@ struct tu_physical_device unsigned gpu_id; uint32_t gmem_size; + uint32_t tile_align_w; + uint32_t tile_align_h; /* This is the drivers on-disk cache used as a fallback as opposed to * the pipeline cache defined by apps. -- 2.30.2