summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-09-12 09:48:41 +0200
committerJuan A. Suarez Romero <[email protected]>2018-09-19 11:04:53 +0200
commitd42bf4f0eefc06df6791fcd898dfa98989b41190 (patch)
tree0252dc2362b491e1a8afde23f4cfb05445e70e36
parent5b58be3590daa62aa814c31d6fd3a79903098c1d (diff)
virgl: adjust strides when mapping temp-resources
When we're mapping temp-resources, we clip the resource to the transfer-box, which means the stride might not be correct any more. So let's update the stride from the temp-resource, and recompute the layer-stride. This fixes crashes when running dEQP with --deqp-gl-config-name=rgba8888d24s8ms4 Signed-off-by: Erik Faye-Lund <[email protected]> Fixes: a8987b88ff1 "virgl: add driver for virtio-gpu 3D (v2)" Reviewed-by: Dave Airlie <[email protected]> (cherry picked from commit fa5e9f1f73f64ac089f8efd5b101a77d06d22fcd)
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 150a5ebd8c7..7ac794623da 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -177,6 +177,8 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
/* we want to do a resolve blit into the temporary */
hw_res = trans->resolve_tmp->hw_res;
offset = 0;
+ trans->base.stride = ((struct virgl_texture*)trans->resolve_tmp)->stride[level];
+ trans->base.layer_stride = trans->base.stride * nblocksy;
} else {
offset = vrend_get_tex_image_offset(vtex, level, box->z);