mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
add rasterizer state
This commit is contained in:
parent
27016941bc
commit
29840040af
4 changed files with 34 additions and 5 deletions
|
|
@ -285,9 +285,9 @@ create_matrix_frag_shader(struct vl_idct *idct)
|
|||
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));
|
||||
|
|
@ -472,6 +472,7 @@ static void
|
|||
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;
|
||||
|
|
@ -528,6 +529,14 @@ init_state(struct vl_idct *idct)
|
|||
/*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
|
||||
|
|
@ -543,6 +552,8 @@ cleanup_state(struct vl_idct *idct)
|
|||
|
||||
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 *
|
||||
|
|
@ -730,6 +741,8 @@ vl_idct_flush(struct vl_idct *idct)
|
|||
|
||||
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]);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ struct vl_idct
|
|||
|
||||
struct pipe_resource *destination;
|
||||
|
||||
void *rs_state;
|
||||
|
||||
void *vertex_elems_state;
|
||||
|
||||
union
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ fetch_ref(struct ureg_program *shader, struct ureg_dst field, unsigned ref_frame
|
|||
{
|
||||
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);
|
||||
|
|
@ -443,6 +443,7 @@ static bool
|
|||
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;
|
||||
|
||||
|
|
@ -469,7 +470,7 @@ init_pipe_state(struct vl_mpeg12_mc_renderer *r)
|
|||
/* 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;
|
||||
}
|
||||
|
|
@ -504,6 +505,14 @@ init_pipe_state(struct vl_mpeg12_mc_renderer *r)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
@ -516,6 +525,8 @@ cleanup_pipe_state(struct vl_mpeg12_mc_renderer *r)
|
|||
|
||||
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
|
||||
|
|
@ -875,6 +886,7 @@ flush(struct vl_mpeg12_mc_renderer *r)
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ struct vl_mpeg12_mc_renderer
|
|||
|
||||
struct vl_idct idct_y, idct_cb, idct_cr;
|
||||
|
||||
void *rs_state;
|
||||
|
||||
union
|
||||
{
|
||||
void *all[5];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue