From: Kenneth Graunke Date: Tue, 17 Jul 2018 15:59:25 +0000 (-0700) Subject: iris: fix texture buffer stride X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fcee21da6bf81a8602f20a8fe0ad36eb98ce1f42;p=mesa.git iris: fix texture buffer stride --- 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); }