diff options
author | Chia-I Wu <[email protected]> | 2013-06-24 14:13:33 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-06-25 13:51:58 +0800 |
commit | 9b18df6e087a4db8ed5ed38bcc6b1db34fa95586 (patch) | |
tree | 677fc49af1f7b06ebce449dc39f2e56e42252ace /src/gallium/drivers/ilo/shader | |
parent | c4fa24ff0873b7b9a5c4dacbd2c130788e88ad35 (diff) |
ilo: move SBE setup code to ilo_shader.c
Add ilo_shader_select_kernel_routing() to construct 3DSTATE_SBE. It is called
in ilo_finalize_states(), rather than in create_fs_state(), as it depends on
VS/GS and rasterizer states.
With this change, ilo_shader_internal.h is no longer needed for
ilo_gpe_gen6.c.
Diffstat (limited to 'src/gallium/drivers/ilo/shader')
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_fs.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_internal.h | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c index eca118aa2a1..bea2c097e14 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c @@ -1574,6 +1574,9 @@ fs_setup_shader_in(struct ilo_shader *sh, const struct toy_tgsi *tgsi, } switch (tgsi->inputs[i].interp) { + case TGSI_INTERPOLATE_CONSTANT: + sh->in.const_interp_enable |= 1 << i; + break; case TGSI_INTERPOLATE_LINEAR: sh->in.has_linear_interp = true; @@ -1587,8 +1590,10 @@ fs_setup_shader_in(struct ilo_shader *sh, const struct toy_tgsi *tgsi, } break; case TGSI_INTERPOLATE_COLOR: - if (flatshade) + if (flatshade) { + sh->in.const_interp_enable |= 1 << i; break; + } /* fall through */ case TGSI_INTERPOLATE_PERSPECTIVE: if (tgsi->inputs[i].centroid) { diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_internal.h b/src/gallium/drivers/ilo/shader/ilo_shader_internal.h index 3515e3f1d9f..d9ae2fa0a8f 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_internal.h +++ b/src/gallium/drivers/ilo/shader/ilo_shader_internal.h @@ -30,6 +30,7 @@ #include "ilo_common.h" #include "ilo_context.h" +#include "ilo_shader.h" /* XXX The interface needs to be reworked */ @@ -88,6 +89,7 @@ struct ilo_shader { bool has_pos; bool has_linear_interp; int barycentric_interpolation_mode; + uint32_t const_interp_enable; bool discard_adj; } in; @@ -114,6 +116,8 @@ struct ilo_shader { void *kernel; int kernel_size; + struct ilo_kernel_routing routing; + /* what does the push constant buffer consist of? */ struct { int clip_state_size; |