* fragment = csc * texel
*/
ureg_TEX(shader, texel, TGSI_TEXTURE_2D, tc, sampler);
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < 3; ++i)
ureg_DP4(shader, ureg_writemask(fragment, TGSI_WRITEMASK_X << i), csc[i], ureg_src(texel));
+ ureg_MOV(shader, ureg_writemask(fragment, TGSI_WRITEMASK_W), ureg_imm1f(shader, 1.0f));
ureg_release_temporary(shader, texel);
ureg_END(shader);
init_pipe_state(struct vl_compositor *c)
{
struct pipe_sampler_state sampler;
+ struct pipe_blend_state blend;
assert(c);
/*sampler.max_anisotropy = ;*/
c->sampler = c->pipe->create_sampler_state(c->pipe, &sampler);
+ memset(&blend, 0, sizeof blend);
+ blend.independent_blend_enable = 0;
+ blend.rt[0].blend_enable = 1;
+ blend.rt[0].rgb_func = PIPE_BLEND_ADD;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ blend.rt[0].alpha_func = PIPE_BLEND_ADD;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+ blend.logicop_enable = 0;
+ blend.logicop_func = PIPE_LOGICOP_CLEAR;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
+ blend.dither = 0;
+ c->blend = c->pipe->create_blend_state(c->pipe, &blend);
+
return true;
}
assert(c);
c->pipe->delete_sampler_state(c->pipe, c->sampler);
+ c->pipe->delete_blend_state(c->pipe, c->blend);
}
static bool
num_rects = gen_data(c, src_surface, src_rect, dst_rect, src_surfaces, frag_shaders);
+ c->pipe->bind_blend_state(c->pipe, c->blend);
for (i = 0; i < num_rects; ++i) {
c->pipe->bind_fs_state(c->pipe, frag_shaders[i]);
c->pipe->set_fragment_sampler_views(c->pipe, 1, &src_surfaces[i]);
ctx->pipe->set_vertex_buffers(ctx->pipe, 2, buf->vertex_bufs.all);
ctx->pipe->bind_vertex_elements_state(ctx->pipe, ctx->vertex_elems_state);
+ ctx->pipe->bind_blend_state(ctx->pipe, ctx->blend);
vl_idct_flush(&ctx->idct_y, &buf->idct_y, ne_num);
vl_idct_flush(&ctx->idct_cr, &buf->idct_cr, ne_num);
vl_idct_flush(&ctx->idct_cb, &buf->idct_cb, ne_num);
blend.rt[0].colormask = PIPE_MASK_RGBA;
blend.dither = 0;
ctx->blend = ctx->pipe->create_blend_state(ctx->pipe, &blend);
- ctx->pipe->bind_blend_state(ctx->pipe, ctx->blend);
memset(&dsa, 0, sizeof dsa);
dsa.depth.enabled = 0;