diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index e45dea268ba..1a8acb3587c 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -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; } }