llvmpipe: add array/3d clearing support
authorDave Airlie <airlied@redhat.com>
Fri, 19 Jun 2020 06:56:36 +0000 (16:56 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 31 Aug 2020 03:20:11 +0000 (13:20 +1000)
Fixes:
dEQP-VK.pipeline.multisample.sampled_image.64x64_4.*.samples_4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

src/gallium/drivers/llvmpipe/lp_surface.c

index 2a60d86c9968e084cf47fb79bdeacd4b3f92c56c..af8ada4d39b33c7b3e213d1ebd17622af89d2090 100644 (file)
@@ -313,6 +313,10 @@ llvmpipe_clear_render_target(struct pipe_context *pipe,
    if (dst->texture->nr_samples > 1) {
       struct pipe_box box;
       u_box_2d(dstx, dsty, width, height, &box);
+      if (dst->texture->target != PIPE_BUFFER) {
+         box.z = dst->u.tex.first_layer;
+         box.depth = dst->u.tex.last_layer - dst->u.tex.first_layer + 1;
+      }
       for (unsigned s = 0; s < util_res_sample_count(dst->texture); s++) {
          lp_clear_color_texture_msaa(pipe, dst->texture, dst->format,
                                      color, s, &box);
@@ -378,6 +382,10 @@ llvmpipe_clear_depth_stencil(struct pipe_context *pipe,
       uint64_t zstencil = util_pack64_z_stencil(dst->format, depth, stencil);
       struct pipe_box box;
       u_box_2d(dstx, dsty, width, height, &box);
+      if (dst->texture->target != PIPE_BUFFER) {
+         box.z = dst->u.tex.first_layer;
+         box.depth = dst->u.tex.last_layer - dst->u.tex.first_layer + 1;
+      }
       for (unsigned s = 0; s < util_res_sample_count(dst->texture); s++)
          lp_clear_depth_stencil_texture_msaa(pipe, dst->texture,
                                              dst->format, clear_flags,