gallium: rename util_clear_texture to util_clear_texture_sw
authorItalo Nicola <italonicola@collabora.com>
Thu, 22 Jun 2023 18:32:45 +0000 (18:32 +0000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 10 Jul 2023 15:23:06 +0000 (15:23 +0000)
This better explain what this function does, making it less likely that
people mistakenly use it instead of util_default_clear_texture.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23735>

src/gallium/auxiliary/util/u_surface.c
src/gallium/auxiliary/util/u_surface.h
src/gallium/drivers/llvmpipe/lp_surface.c
src/gallium/drivers/softpipe/sp_texture.c

index 2746bdb..4949779 100644 (file)
@@ -727,18 +727,19 @@ u_default_clear_texture(struct pipe_context *pipe,
 
    /* Fallback to clearing it in SW if the HW paths failed. */
    if (!cleared)
-      util_clear_texture(pipe, tex, level, box, data);
+      util_clear_texture_sw(pipe, tex, level, box, data);
 }
 
 void
-util_clear_texture(struct pipe_context *pipe,
-                   struct pipe_resource *tex,
-                   unsigned level,
-                   const struct pipe_box *box,
-                   const void *data)
+util_clear_texture_sw(struct pipe_context *pipe,
+                      struct pipe_resource *tex,
+                      unsigned level,
+                      const struct pipe_box *box,
+                      const void *data)
 {
    const struct util_format_description *desc =
           util_format_description(tex->format);
+   assert(data != NULL);
 
    if (level > tex->last_level)
       return;
index e2166e3..01dba21 100644 (file)
@@ -90,11 +90,11 @@ u_default_clear_texture(struct pipe_context *pipe,
                         const void *data);
 
 extern void
-util_clear_texture(struct pipe_context *pipe,
-                   struct pipe_resource *tex,
-                   unsigned level,
-                   const struct pipe_box *box,
-                   const void *data);
+util_clear_texture_sw(struct pipe_context *pipe,
+                      struct pipe_resource *tex,
+                      unsigned level,
+                      const struct pipe_box *box,
+                      const void *data);
 
 extern void
 util_clear_render_target(struct pipe_context *pipe,
index 689a2dd..ff25547 100644 (file)
@@ -442,7 +442,7 @@ llvmpipe_clear_texture(struct pipe_context *pipe,
    const struct util_format_description *desc =
           util_format_description(tex->format);
    if (tex->nr_samples <= 1) {
-      util_clear_texture(pipe, tex, level, box, data);
+      util_clear_texture_sw(pipe, tex, level, box, data);
       return;
    }
    union pipe_color_union color;
index 6e32b6a..c4f9ab6 100644 (file)
@@ -523,7 +523,7 @@ softpipe_init_texture_funcs(struct pipe_context *pipe)
 
    pipe->create_surface = softpipe_create_surface;
    pipe->surface_destroy = softpipe_surface_destroy;
-   pipe->clear_texture = util_clear_texture;
+   pipe->clear_texture = util_clear_texture_sw;
 }