summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_state.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-05-29 14:42:13 +0800
committerChia-I Wu <[email protected]>2013-06-07 11:13:14 +0800
commit130364ad1d5010e9320aaa312309f83746d751d3 (patch)
tree323c2d7a15292c0fdb17c500b9616751d35ea306 /src/gallium/drivers/ilo/ilo_state.c
parent3bc8289f49f6f1a7256c7d199d09d3753c10af3a (diff)
ilo: switch to ilo states for CLIP and SF stages
Define and use struct ilo_viewport_state; struct ilo_scissor_state; in ilo_context.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_state.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_state.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c
index 76a82ac7a9c..dfee07f4825 100644
--- a/src/gallium/drivers/ilo/ilo_state.c
+++ b/src/gallium/drivers/ilo/ilo_state.c
@@ -568,11 +568,13 @@ static void
ilo_set_scissor_states(struct pipe_context *pipe,
unsigned start_slot,
unsigned num_scissors,
- const struct pipe_scissor_state *state)
+ const struct pipe_scissor_state *scissors)
{
struct ilo_context *ilo = ilo_context(pipe);
+ unsigned i;
- ilo->scissor = *state;
+ for (i = 0; i < num_scissors; i++)
+ ilo->scissor.states[start_slot + i] = scissors[i];
ilo->dirty |= ILO_DIRTY_SCISSOR;
}
@@ -581,11 +583,24 @@ static void
ilo_set_viewport_states(struct pipe_context *pipe,
unsigned start_slot,
unsigned num_viewports,
- const struct pipe_viewport_state *state)
+ const struct pipe_viewport_state *viewports)
{
struct ilo_context *ilo = ilo_context(pipe);
- ilo->viewport = *state;
+ if (viewports) {
+ unsigned i;
+
+ for (i = 0; i < num_viewports; i++)
+ ilo->viewport.states[start_slot + i] = viewports[i];
+
+ if (ilo->viewport.count < start_slot + num_viewports)
+ ilo->viewport.count = start_slot + num_viewports;
+ }
+ else {
+ if (ilo->viewport.count <= start_slot + num_viewports &&
+ ilo->viewport.count > start_slot)
+ ilo->viewport.count = start_slot;
+ }
ilo->dirty |= ILO_DIRTY_VIEWPORT;
}