summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-11-29 22:23:34 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:10 -0800
commit773adeb9e908d19799c9ff22000f50c5ab818c56 (patch)
treebe2502f22e6355bf269b51abb7ba524d8be968d5 /src
parent2c0f001295960f4f19671a983d4dbbf809165e3c (diff)
iris: move some non-buffer case code in a bit
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 1388033e6bc..fd83852ca40 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -774,10 +774,6 @@ iris_map_direct(struct iris_transfer *map)
struct pipe_transfer *xfer = &map->base;
struct pipe_box *box = &xfer->box;
struct iris_resource *res = (struct iris_resource *) xfer->resource;
- struct isl_surf *surf = &res->surf;
- const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format);
- const unsigned cpp = fmtl->bpb / 8;
- unsigned x0_el, y0_el;
void *ptr = iris_bo_map(map->dbg, res->bo, xfer->usage);
@@ -787,6 +783,12 @@ iris_map_direct(struct iris_transfer *map)
map->ptr = ptr + box->x;
} else {
+ struct isl_surf *surf = &res->surf;
+ const struct isl_format_layout *fmtl =
+ isl_format_get_layout(surf->format);
+ const unsigned cpp = fmtl->bpb / 8;
+ unsigned x0_el, y0_el;
+
get_image_offset_el(surf, xfer->level, box->z, &x0_el, &y0_el);
xfer->stride = isl_surf_get_row_pitch_B(surf);