summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-09-05 14:34:51 +0100
committerErik Faye-Lund <[email protected]>2018-09-10 10:35:42 +0200
commitc4017106bb8b5118b68e24d3f5b44c538033cfe3 (patch)
tree148dff16444d7d12f42c6ba6e213ce5652ffdb34 /src/gallium/drivers/virgl
parent80834640137228323b4c6d8e5909926e0b69bf70 (diff)
virgl: do not map zero-sized resource
When creating textures, we avoid creating backing-store for all multisampled textures, not just depth buffers. So we can't try to map them later. That's just going to fail. So let's take the blit-based code-path that seems to avoid this problem. This make this piglit test-case no longer crash (although it still fails): bin/copyteximage 2D -samples=2 -auto Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 88c2f384838..0902f9b8172 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -137,7 +137,6 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
struct virgl_hw_res *hw_res;
const unsigned h = u_minify(vtex->base.u.b.height0, level);
const unsigned nblocksy = util_format_get_nblocksy(format, h);
- bool is_depth = util_format_has_depth(util_format_description(resource->format));
uint32_t l_stride;
bool doflushwait;
@@ -165,7 +164,7 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
else
l_stride = trans->base.layer_stride;
- if (is_depth && resource->nr_samples > 1) {
+ if (resource->nr_samples > 1) {
struct pipe_resource tmp_resource;
virgl_init_temp_resource_from_box(&tmp_resource, resource, box,
level, 0);