From 8366701f4cb6d297623607e922d151dc05f69811 Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Mon, 29 Feb 2016 12:00:12 -0800 Subject: [PATCH] svga: fix an error in svga_texture_generate_mipmap With this patch, make sure the shader resource view is properly created before referencing it in the generate mipmap command. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_resource_texture.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 3f754c4d53e..e898ff2c4e6 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -1038,7 +1038,12 @@ svga_texture_generate_mipmap(struct pipe_context *pipe, return FALSE; sv = svga_pipe_sampler_view(psv); - svga_validate_pipe_sampler_view(svga, sv); + ret = svga_validate_pipe_sampler_view(svga, sv); + if (ret != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = svga_validate_pipe_sampler_view(svga, sv); + assert(ret == PIPE_OK); + } ret = SVGA3D_vgpu10_GenMips(svga->swc, sv->id, tex->handle); if (ret != PIPE_OK) { -- 2.30.2