virgl: make sure bind is set for non-buffers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 12 Mar 2019 12:57:14 +0000 (13:57 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 17 Apr 2019 07:27:08 +0000 (07:27 +0000)
Otherwise, virglrenderer will reject the resource.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_texture.c

index e0c152dd562f732e9bd4896b65635b52707e123d..5cb01cb18a04697574137723fc6431db74e01242 100644 (file)
@@ -97,6 +97,9 @@ static void virgl_init_temp_resource_from_box(struct pipe_resource *res,
    else
       res->target = PIPE_TEXTURE_2D;
 
+   if (res->target != PIPE_BUFFER)
+      res->bind = PIPE_BIND_RENDER_TARGET;
+
    switch (res->target) {
    case PIPE_TEXTURE_1D_ARRAY:
    case PIPE_TEXTURE_2D_ARRAY: