From 99725d2f8ae2e2d0dd1e80ac05b127c7f99778d3 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 30 May 2013 19:48:32 +0800 Subject: ilo: construct SCISSOR_RECT in set_scissor_states() This allows us to memcpy() the state in draw_vbo(). Add ilo_init_states() and ilo_cleanup_states() that are called when contexts are created and destroyed respectively, and properly set the initial scissor state in ilo_init_states(). --- src/gallium/drivers/ilo/ilo_state.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/ilo/ilo_state.c') diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c index 205128e0993..cc74d03c49b 100644 --- a/src/gallium/drivers/ilo/ilo_state.c +++ b/src/gallium/drivers/ilo/ilo_state.c @@ -581,10 +581,9 @@ ilo_set_scissor_states(struct pipe_context *pipe, const struct pipe_scissor_state *scissors) { struct ilo_context *ilo = ilo_context(pipe); - unsigned i; - for (i = 0; i < num_scissors; i++) - ilo->scissor.states[start_slot + i] = scissors[i]; + ilo_gpe_set_scissor(ilo->dev, start_slot, num_scissors, + scissors, &ilo->scissor); ilo->dirty |= ILO_DIRTY_SCISSOR; } @@ -1056,3 +1055,14 @@ ilo_init_state_functions(struct ilo_context *ilo) ilo->base.set_compute_resources = ilo_set_compute_resources; ilo->base.set_global_binding = ilo_set_global_binding; } + +void +ilo_init_states(struct ilo_context *ilo) +{ + ilo_gpe_set_scissor_null(ilo->dev, &ilo->scissor); +} + +void +ilo_cleanup_states(struct ilo_context *ilo) +{ +} -- cgit v1.2.3