summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_gpe_gen6.c
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <[email protected]>2013-05-31 13:43:11 -0600
committerChia-I Wu <[email protected]>2013-06-07 11:13:15 +0800
commitc6983ea035d6bef345517a13fed6abc1441407cf (patch)
tree09fa6c7f4635e7f6a1098837042824d1b1daea50 /src/gallium/drivers/ilo/ilo_gpe_gen6.c
parent70e78211d6c09b3076ac261d2cde9d0037540065 (diff)
ilo: convert generic depth-stencil-alpha pipe state to ilo pipe state
Moving the work to create time reduces the work at emit time. Saves time overall as create work is only done once. Fix compiler warning in gen7_pipeline_sol. [olv: remember pipe_alpha_state instead of pipe_depth_stencil_alpha_state in ilo_dsa_state]
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_gpe_gen6.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen6.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen6.c b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
index 3167bd692ee..82818e78aa3 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
@@ -3573,22 +3573,23 @@ gen6_emit_BLEND_STATE(const struct ilo_dev_info *dev,
return state_offset;
}
-static uint32_t
-gen6_emit_DEPTH_STENCIL_STATE(const struct ilo_dev_info *dev,
- const struct pipe_depth_stencil_alpha_state *dsa,
- struct ilo_cp *cp)
+void
+ilo_gpe_init_dsa(const struct ilo_dev_info *dev,
+ const struct pipe_depth_stencil_alpha_state *state,
+ struct ilo_dsa_state *dsa)
{
- const struct pipe_depth_state *depth = &dsa->depth;
- const struct pipe_stencil_state *stencil0 = &dsa->stencil[0];
- const struct pipe_stencil_state *stencil1 = &dsa->stencil[1];
- const int state_align = 64 / 4;
- const int state_len = 3;
- uint32_t state_offset, *dw;
+ const struct pipe_depth_state *depth = &state->depth;
+ const struct pipe_stencil_state *stencil0 = &state->stencil[0];
+ const struct pipe_stencil_state *stencil1 = &state->stencil[1];
+ uint32_t *dw;
ILO_GPE_VALID_GEN(dev, 6, 7);
- dw = ilo_cp_steal_ptr(cp, "DEPTH_STENCIL_STATE",
- state_len, state_align, &state_offset);
+ /* copy alpha state for later use */
+ dsa->alpha = state->alpha;
+
+ STATIC_ASSERT(Elements(dsa->payload) >= 3);
+ dw = dsa->payload;
/*
* From the Sandy Bridge PRM, volume 2 part 1, page 359:
@@ -3653,6 +3654,26 @@ gen6_emit_DEPTH_STENCIL_STATE(const struct ilo_dev_info *dev,
dw[2] |= gen6_translate_dsa_func(depth->func) << 27;
else
dw[2] |= BRW_COMPAREFUNCTION_ALWAYS << 27;
+}
+
+static uint32_t
+gen6_emit_DEPTH_STENCIL_STATE(const struct ilo_dev_info *dev,
+ const struct ilo_dsa_state *dsa,
+ struct ilo_cp *cp)
+{
+ const int state_align = 64 / 4;
+ const int state_len = 3;
+ uint32_t state_offset, *dw;
+
+
+ ILO_GPE_VALID_GEN(dev, 6, 7);
+
+ dw = ilo_cp_steal_ptr(cp, "DEPTH_STENCIL_STATE",
+ state_len, state_align, &state_offset);
+
+ dw[0] = dsa->payload[0];
+ dw[1] = dsa->payload[1];
+ dw[2] = dsa->payload[2];
return state_offset;
}