anv: fix transform feedback surface size
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 21 Aug 2020 20:13:06 +0000 (23:13 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 25 Aug 2020 07:13:52 +0000 (10:13 +0300)
Non multiple 4 sizes are causing issue in particular < 4.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3450
Fixes: 36ee2fd61c8f ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6430>

src/intel/vulkan/genX_cmd_buffer.c

index 4522f5d2aef0b98198dcb63f9f09a27370fe50ec..09b91415784bf245d3fd7203c98c9cc77d7e1bdc 100644 (file)
@@ -3412,7 +3412,7 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
                sob.SurfaceBaseAddress = anv_address_add(xfb->buffer->address,
                                                         xfb->offset);
                /* Size is in DWords - 1 */
-               sob.SurfaceSize = xfb->size / 4 - 1;
+               sob.SurfaceSize = DIV_ROUND_UP(xfb->size, 4) - 1;
             }
          }
       }