[Mesa-dev] [PATCH 06/16] gallium: add blending to pipe blit

Roland Scheidegger sroland at vmware.com
Sat Oct 18 16:09:54 PDT 2014


Hmm shouldn't there be a cap bit for this unless you fix all drivers to 
actually honor it?
(Though I'm unsure if it makes all that much sense in general, pipe blit 
is already quite a can-do-everything call.)

Roland

On 10/18/2014 01:54 PM, David Heidelberger wrote:
> From: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
>
> Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
> ---
>   src/gallium/include/pipe/p_state.h        | 1 +
>   src/mesa/state_tracker/st_cb_blit.c       | 1 +
>   src/mesa/state_tracker/st_cb_readpixels.c | 1 +
>   src/mesa/state_tracker/st_cb_texture.c    | 3 +++
>   4 files changed, 6 insertions(+)
>
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
> index 7b9996d..b7adb99 100644
> --- a/src/gallium/include/pipe/p_state.h
> +++ b/src/gallium/include/pipe/p_state.h
> @@ -619,6 +619,7 @@ struct pipe_blit_info
>
>      boolean render_condition_enable; /**< whether the blit should honor the
>                                       current render condition */
> +   boolean alpha_blend; /* dst.rgb = src.rgb * src.a + dst.rgb * (1 - src.a) */
>   };
>
>
> diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
> index 9c33f4e..93b5c4f 100644
> --- a/src/mesa/state_tracker/st_cb_blit.c
> +++ b/src/mesa/state_tracker/st_cb_blit.c
> @@ -188,6 +188,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
>
>      blit.filter = pFilter;
>      blit.render_condition_enable = TRUE;
> +   blit.alpha_blend = FALSE;
>
>      if (mask & GL_COLOR_BUFFER_BIT) {
>         struct gl_renderbuffer_attachment *srcAtt =
> diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
> index d95a608..c9ff6f7 100644
> --- a/src/mesa/state_tracker/st_cb_readpixels.c
> +++ b/src/mesa/state_tracker/st_cb_readpixels.c
> @@ -184,6 +184,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y,
>      blit.mask = st_get_blit_mask(rb->_BaseFormat, format);
>      blit.filter = PIPE_TEX_FILTER_NEAREST;
>      blit.scissor_enable = FALSE;
> +   blit.alpha_blend = FALSE;
>
>      if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
>         blit.src.box.y = rb->Height - blit.src.box.y;
> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> index a8dbb78..914aaf5 100644
> --- a/src/mesa/state_tracker/st_cb_texture.c
> +++ b/src/mesa/state_tracker/st_cb_texture.c
> @@ -842,6 +842,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
>      blit.mask = st_get_blit_mask(format, texImage->_BaseFormat);
>      blit.filter = PIPE_TEX_FILTER_NEAREST;
>      blit.scissor_enable = FALSE;
> +   blit.alpha_blend = FALSE;
>
>      st->pipe->blit(st->pipe, &blit);
>
> @@ -1089,6 +1090,7 @@ st_GetTexImage(struct gl_context * ctx,
>      blit.mask = st_get_blit_mask(texImage->_BaseFormat, format);
>      blit.filter = PIPE_TEX_FILTER_NEAREST;
>      blit.scissor_enable = FALSE;
> +   blit.alpha_blend = FALSE;
>
>      /* blit/render/decompress */
>      st->pipe->blit(st->pipe, &blit);
> @@ -1455,6 +1457,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
>      blit.dst.box.depth = 1;
>      blit.mask = st_get_blit_mask(rb->_BaseFormat, texImage->_BaseFormat);
>      blit.filter = PIPE_TEX_FILTER_NEAREST;
> +   blit.alpha_blend = FALSE;
>      pipe->blit(pipe, &blit);
>      return;
>
>



More information about the mesa-dev mailing list