radv: cleanup and document a Hawaii bug with offchip buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 8 Nov 2018 13:00:35 +0000 (14:00 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Nov 2018 08:35:42 +0000 (09:35 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index 92254bed2e111352201c5adcd9cd8c056851f72e..145be67c85661b9a7cae30ef3abf93f848bc7e44 100644 (file)
@@ -2046,16 +2046,15 @@ radv_get_hs_offchip_param(struct radv_device *device, uint32_t *max_offchip_buff
        max_offchip_buffers = max_offchip_buffers_per_se *
                device->physical_device->rad_info.max_se;
 
-       switch (device->tess_offchip_block_dw_size) {
-       default:
-               assert(0);
-               /* fall through */
-       case 8192:
-               offchip_granularity = V_03093C_X_8K_DWORDS;
-               break;
-       case 4096:
+       /* Hawaii has a bug with offchip buffers > 256 that can be worked
+        * around by setting 4K granularity.
+        */
+       if (device->tess_offchip_block_dw_size == 4096) {
+               assert(device->physical_device->rad_info.family == CHIP_HAWAII);
                offchip_granularity = V_03093C_X_4K_DWORDS;
-               break;
+       } else {
+               assert(device->tess_offchip_block_dw_size == 8192);
+               offchip_granularity = V_03093C_X_8K_DWORDS;
        }
 
        switch (device->physical_device->rad_info.chip_class) {