[Mesa-dev] [PATCH 12/71] gallium: Add blending to pipe blit
Axel Davy
axel.davy at ens.fr
Sun Aug 16 08:27:36 PDT 2015
From: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
This type of blending is used for gallium nine software cursor
Signed-off-by: David Heidelberg <david at ixit.cz>
---
src/gallium/include/pipe/p_state.h | 1 +
src/gallium/state_trackers/nine/device9.c | 1 +
src/gallium/state_trackers/nine/swapchain9.c | 2 ++
src/mesa/state_tracker/st_cb_blit.c | 1 +
4 files changed, 5 insertions(+)
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index a233610..6dce0aa 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -660,6 +660,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/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 38af8e3..a1c05b4 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -1460,6 +1460,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
blit.filter = Filter == D3DTEXF_LINEAR ?
PIPE_TEX_FILTER_LINEAR : PIPE_TEX_FILTER_NEAREST;
blit.scissor_enable = FALSE;
+ blit.alpha_blend = FALSE;
/* If both of a src and dst dimension are negative, flip them. */
if (blit.dst.box.width < 0 && blit.src.box.width < 0) {
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index eb84d08..b8ad403 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -588,6 +588,7 @@ handle_draw_cursor_and_hud( struct NineSwapChain9 *This, struct pipe_resource *r
blit.src.box.width, blit.src.box.height,
blit.dst.box.x, blit.dst.box.y);
+ blit.alpha_blend = TRUE;
This->pipe->blit(This->pipe, &blit);
}
@@ -705,6 +706,7 @@ present( struct NineSwapChain9 *This,
blit.mask = PIPE_MASK_RGBA;
blit.filter = PIPE_TEX_FILTER_NEAREST;
blit.scissor_enable = FALSE;
+ blit.alpha_blend = FALSE;
This->pipe->blit(This->pipe, &blit);
}
diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index 1396906..4fdef7f 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -192,6 +192,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 =
--
2.1.0
More information about the mesa-dev
mailing list