return &pipeline->shaders[MESA_SHADER_VERTEX]->info.vs.outinfo;
}
-static void calculate_vgt_gs_mode(struct radv_pipeline *pipeline)
-{
- const struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
-
- pipeline->graphics.vgt_primitiveid_en = false;
- pipeline->graphics.vgt_gs_mode = 0;
-
- if (radv_pipeline_has_gs(pipeline)) {
- struct radv_shader_variant *gs =
- pipeline->shaders[MESA_SHADER_GEOMETRY];
-
- pipeline->graphics.vgt_gs_mode =
- ac_vgt_gs_mode(gs->info.gs.vertices_out,
- pipeline->device->physical_device->rad_info.chip_class);
- } else if (outinfo->export_prim_id) {
- pipeline->graphics.vgt_gs_mode = S_028A40_MODE(V_028A40_GS_SCENARIO_A);
- pipeline->graphics.vgt_primitiveid_en = true;
- }
-}
-
static void
radv_link_shaders(struct radv_pipeline *pipeline, nir_shader **shaders)
{
}
}
+static void
+radv_pipeline_generate_vgt_gs_mode(struct radeon_winsys_cs *cs,
+ const struct radv_pipeline *pipeline)
+{
+ const struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
+
+ uint32_t vgt_primitiveid_en = false;
+ uint32_t vgt_gs_mode = 0;
+
+ if (radv_pipeline_has_gs(pipeline)) {
+ const struct radv_shader_variant *gs =
+ pipeline->shaders[MESA_SHADER_GEOMETRY];
+
+ vgt_gs_mode = ac_vgt_gs_mode(gs->info.gs.vertices_out,
+ pipeline->device->physical_device->rad_info.chip_class);
+ } else if (outinfo->export_prim_id) {
+ vgt_gs_mode = S_028A40_MODE(V_028A40_GS_SCENARIO_A);
+ vgt_primitiveid_en = true;
+ }
+
+ radeon_set_context_reg(cs, R_028A84_VGT_PRIMITIVEID_EN, vgt_primitiveid_en);
+ radeon_set_context_reg(cs, R_028A40_VGT_GS_MODE, vgt_gs_mode);
+}
+
static void
radv_pipeline_generate_hw_vs(struct radeon_winsys_cs *cs,
struct radv_pipeline *pipeline,
{
struct radv_shader_variant *vs;
- radeon_set_context_reg(cs, R_028A84_VGT_PRIMITIVEID_EN, pipeline->graphics.vgt_primitiveid_en);
-
/* Skip shaders merged into HS/GS */
vs = pipeline->shaders[MESA_SHADER_VERTEX];
if (!vs)
struct radv_shader_variant *gs;
uint64_t va;
- radeon_set_context_reg(cs, R_028A40_VGT_GS_MODE, pipeline->graphics.vgt_gs_mode);
-
gs = pipeline->shaders[MESA_SHADER_GEOMETRY];
if (!gs)
return;
radv_pipeline_generate_blend_state(&pipeline->cs, pipeline, blend);
radv_pipeline_generate_raster_state(&pipeline->cs, pipeline);
radv_pipeline_generate_multisample_state(&pipeline->cs, pipeline);
+ radv_pipeline_generate_vgt_gs_mode(&pipeline->cs, pipeline);
radv_pipeline_generate_vertex_shader(&pipeline->cs, pipeline, tess);
radv_pipeline_generate_tess_shaders(&pipeline->cs, pipeline, tess);
radv_pipeline_generate_geometry_shader(&pipeline->cs, pipeline);
blend.spi_shader_col_format = V_028714_SPI_SHADER_32_R;
}
- calculate_vgt_gs_mode(pipeline);
-
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (pipeline->shaders[i]) {
pipeline->need_indirect_descriptor_sets |= pipeline->shaders[i]->info.need_indirect_descriptor_sets;