[Mesa-dev] [PATCH v2] virgl: Set bind when creating temp resource.
Erik Faye-Lund
erik.faye-lund at collabora.com
Tue Apr 9 08:57:50 UTC 2019
Nice move to put the logic in its own function!
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
On Mon, 2019-04-08 at 09:39 -0700, Lepton Wu wrote:
> virgl render complains about "Illegal resource" when running
> dEQP-EGL.functional.color_clears.single_context.gles2.rgb888_window,
> the reason is that a zero bind value was given for temp resource.
>
> Signed-off-by: Lepton Wu <lepton at chromium.org>
> ---
> src/gallium/drivers/virgl/virgl_texture.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/gallium/drivers/virgl/virgl_texture.c
> b/src/gallium/drivers/virgl/virgl_texture.c
> index 231319899e0..12b05b52508 100644
> --- a/src/gallium/drivers/virgl/virgl_texture.c
> +++ b/src/gallium/drivers/virgl/virgl_texture.c
> @@ -60,12 +60,22 @@ static void virgl_copy_region_with_blit(struct
> pipe_context *pipe,
> pipe->blit(pipe, &blit);
> }
> }
> +
> +static unsigned int temp_bind(unsigned int orig)
> +{
> + if (orig & ~(PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |
> + PIPE_BIND_SAMPLER_VIEW))
> + fprintf(stderr, "Waring, possibly unhandled bind: %x\n",
> orig);
> + return orig & (PIPE_BIND_DEPTH_STENCIL |
> PIPE_BIND_RENDER_TARGET);
> +}
> +
> static void virgl_init_temp_resource_from_box(struct pipe_resource
> *res,
> struct pipe_resource
> *orig,
> const struct pipe_box
> *box,
> unsigned level,
> unsigned flags)
> {
> memset(res, 0, sizeof(*res));
> + res->bind = temp_bind(orig->bind);
> res->format = orig->format;
> res->width0 = box->width;
> res->height0 = box->height;
More information about the mesa-dev
mailing list