util: Change a codegenned switch statement to a nice little table.
[mesa.git] / src / gallium / drivers / svga / svga_pipe_clear.c
index 624c2a7593124d59d6cfc10e7f248c22adcb4ad8..82b102081e529a6a3c0f91ad412019c55f552a94 100644 (file)
@@ -290,8 +290,6 @@ svga_clear_texture(struct pipe_context *pipe,
    union pipe_color_union color;
    const struct util_format_description *desc =
       util_format_description(surface->format);
-   const struct util_format_description *unpack =
-      util_format_unpack_description(surface->format);
 
    if (util_format_is_depth_or_stencil(surface->format)) {
       float depth;
@@ -304,8 +302,8 @@ svga_clear_texture(struct pipe_context *pipe,
          stencil = 0;
       }
       else {
-         unpack->unpack_z_float(&depth, 0, data, 0, 1, 1);
-         unpack->unpack_s_8uint(&stencil, 0, data, 0, 1, 1);
+         util_format_unpack_z_float(surface->format, &depth, data, 1);
+         util_format_unpack_s_8uint(surface->format, &stencil, data, 1);
       }
 
       if (util_format_has_depth(desc)) {