u_surface: use optimised memset64
authorDave Airlie <airlied@redhat.com>
Sun, 14 Feb 2021 21:50:58 +0000 (07:50 +1000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Feb 2021 00:30:46 +0000 (00:30 +0000)
Use the newly added optimised memset64 path

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9041>

src/gallium/auxiliary/util/u_surface.c

index e45dea2..1a8acb3 100644 (file)
@@ -145,6 +145,12 @@ util_fill_rect(ubyte * dst,
          dst += dst_stride;
       }
       break;
+   case 8:
+      for (i = 0; i < height; i++) {
+         util_memset64(dst, ((uint64_t *)uc)[0], width);
+         dst += dst_stride;
+      }
+      break;
    default:
       for (i = 0; i < height; i++) {
          ubyte *row = dst;
@@ -489,9 +495,7 @@ util_fill_zs_rect(ubyte *dst_map,
    case 8:
       if (!need_rmw) {
          for (i = 0; i < height; i++) {
-            uint64_t *row = (uint64_t *)dst_map;
-            for (j = 0; j < width; j++)
-               *row++ = zstencil;
+            util_memset64(dst_map, zstencil, width);
             dst_map += dst_stride;
          }
       }