summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-27 20:25:37 +0200
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit054dcbe42ce56947de571d75fa1aec296ae53af5 (patch)
treea5dc3158ecaae4e39c41599e3cd05e1fe1f6bb6b /src/gallium/drivers
parent710aaed52bd14d681c7a01cc8d078865676a53b7 (diff)
radeonsi/gfx9: pass correct parameters to buffer_get_handle
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index ebd2c5c4477..129b3f422b7 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -500,6 +500,7 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
struct r600_texture *rtex = (struct r600_texture*)resource;
struct radeon_bo_metadata metadata;
bool update_metadata = false;
+ unsigned stride, offset, slice_size;
/* This is not supported now, but it might be required for OpenCL
* interop in the future.
@@ -553,12 +554,19 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
res->external_usage = usage;
}
- return rscreen->ws->buffer_get_handle(res->buf,
- rtex->surface.u.legacy.level[0].nblk_x *
- rtex->surface.bpe,
- rtex->surface.u.legacy.level[0].offset,
- rtex->surface.u.legacy.level[0].slice_size,
- whandle);
+ if (rscreen->chip_class >= GFX9) {
+ offset = 0;
+ stride = rtex->surface.u.gfx9.surf_pitch *
+ rtex->surface.bpe;
+ slice_size = rtex->surface.u.gfx9.surf_slice_size;
+ } else {
+ offset = rtex->surface.u.legacy.level[0].offset;
+ stride = rtex->surface.u.legacy.level[0].nblk_x *
+ rtex->surface.bpe;
+ slice_size = rtex->surface.u.legacy.level[0].slice_size;
+ }
+ return rscreen->ws->buffer_get_handle(res->buf, stride, offset,
+ slice_size, whandle);
}
static void r600_texture_destroy(struct pipe_screen *screen,