summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-17 18:13:01 +0200
committerMarek Olšák <[email protected]>2016-08-22 16:01:35 +0200
commit6902f9e82a1d4c4ff12ac6b55b96d2ef5feb26e3 (patch)
tree343e86f330666ff10b8e1417b79a5153ed89e957 /src
parent0abebec01246cb55dba76330a759e14424dae169 (diff)
gallium/hud: don't enable blending for all objects
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 7870da5464a..0b292bcca61 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -64,7 +64,7 @@ struct hud_context {
struct list_head pane_list;
/* states */
- struct pipe_blend_state alpha_blend;
+ struct pipe_blend_state no_blend, alpha_blend;
struct pipe_depth_stencil_alpha_state dsa;
void *fs_color, *fs_text;
struct pipe_rasterizer_state rasterizer;
@@ -503,7 +503,6 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
cso_set_framebuffer(cso, &fb);
cso_set_sample_mask(cso, ~0);
cso_set_min_samples(cso, 1);
- cso_set_blend(cso, &hud->alpha_blend);
cso_set_depth_stencil_alpha(cso, &hud->dsa);
cso_set_rasterizer(cso, &hud->rasterizer);
cso_set_viewport(cso, &viewport);
@@ -539,6 +538,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
u_upload_unmap(hud->uploader);
/* draw accumulated vertices for background quads */
+ cso_set_blend(cso, &hud->alpha_blend);
cso_set_fragment_shader_handle(hud->cso, hud->fs_color);
if (hud->bg.num_vertices) {
@@ -559,6 +559,8 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
pipe_resource_reference(&hud->bg.vbuf.buffer, NULL);
/* draw accumulated vertices for white lines */
+ cso_set_blend(cso, &hud->no_blend);
+
hud->constants.color[0] = 1;
hud->constants.color[1] = 1;
hud->constants.color[2] = 1;
@@ -578,6 +580,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
pipe_resource_reference(&hud->whitelines.vbuf.buffer, NULL);
/* draw accumulated vertices for text */
+ cso_set_blend(cso, &hud->alpha_blend);
if (hud->text.num_vertices) {
cso_set_vertex_buffers(cso, cso_get_aux_vertex_buffer_slot(cso), 1,
&hud->text.vbuf);
@@ -1170,6 +1173,8 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
}
/* blend state */
+ hud->no_blend.rt[0].colormask = PIPE_MASK_RGBA;
+
hud->alpha_blend.rt[0].colormask = PIPE_MASK_RGBA;
hud->alpha_blend.rt[0].blend_enable = 1;
hud->alpha_blend.rt[0].rgb_func = PIPE_BLEND_ADD;