summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_state.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-05-29 15:06:48 +0800
committerChia-I Wu <[email protected]>2013-06-07 11:13:15 +0800
commit94212915ee8f7bf98c8adfe248a05a382d00c191 (patch)
tree0a446299c9c70f183018996cc6b0ce836515f9f6 /src/gallium/drivers/ilo/ilo_state.c
parent29b938d9f43a4bc355ee05cad2c9796ea7ee93dd (diff)
ilo: switch to ilo states for CC stage
Define and use struct ilo_dsa_state; struct ilo_blend_state; struct ilo_fb_state; in ilo_context.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_state.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_state.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c
index 30d5056f053..0048a1541f0 100644
--- a/src/gallium/drivers/ilo/ilo_state.c
+++ b/src/gallium/drivers/ilo/ilo_state.c
@@ -156,12 +156,12 @@ static void *
ilo_create_blend_state(struct pipe_context *pipe,
const struct pipe_blend_state *state)
{
- struct pipe_blend_state *blend;
+ struct ilo_blend_state *blend;
- blend = MALLOC_STRUCT(pipe_blend_state);
+ blend = MALLOC_STRUCT(ilo_blend_state);
assert(blend);
- *blend = *state;
+ blend->state = *state;
return blend;
}
@@ -330,12 +330,12 @@ static void *
ilo_create_depth_stencil_alpha_state(struct pipe_context *pipe,
const struct pipe_depth_stencil_alpha_state *state)
{
- struct pipe_depth_stencil_alpha_state *dsa;
+ struct ilo_dsa_state *dsa;
- dsa = MALLOC_STRUCT(pipe_depth_stencil_alpha_state);
+ dsa = MALLOC_STRUCT(ilo_dsa_state);
assert(dsa);
- *dsa = *state;
+ dsa->state = *state;
return dsa;
}
@@ -345,7 +345,7 @@ ilo_bind_depth_stencil_alpha_state(struct pipe_context *pipe, void *state)
{
struct ilo_context *ilo = ilo_context(pipe);
- ilo->depth_stencil_alpha = state;
+ ilo->dsa = state;
ilo->dirty |= ILO_DIRTY_DEPTH_STENCIL_ALPHA;
}
@@ -548,7 +548,17 @@ ilo_set_framebuffer_state(struct pipe_context *pipe,
{
struct ilo_context *ilo = ilo_context(pipe);
- util_copy_framebuffer_state(&ilo->framebuffer, state);
+ util_copy_framebuffer_state(&ilo->fb.state, state);
+
+ if (state->nr_cbufs)
+ ilo->fb.num_samples = state->cbufs[0]->texture->nr_samples;
+ else if (state->zsbuf)
+ ilo->fb.num_samples = state->zsbuf->texture->nr_samples;
+ else
+ ilo->fb.num_samples = 1;
+
+ if (!ilo->fb.num_samples)
+ ilo->fb.num_samples = 1;
ilo->dirty |= ILO_DIRTY_FRAMEBUFFER;
}