aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-04-01 08:44:08 +1000
committerMarge Bot <[email protected]>2020-04-01 20:58:23 +0000
commit2a2fd4c5308dee51d48630863255f1c6a04768a9 (patch)
treeaebb3aca6540730466e04414c169b755dd94404b /src/gallium/auxiliary
parentc07bbdbe8268a2c80c602f71eb413f0d84920038 (diff)
gallium/llvmpipe: add an optimised 32-bit memset
This might have other users beyond filling/clearing buffers, increase a fullscreen 4k gears from 68->74 fps on my Ryzen since gears is really just a clear benchmark, and this helps clearing. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4394> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4394>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_surface.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 847c0008079..527e6662f0b 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -41,7 +41,7 @@
#include "util/u_rect.h"
#include "util/u_surface.h"
#include "util/u_pack_color.h"
-
+#include "util/u_memset.h"
/**
* Initialize a pipe_surface object. 'view' is considered to have
@@ -141,9 +141,7 @@ util_fill_rect(ubyte * dst,
break;
case 4:
for (i = 0; i < height; i++) {
- uint32_t *row = (uint32_t *)dst;
- for (j = 0; j < width; j++)
- *row++ = uc->ui[0];
+ util_memset32(dst, uc->ui[0], width);
dst += dst_stride;
}
break;
@@ -492,9 +490,7 @@ util_clear_depth_stencil_texture(struct pipe_context *pipe,
case 4:
if (!need_rmw) {
for (i = 0; i < height; i++) {
- uint32_t *row = (uint32_t *)dst_map;
- for (j = 0; j < width; j++)
- *row++ = (uint32_t) zstencil;
+ util_memset32(dst_map, (uint32_t)zstencil, width);
dst_map += dst_stride;
}
}