summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_state_gen7.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-10-04 10:51:20 +0800
committerChia-I Wu <[email protected]>2014-10-04 23:18:51 +0800
commitca824e69403a32144328d1fb7987d0537e88ee04 (patch)
treeda6d1abfffb4339837f3d8cb1111405100cbe175 /src/gallium/drivers/ilo/ilo_state_gen7.c
parent0c4bc1e29223ffec4617999c0c03d722bdcc170a (diff)
ilo: let shaders determine sampler counts
When a shader needs N samplers, we should upload N samplers and not depend on how many are bound. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_state_gen7.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_state_gen7.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state_gen7.c b/src/gallium/drivers/ilo/ilo_state_gen7.c
index 53c3aebc634..f91a088b059 100644
--- a/src/gallium/drivers/ilo/ilo_state_gen7.c
+++ b/src/gallium/drivers/ilo/ilo_state_gen7.c
@@ -39,13 +39,14 @@ ilo_gpe_init_gs_cso_gen7(const struct ilo_dev_info *dev,
const struct ilo_shader_state *gs,
struct ilo_shader_cso *cso)
{
- int start_grf, vue_read_len, max_threads;
+ int start_grf, vue_read_len, sampler_count, max_threads;
uint32_t dw2, dw4, dw5;
ILO_DEV_ASSERT(dev, 7, 7.5);
start_grf = ilo_shader_get_kernel_param(gs, ILO_KERNEL_URB_DATA_START_REG);
vue_read_len = ilo_shader_get_kernel_param(gs, ILO_KERNEL_INPUT_COUNT);
+ sampler_count = ilo_shader_get_kernel_param(gs, ILO_KERNEL_SAMPLER_COUNT);
/* in pairs */
vue_read_len = (vue_read_len + 1) / 2;
@@ -63,6 +64,7 @@ ilo_gpe_init_gs_cso_gen7(const struct ilo_dev_info *dev,
}
dw2 = (true) ? 0 : GEN6_THREADDISP_FP_MODE_ALT;
+ dw2 |= ((sampler_count + 3) / 4) << GEN6_THREADDISP_SAMPLER_COUNT__SHIFT;
dw4 = vue_read_len << GEN7_GS_DW4_URB_READ_LEN__SHIFT |
GEN7_GS_DW4_INCLUDE_VERTEX_HANDLES |
@@ -131,15 +133,17 @@ ilo_gpe_init_fs_cso_gen7(const struct ilo_dev_info *dev,
const struct ilo_shader_state *fs,
struct ilo_shader_cso *cso)
{
- int start_grf, max_threads;
+ int start_grf, sampler_count, max_threads;
uint32_t dw2, dw4, dw5;
uint32_t wm_interps, wm_dw1;
ILO_DEV_ASSERT(dev, 7, 7.5);
start_grf = ilo_shader_get_kernel_param(fs, ILO_KERNEL_URB_DATA_START_REG);
+ sampler_count = ilo_shader_get_kernel_param(fs, ILO_KERNEL_SAMPLER_COUNT);
dw2 = (true) ? 0 : GEN6_THREADDISP_FP_MODE_ALT;
+ dw2 |= ((sampler_count + 3) / 4) << GEN6_THREADDISP_SAMPLER_COUNT__SHIFT;
dw4 = GEN7_PS_DW4_POSOFFSET_NONE;