summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_shader.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-07-18 05:58:45 +0800
committerChia-I Wu <[email protected]>2013-08-13 16:04:35 +0800
commitc6e1e0157b9bd9ec416062a21bbd30ca9b69f363 (patch)
treeae4d35cb65e3a14bec016b6008ab8d9615d50db1 /src/gallium/drivers/ilo/ilo_shader.c
parent5e30ffbda6259c2bbd519c5fe092df1db1d0c94d (diff)
ilo: support push constant model in shaders
Source constants from URB constant data when the constant data can fit in the PCB.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_shader.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_shader.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c
index b1a11a1391b..0c785201d1a 100644
--- a/src/gallium/drivers/ilo/ilo_shader.c
+++ b/src/gallium/drivers/ilo/ilo_shader.c
@@ -273,6 +273,13 @@ ilo_shader_variant_init(struct ilo_shader_variant *variant,
break;
}
+ /* use PCB unless constant buffer 0 is not in user buffer */
+ if ((ilo->cbuf[info->type].enabled_mask & 0x1) &&
+ !ilo->cbuf[info->type].cso[0].user_buffer)
+ variant->use_pcb = false;
+ else
+ variant->use_pcb = true;
+
num_views = ilo->view[info->type].count;
assert(info->num_samplers <= num_views);
@@ -341,6 +348,8 @@ ilo_shader_variant_guess(struct ilo_shader_variant *variant,
break;
}
+ variant->use_pcb = true;
+
variant->num_sampler_views = info->num_samplers;
for (i = 0; i < info->num_samplers; i++) {
if (info->shadow_samplers & (1 << i)) {
@@ -747,7 +756,8 @@ ilo_shader_create_vs(const struct ilo_dev_info *dev,
/* states used in ilo_shader_variant_init() */
shader->info.non_orthogonal_states = ILO_DIRTY_VIEW_VS |
- ILO_DIRTY_RASTERIZER;
+ ILO_DIRTY_RASTERIZER |
+ ILO_DIRTY_CBUF;
return shader;
}
@@ -764,7 +774,8 @@ ilo_shader_create_gs(const struct ilo_dev_info *dev,
/* states used in ilo_shader_variant_init() */
shader->info.non_orthogonal_states = ILO_DIRTY_VIEW_GS |
ILO_DIRTY_VS |
- ILO_DIRTY_RASTERIZER;
+ ILO_DIRTY_RASTERIZER |
+ ILO_DIRTY_CBUF;
return shader;
}
@@ -781,7 +792,8 @@ ilo_shader_create_fs(const struct ilo_dev_info *dev,
/* states used in ilo_shader_variant_init() */
shader->info.non_orthogonal_states = ILO_DIRTY_VIEW_FS |
ILO_DIRTY_RASTERIZER |
- ILO_DIRTY_FB;
+ ILO_DIRTY_FB |
+ ILO_DIRTY_CBUF;
return shader;
}
@@ -1061,10 +1073,10 @@ ilo_shader_get_kernel_param(const struct ilo_shader_state *shader,
val = kernel->in.start_grf;
break;
case ILO_KERNEL_SKIP_CBUF0_UPLOAD:
- val = false;
+ val = kernel->skip_cbuf0_upload;
break;
case ILO_KERNEL_PCB_CBUF0_SIZE:
- val = 0;
+ val = kernel->pcb.cbuf0_size;
break;
case ILO_KERNEL_VS_INPUT_INSTANCEID: