y1 <= 0.0f && y2 >= (float) ilo->framebuffer.height);
p->gen6_3DSTATE_CLIP(p->dev,
- ilo->rasterizer,
+ &ilo->rasterizer->state,
(ilo->fs && ilo->fs->shader->in.has_linear_interp),
enable_guardband, 1, p->cp);
}
(ilo->vs)? ilo->vs->shader : NULL;
p->gen6_3DSTATE_SF(p->dev,
- ilo->rasterizer, fs, last_sh, p->cp);
+ &ilo->rasterizer->state, fs, last_sh, p->cp);
}
}
gen6_wa_pipe_control_wm_max_threads_stall(p);
p->gen6_3DSTATE_WM(p->dev, fs, num_samplers,
- ilo->rasterizer, dual_blend, cc_may_kill, p->cp);
+ &ilo->rasterizer->state, dual_blend, cc_may_kill, p->cp);
}
}
}
p->gen6_3DSTATE_MULTISAMPLE(p->dev, num_samples, packed_sample_pos,
- ilo->rasterizer->half_pixel_center, p->cp);
+ ilo->rasterizer->state.half_pixel_center, p->cp);
p->gen6_3DSTATE_SAMPLE_MASK(p->dev,
(num_samples > 1) ? ilo->sample_mask : 0x1, p->cp);
{
/* 3DSTATE_POLY_STIPPLE_PATTERN and 3DSTATE_POLY_STIPPLE_OFFSET */
if ((DIRTY(RASTERIZER) || DIRTY(POLY_STIPPLE)) &&
- ilo->rasterizer->poly_stipple_enable) {
+ ilo->rasterizer->state.poly_stipple_enable) {
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
}
/* 3DSTATE_LINE_STIPPLE */
- if (DIRTY(RASTERIZER) && ilo->rasterizer->line_stipple_enable) {
+ if (DIRTY(RASTERIZER) && ilo->rasterizer->state.line_stipple_enable) {
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
p->gen6_3DSTATE_LINE_STIPPLE(p->dev,
- ilo->rasterizer->line_stipple_pattern,
- ilo->rasterizer->line_stipple_factor + 1, p->cp);
+ ilo->rasterizer->state.line_stipple_pattern,
+ ilo->rasterizer->state.line_stipple_factor + 1, p->cp);
}
/* 3DSTATE_AA_LINE_PARAMETERS */
- if (DIRTY(RASTERIZER) && ilo->rasterizer->line_smooth) {
+ if (DIRTY(RASTERIZER) && ilo->rasterizer->state.line_smooth) {
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
const unsigned buffer_mask = (1 << ilo->so.count) - 1;
p->gen7_3DSTATE_STREAMOUT(p->dev, buffer_mask, sh->out.count,
- ilo->rasterizer->rasterizer_discard, p->cp);
+ ilo->rasterizer->state.rasterizer_discard, p->cp);
}
}
(ilo->vs)? ilo->vs->shader : NULL;
p->gen7_3DSTATE_SBE(p->dev,
- ilo->rasterizer, fs, last_sh, p->cp);
+ &ilo->rasterizer->state, fs, last_sh, p->cp);
}
/* 3DSTATE_SF */
gen7_wa_pipe_control_cs_stall(p, true, true);
p->gen7_3DSTATE_SF(p->dev,
- ilo->rasterizer, ilo->framebuffer.zsbuf, p->cp);
+ &ilo->rasterizer->state, ilo->framebuffer.zsbuf, p->cp);
}
}
gen7_wa_pipe_control_wm_max_threads_stall(p);
p->gen7_3DSTATE_WM(p->dev,
- fs, ilo->rasterizer, cc_may_kill, p->cp);
+ fs, &ilo->rasterizer->state, cc_may_kill, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_PS */
&p->packed_sample_position_1x;
p->gen6_3DSTATE_MULTISAMPLE(p->dev, num_samples, packed_sample_pos,
- ilo->rasterizer->half_pixel_center, p->cp);
+ ilo->rasterizer->state.half_pixel_center, p->cp);
p->gen7_3DSTATE_SAMPLE_MASK(p->dev,
(num_samples > 1) ? ilo->sample_mask : 0x1,
switch (op) {
case ILO_BLITTER_CLEAR:
- util_blitter_save_rasterizer(ilo->blitter, ilo->rasterizer);
+ util_blitter_save_rasterizer(ilo->blitter, (void *) ilo->rasterizer);
break;
case ILO_BLITTER_CLEAR_SURFACE:
util_blitter_save_framebuffer(ilo->blitter, &ilo->framebuffer);
break;
case ILO_BLITTER_BLIT:
- util_blitter_save_rasterizer(ilo->blitter, ilo->rasterizer);
+ util_blitter_save_rasterizer(ilo->blitter, (void *) ilo->rasterizer);
util_blitter_save_framebuffer(ilo->blitter, &ilo->framebuffer);
util_blitter_save_fragment_sampler_states(ilo->blitter,
struct ilo_viewport_state viewport;
struct ilo_scissor_state scissor;
+ const struct ilo_rasterizer_state *rasterizer;
+ struct pipe_poly_stipple poly_stipple;
+ unsigned sample_mask;
+
struct pipe_blend_state *blend;
- struct pipe_rasterizer_state *rasterizer;
struct pipe_depth_stencil_alpha_state *depth_stencil_alpha;
struct ilo_shader_state *fs;
struct ilo_shader_state *vs;
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
- unsigned sample_mask;
struct pipe_framebuffer_state framebuffer;
- struct pipe_poly_stipple poly_stipple;
struct {
struct pipe_sampler_state *samplers[ILO_MAX_SAMPLERS];
struct pipe_scissor_state states[ILO_MAX_VIEWPORTS];
};
+struct ilo_rasterizer_state {
+ struct pipe_rasterizer_state state;
+};
+
#endif /* ILO_GPE_H */
switch (info->type) {
case PIPE_SHADER_VERTEX:
- variant->u.vs.rasterizer_discard = ilo->rasterizer->rasterizer_discard;
+ variant->u.vs.rasterizer_discard =
+ ilo->rasterizer->state.rasterizer_discard;
variant->u.vs.num_ucps =
- util_last_bit(ilo->rasterizer->clip_plane_enable);
+ util_last_bit(ilo->rasterizer->state.clip_plane_enable);
break;
case PIPE_SHADER_GEOMETRY:
- variant->u.gs.rasterizer_discard = ilo->rasterizer->rasterizer_discard;
+ variant->u.gs.rasterizer_discard =
+ ilo->rasterizer->state.rasterizer_discard;
variant->u.gs.num_inputs = ilo->vs->shader->out.count;
for (i = 0; i < ilo->vs->shader->out.count; i++) {
variant->u.gs.semantic_names[i] =
break;
case PIPE_SHADER_FRAGMENT:
variant->u.fs.flatshade =
- (info->has_color_interp && ilo->rasterizer->flatshade);
+ (info->has_color_interp && ilo->rasterizer->state.flatshade);
variant->u.fs.fb_height = (info->has_pos) ?
ilo->framebuffer.height : 1;
variant->u.fs.num_cbufs = ilo->framebuffer.nr_cbufs;
ilo_create_rasterizer_state(struct pipe_context *pipe,
const struct pipe_rasterizer_state *state)
{
- struct pipe_rasterizer_state *rast;
+ struct ilo_rasterizer_state *rast;
- rast = MALLOC_STRUCT(pipe_rasterizer_state);
+ rast = MALLOC_STRUCT(ilo_rasterizer_state);
assert(rast);
- *rast = *state;
+ rast->state = *state;
return rast;
}