From bb881efc652d427c411f2925dbfb31b02a4d2780 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 7 Mar 2016 11:48:24 +1000 Subject: [PATCH] renderer: fix xonotic regression This resource validation check was incorrect, fix so that xonotic can run in the guest again. --- src/vrend_renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 5bf788b..a783925 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4055,7 +4055,7 @@ static int check_resource_valid(struct vrend_renderer_resource_create_args *args /* buffer and rect textures can't have mipmaps */ if (args->target == PIPE_BUFFER || args->target == PIPE_TEXTURE_RECT) return -1; - if (args->last_level > (floor(log2(MAX2(args->width, args->width))) + 1)) + if (args->last_level > (floor(log2(MAX2(args->width, args->height))) + 1)) return -1; } if (args->flags != 0 && args->flags != VIRGL_RESOURCE_Y_0_TOP)