turnip: preliminary support for tu_GetRenderAreaGranularity
authorChia-I Wu <olvaffe@gmail.com>
Tue, 22 Jan 2019 18:27:18 +0000 (10:27 -0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 11 Mar 2019 17:02:13 +0000 (10:02 -0700)
Set it to tile alignments, 32x32 on 6xx.

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_pass.c
src/freedreno/vulkan/tu_private.h

index 7360e58cd74aa95911d363a6d69841bf6f8dc2c7..072da76a602b08b70fcb24c3cf0d0e9934aaeeef 100644 (file)
@@ -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,
index 54047055a4fc6bf973e5413392400a7e9c1ebb6d..e97cc2fc9d455bae25cab94d09e4d64eea32e28b 100644 (file)
@@ -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;
 }
index b9b00c76a7c001192301cb7ef4b6dc9be1885089..3edb9913ce2ce4531a0ce49d77e4d27005a5436c 100644 (file)
@@ -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.