fragment[i] = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, i);
/* pixel center is at 0.5 not 0.0 !!! */
- ureg_ADD(shader, ureg_writemask(t_tc, TGSI_WRITEMASK_Y),
- tex, ureg_imm1f(shader, -2.0f / source->height0));
-
+ //ureg_ADD(shader, ureg_writemask(t_tc, TGSI_WRITEMASK_Y),
+ // tex, ureg_imm1f(shader, -2.0f / source->height0));
+ ureg_MOV(shader, ureg_writemask(t_tc, TGSI_WRITEMASK_Y), tex);
for (i = 0; i < 4; ++i) {
fetch_four(shader, l[i], ureg_src(t_tc), sampler[0], start[0], block, false, false, source->width0);
ureg_MUL(shader, l[i][0], ureg_src(l[i][0]), ureg_imm1f(shader, STAGE1_SCALE));
init_state(struct vl_idct *idct)
{
struct pipe_sampler_state sampler;
+ struct pipe_rasterizer_state rs_state;
unsigned i;
idct->viewport[0].scale[0] = idct->textures.individual.intermediate->width0;
/*sampler.max_anisotropy = ; */
idct->samplers.all[i] = idct->pipe->create_sampler_state(idct->pipe, &sampler);
}
+
+ memset(&rs_state, 0, sizeof(rs_state));
+ /*rs_state.sprite_coord_enable */
+ rs_state.sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
+ rs_state.point_quad_rasterization = true;
+ rs_state.point_size = BLOCK_WIDTH;
+ rs_state.gl_rasterization_rules = false;
+ idct->rs_state = idct->pipe->create_rasterizer_state(idct->pipe, &rs_state);
}
static void
for (i = 0; i < 4; ++i)
idct->pipe->delete_sampler_state(idct->pipe, idct->samplers.all[i]);
+
+ idct->pipe->delete_rasterizer_state(idct->pipe, idct->rs_state);
}
struct pipe_resource *
if(num_blocks > 0) {
+ idct->pipe->bind_rasterizer_state(idct->pipe, idct->rs_state);
+
/* first stage */
idct->pipe->set_framebuffer_state(idct->pipe, &idct->fb_state[0]);
idct->pipe->set_viewport_state(idct->pipe, &idct->viewport[0]);
{
struct ureg_src tc[ref_frames * mv_per_frame], sampler[ref_frames];
struct ureg_dst ref[ref_frames], t_tc, result;
- unsigned i, label;
+ unsigned i;
for (i = 0; i < ref_frames * mv_per_frame; ++i)
tc[i] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_MV0 + i, TGSI_INTERPOLATE_LINEAR);
init_pipe_state(struct vl_mpeg12_mc_renderer *r)
{
struct pipe_sampler_state sampler;
+ struct pipe_rasterizer_state rs_state;
unsigned filters[5];
unsigned i;
/* Luma filter */
filters[0] = PIPE_TEX_FILTER_NEAREST;
/* Chroma filters */
- if (r->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_444 || true) { //TODO
+ if (r->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_444) {
filters[1] = PIPE_TEX_FILTER_NEAREST;
filters[2] = PIPE_TEX_FILTER_NEAREST;
}
r->samplers.all[i] = r->pipe->create_sampler_state(r->pipe, &sampler);
}
+ memset(&rs_state, 0, sizeof(rs_state));
+ /*rs_state.sprite_coord_enable */
+ rs_state.sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
+ rs_state.point_quad_rasterization = true;
+ rs_state.point_size = BLOCK_WIDTH;
+ rs_state.gl_rasterization_rules = true;
+ r->rs_state = r->pipe->create_rasterizer_state(r->pipe, &rs_state);
+
return true;
}
for (i = 0; i < 5; ++i)
r->pipe->delete_sampler_state(r->pipe, r->samplers.all[i]);
+
+ r->pipe->delete_rasterizer_state(r->pipe, r->rs_state);
}
static bool
upload_vertex_stream(r, num_macroblocks);
+ r->pipe->bind_rasterizer_state(r->pipe, r->rs_state);
r->pipe->set_framebuffer_state(r->pipe, &r->fb_state);
r->pipe->set_viewport_state(r->pipe, &r->viewport);