summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_context.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-11-09 16:41:16 -0500
committerIlia Mirkin <[email protected]>2016-11-15 20:25:15 -0500
commit8c0f76e961ae023bbe7c8deed1abd04496e9691b (patch)
treebef6fa81f60809360e27565910e41a896a48e5ac /src/gallium/drivers/swr/swr_context.cpp
parent00efbbc38ccc1507b0963da4d60c601b9e0cb932 (diff)
swr: fix texture layout for compressed formats
Fixes the texsubimage piglit and lets the copyteximage one get further. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_context.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_context.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp
index 6c0782a40d3..a5ab2362e55 100644
--- a/src/gallium/drivers/swr/swr_context.cpp
+++ b/src/gallium/drivers/swr/swr_context.cpp
@@ -157,8 +157,9 @@ swr_transfer_map(struct pipe_context *pipe,
}
}
- unsigned offset = box->z * pt->layer_stride + box->y * pt->stride
- + box->x * util_format_get_blocksize(format);
+ unsigned offset = box->z * pt->layer_stride +
+ util_format_get_nblocksy(format, box->y) * pt->stride +
+ util_format_get_stride(format, box->x);
*transfer = pt;