iris: fix texture buffer stride
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 17 Jul 2018 15:59:25 +0000 (08:59 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index c4ee638eb24c211e1dce987183cc998acf9d95b7..6efc99b66cdc89a9d5012a3ec17b98c24a7362ce 100644 (file)
@@ -1061,13 +1061,17 @@ iris_create_sampler_view(struct pipe_context *ctx,
                           // .clear_color = clear_color,
    } else {
       // XXX: what to do about isv->view?  other drivers don't use it for bufs
+      const struct isl_format_layout *fmtl =
+         isl_format_get_layout(isv->view.format);
+      const unsigned cpp = fmtl->bpb / 8;
+
       isl_buffer_fill_state(&screen->isl_dev, map,
                             .address = itex->bo->gtt_offset +
                                        tmpl->u.buf.offset,
                             // XXX: buffer_texture_range_size from i965?
                             .size_B = tmpl->u.buf.size,
                             .format = isv->view.format,
-                            .stride_B = itex->surf.row_pitch_B,
+                            .stride_B = cpp,
                             .mocs = MOCS_WB);
    }