Mesa (staging/19.0): Revert "softpipe/buffer: load only as many components as the the buffer resource type provides"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 17 22:32:07 UTC 2019


Module: Mesa
Branch: staging/19.0
Commit: cab826d5a813bcc331082ef21d839f4669a2b99f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cab826d5a813bcc331082ef21d839f4669a2b99f

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Thu May 16 14:48:50 2019 +0200

Revert "softpipe/buffer: load only as many components as the the buffer resource type provides"

This reverts commit 865b9ddae4874186182e529b5fd154ab04a61f79.

The buffer always reports format PIPE_FORMAT_R8_UNORM so with this patch only
one component would be supported. The original issue is still relevant, but
the fix should be different.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit 0f598ed7b3d2b3886ea5d742e7b0ced2b1702f28)

---

 src/gallium/drivers/softpipe/sp_buffer.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_buffer.c b/src/gallium/drivers/softpipe/sp_buffer.c
index b8bc5007fac..e91d2af78e9 100644
--- a/src/gallium/drivers/softpipe/sp_buffer.c
+++ b/src/gallium/drivers/softpipe/sp_buffer.c
@@ -55,8 +55,7 @@ sp_tgsi_load(const struct tgsi_buffer *buffer,
    struct pipe_shader_buffer *bview;
    struct softpipe_resource *spr;
    unsigned width;
-   unsigned ncomp;
-   unsigned c, j;
+   int c, j;
    unsigned char *data_ptr;
    const struct util_format_description *format_desc = util_format_description(PIPE_FORMAT_R32_UINT);
 
@@ -64,8 +63,6 @@ sp_tgsi_load(const struct tgsi_buffer *buffer,
       goto fail_write_all_zero;
 
    bview = &sp_buf->sp_bview[params->unit];
-   ncomp = util_format_get_nr_components(bview->buffer->format);
-
    spr = softpipe_resource(bview->buffer);
    if (!spr)
       goto fail_write_all_zero;
@@ -91,7 +88,7 @@ sp_tgsi_load(const struct tgsi_buffer *buffer,
          continue;
       }
       data_ptr = (unsigned char *)spr->data + bview->buffer_offset + s_coord;
-      for (c = 0; c < ncomp; c++) {
+      for (c = 0; c < 4; c++) {
          format_desc->fetch_rgba_uint(sdata, data_ptr, 0, 0);
          ((uint32_t *)rgba[c])[j] = sdata[0];
          data_ptr += 4;




More information about the mesa-commit mailing list