/* SHADER STATES */
-static void si_set_tesseval_regs(struct si_shader *shader,
+static void si_set_tesseval_regs(struct si_screen *sscreen,
+ struct si_shader *shader,
struct si_pm4_state *pm4)
{
struct tgsi_shader_info *info = &shader->selector->info;
unsigned tes_spacing = info->properties[TGSI_PROPERTY_TES_SPACING];
bool tes_vertex_order_cw = info->properties[TGSI_PROPERTY_TES_VERTEX_ORDER_CW];
bool tes_point_mode = info->properties[TGSI_PROPERTY_TES_POINT_MODE];
- unsigned type, partitioning, topology;
+ unsigned type, partitioning, topology, distribution_mode;
switch (tes_prim_mode) {
case PIPE_PRIM_LINES:
else
topology = V_028B6C_OUTPUT_TRIANGLE_CW;
+ if (sscreen->b.chip_class >= VI)
+ distribution_mode = V_028B6C_DISTRIBUTION_MODE_DONUTS;
+ else
+ distribution_mode = V_028B6C_DISTRIBUTION_MODE_NO_DIST;
+
si_pm4_set_reg(pm4, R_028B6C_VGT_TF_PARAM,
S_028B6C_TYPE(type) |
S_028B6C_PARTITIONING(partitioning) |
- S_028B6C_TOPOLOGY(topology));
+ S_028B6C_TOPOLOGY(topology) |
+ S_028B6C_DISTRIBUTION_MODE(distribution_mode));
}
static void si_shader_ls(struct si_shader *shader)
S_00B42C_SCRATCH_EN(shader->config.scratch_bytes_per_wave > 0));
}
-static void si_shader_es(struct si_shader *shader)
+static void si_shader_es(struct si_screen *sscreen, struct si_shader *shader)
{
struct si_pm4_state *pm4;
unsigned num_user_sgprs;
S_00B32C_SCRATCH_EN(shader->config.scratch_bytes_per_wave > 0));
if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
- si_set_tesseval_regs(shader, pm4);
+ si_set_tesseval_regs(sscreen, shader, pm4);
}
/**
* If \p gs is non-NULL, it points to the geometry shader for which this shader
* is the copy shader.
*/
-static void si_shader_vs(struct si_shader *shader, struct si_shader *gs)
+static void si_shader_vs(struct si_screen *sscreen, struct si_shader *shader,
+ struct si_shader *gs)
{
struct si_pm4_state *pm4;
unsigned num_user_sgprs;
S_028818_VPORT_Z_SCALE_ENA(1) | S_028818_VPORT_Z_OFFSET_ENA(1));
if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
- si_set_tesseval_regs(shader, pm4);
+ si_set_tesseval_regs(sscreen, shader, pm4);
}
static unsigned si_get_ps_num_interp(struct si_shader *ps)
shader->z_order = V_02880C_EARLY_Z_THEN_LATE_Z;
}
-static void si_shader_init_pm4_state(struct si_shader *shader)
+static void si_shader_init_pm4_state(struct si_screen *sscreen,
+ struct si_shader *shader)
{
if (shader->pm4)
if (shader->key.vs.as_ls)
si_shader_ls(shader);
else if (shader->key.vs.as_es)
- si_shader_es(shader);
+ si_shader_es(sscreen, shader);
else
- si_shader_vs(shader, NULL);
+ si_shader_vs(sscreen, shader, NULL);
break;
case PIPE_SHADER_TESS_CTRL:
si_shader_hs(shader);
break;
case PIPE_SHADER_TESS_EVAL:
if (shader->key.tes.as_es)
- si_shader_es(shader);
+ si_shader_es(sscreen, shader);
else
- si_shader_vs(shader, NULL);
+ si_shader_vs(sscreen, shader, NULL);
break;
case PIPE_SHADER_GEOMETRY:
si_shader_gs(shader);
- si_shader_vs(shader->gs_copy_shader, shader);
+ si_shader_vs(sscreen, shader->gs_copy_shader, shader);
break;
case PIPE_SHADER_FRAGMENT:
si_shader_ps(shader);
pipe_mutex_unlock(sel->mutex);
return r;
}
- si_shader_init_pm4_state(shader);
+ si_shader_init_pm4_state(sctx->screen, shader);
if (!sel->last_variant) {
sel->first_variant = shader;
return r;
/* Update the shader state to use the new shader bo. */
- si_shader_init_pm4_state(shader);
+ si_shader_init_pm4_state(sctx->screen, shader);
r600_resource_reference(&shader->scratch_bo, sctx->scratch_buffer);