From 95ce454c8c4397a67aa038d91667882e413314d3 Mon Sep 17 00:00:00 2001 From: Stuart Abercrombie Date: Fri, 29 Jun 2012 16:31:24 -0700 Subject: [PATCH] gallium/util: Save and restore vertex buffer state in util_gen_mipmap. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Calling glGenerateMipmap could overwrite vertex buffer state, leading to incorrect rendering or crashes depending on the Gallium driver. This was happening on WebGL Conformance test texture-size. Before 784dd51198433e5c299da4a7742c68d21d68d1c1 this was covered up by redundant vertex buffer validation. Reviewed-by: Stéphane Marchesin Signed-off-by: Marek Olšák --- src/gallium/auxiliary/util/u_gen_mipmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 82474cd7bad..2ff1af70a59 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1556,6 +1556,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_save_geometry_shader(ctx->cso); cso_save_viewport(ctx->cso); cso_save_vertex_elements(ctx->cso); + cso_save_vertex_buffers(ctx->cso); /* bind our state */ cso_set_blend(ctx->cso, &ctx->blend); @@ -1679,4 +1680,5 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_restore_viewport(ctx->cso); cso_restore_vertex_elements(ctx->cso); cso_restore_stream_outputs(ctx->cso); + cso_restore_vertex_buffers(ctx->cso); } -- 2.30.2