summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorNeha Bhende <[email protected]>2017-12-13 15:02:13 -0800
committerBrian Paul <[email protected]>2018-09-10 13:07:30 -0600
commitc6103328ab9a985b637b940d6d6a49de961b7c9f (patch)
tree752b51577dd8b29153d368f30c4ac732980a27c9 /src/gallium/drivers/svga
parentfdf58851833c6521fba7038425dcea8f063ced38 (diff)
svga: Use texture_copy_region instead of texture_copy_handle for multisampling
This fixes some of tests cases in arb_copy_image-formats and also fixes SurfaceCopy related errors in vmware.log when multi sampled surfaces are used. Tested with piglit, glretrace on windows and linux VM. v2: As per Brian's comment Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_surface.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index bc1212f8302..73208cf58ac 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -170,15 +170,24 @@ svga_texture_copy_handle_resource(struct svga_context *svga,
unsigned depth = (zslice_pick < 0 ?
u_minify(src_tex->b.b.depth0, miplevel) : 1);
- svga_texture_copy_handle(svga,
- src_tex->handle,
- 0, 0, zoffset,
- miplevel,
- j + layeroffset,
- dst, 0, 0, 0, i, j,
- u_minify(src_tex->b.b.width0, miplevel),
- u_minify(src_tex->b.b.height0, miplevel),
- depth);
+ if (src_tex->b.b.nr_samples > 1) {
+ unsigned subResource = j * numMipLevels + i;
+ svga_texture_copy_region(svga, src_tex->handle,
+ subResource, 0, 0, zoffset,
+ dst, subResource, 0, 0, 0,
+ src_tex->b.b.width0, src_tex->b.b.height0, depth);
+ }
+ else {
+ svga_texture_copy_handle(svga,
+ src_tex->handle,
+ 0, 0, zoffset,
+ miplevel,
+ j + layeroffset,
+ dst, 0, 0, 0, i, j,
+ u_minify(src_tex->b.b.width0, miplevel),
+ u_minify(src_tex->b.b.height0, miplevel),
+ depth);
+ }
}
}
}