[Mesa-dev] [PATCH 04/16] st/nine: Clear struct pipe_blit_info before use.

Ilia Mirkin imirkin at alum.mit.edu
Fri Apr 24 14:15:38 PDT 2015


On Fri, Apr 24, 2015 at 4:09 PM, Axel Davy <axel.davy at ens.fr> wrote:
> From: Xavier Bouchoux <xavierb at gmail.com>
>
> render_condition_enable was uninitialized.
>
> Reviewed-by: Axel Davy <axel.davy at ens.fr>
> Signed-off-by: Xavier Bouchoux <xavierb at gmail.com>

I assume d3d9 doesn't have conditional rendering? If it does, you
should double-check whether StretchRect and ResolveZ should be
affected. (But I don't see any render_condition use so it's probably
fine.)

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

> ---
>  src/gallium/state_trackers/nine/device9.c    | 2 ++
>  src/gallium/state_trackers/nine/swapchain9.c | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
> index 1430ca5..43eb7e6 100644
> --- a/src/gallium/state_trackers/nine/device9.c
> +++ b/src/gallium/state_trackers/nine/device9.c
> @@ -1342,6 +1342,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
>                  (pSourceRect->left <= pSourceRect->right &&
>                   pSourceRect->top <= pSourceRect->bottom), D3DERR_INVALIDCALL);
>
> +    memset(&blit, 0, sizeof(blit));
>      blit.dst.resource = dst_res;
>      blit.dst.level = dst->level;
>      blit.dst.box.z = dst->layer;
> @@ -2130,6 +2131,7 @@ NineDevice9_ResolveZ( struct NineDevice9 *This )
>      desc = util_format_description(dst->format);
>      user_assert(desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS, D3DERR_INVALIDCALL);
>
> +    memset(&blit, 0, sizeof(blit));
>      blit.src.resource = src;
>      blit.src.level = 0;
>      blit.src.format = src->format;
> diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
> index 296d6dc..f91b3be 100644
> --- a/src/gallium/state_trackers/nine/swapchain9.c
> +++ b/src/gallium/state_trackers/nine/swapchain9.c
> @@ -554,6 +554,7 @@ handle_draw_cursor_and_hud( struct NineSwapChain9 *This, struct pipe_resource *r
>      struct pipe_blit_info blit;
>
>      if (device->cursor.software && device->cursor.visible && device->cursor.w) {
> +        memset(&blit, 0, sizeof(blit));
>          blit.src.resource = device->cursor.image;
>          blit.src.level = 0;
>          blit.src.format = device->cursor.image->format;
> @@ -677,6 +678,7 @@ present( struct NineSwapChain9 *This,
>          handle_draw_cursor_and_hud(This, resource);
>
>      if (This->present_buffers) {
> +        memset(&blit, 0, sizeof(blit));
>          blit.src.resource = resource;
>          blit.src.level = 0;
>          blit.src.format = resource->format;
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list