summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-07-17 08:59:25 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:07 -0800
commitfcee21da6bf81a8602f20a8fe0ad36eb98ce1f42 (patch)
tree16b685f94d666093e75459e5cbb244d834e32773
parent3c41d4cf3f41871203ea68ba519ddf9c321ccf10 (diff)
iris: fix texture buffer stride
-rw-r--r--src/gallium/drivers/iris/iris_state.c6
1 files changed, 5 insertions, 1 deletions
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);
}