Stuart Abercrombie | 30 Jun 2012 01:31

[PATCH] Save and restore vertex buffer state in util_gen_mipmap.

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 <marcheu <at> chromium.org>
---
 src/gallium/auxiliary/util/u_gen_mipmap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 82474cd..2ff1af7 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
 <at>  <at>  -1556,6 +1556,7  <at>  <at>  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);
 <at>  <at>  -1679,4 +1680,5  <at>  <at>  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);
 }
(Continue reading)

Marek Olšák | 30 Jun 2012 03:23
Picon

Re: [PATCH] Save and restore vertex buffer state in util_gen_mipmap.

Well spotted, thanks!

Reviewed-by: Marek Olšák <maraeo <at> gmail.com>

Marek

On Sat, Jun 30, 2012 at 1:31 AM, Stuart Abercrombie
<sabercrombie <at> chromium.org> wrote:
> 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 <marcheu <at> chromium.org>
> ---
>  src/gallium/auxiliary/util/u_gen_mipmap.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
> index 82474cd..2ff1af7 100644
> --- a/src/gallium/auxiliary/util/u_gen_mipmap.c
> +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
>  <at>  <at>  -1556,6 +1556,7  <at>  <at>  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);
>
(Continue reading)


Gmane