From fcee21da6bf81a8602f20a8fe0ad36eb98ce1f42 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 17 Jul 2018 08:59:25 -0700 Subject: [PATCH] iris: fix texture buffer stride --- src/gallium/drivers/iris/iris_state.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index c4ee638eb24..6efc99b66cd 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -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); } -- 2.30.2