return tess;
}
-static const struct radv_prim_vertex_count prim_size_table[] = {
- [V_008958_DI_PT_NONE] = {0, 0},
- [V_008958_DI_PT_POINTLIST] = {1, 1},
- [V_008958_DI_PT_LINELIST] = {2, 2},
- [V_008958_DI_PT_LINESTRIP] = {2, 1},
- [V_008958_DI_PT_TRILIST] = {3, 3},
- [V_008958_DI_PT_TRIFAN] = {3, 1},
- [V_008958_DI_PT_TRISTRIP] = {3, 1},
- [V_008958_DI_PT_LINELIST_ADJ] = {4, 4},
- [V_008958_DI_PT_LINESTRIP_ADJ] = {4, 1},
- [V_008958_DI_PT_TRILIST_ADJ] = {6, 6},
- [V_008958_DI_PT_TRISTRIP_ADJ] = {6, 2},
- [V_008958_DI_PT_RECTLIST] = {3, 3},
- [V_008958_DI_PT_LINELOOP] = {2, 1},
- [V_008958_DI_PT_POLYGON] = {3, 1},
- [V_008958_DI_PT_2D_TRI_STRIP] = {0, 0},
-};
-
static const struct radv_vs_output_info *get_vs_output_info(const struct radv_pipeline *pipeline)
{
if (radv_pipeline_has_gs(pipeline))
gs_out = V_028A6C_VGT_OUT_RECT_V0;
}
pipeline->graphics.prim_restart_enable = !!pCreateInfo->pInputAssemblyState->primitiveRestartEnable;
- /* prim vertex count will need TESS changes */
- pipeline->graphics.prim_vertex_count = prim_size_table[prim];
radv_pipeline_init_dynamic_state(pipeline, pCreateInfo);
struct radv_tessellation_state tess = {0};
if (radv_pipeline_has_tess(pipeline)) {
- if (prim == V_008958_DI_PT_PATCH) {
- pipeline->graphics.prim_vertex_count.min = pCreateInfo->pTessellationState->patchControlPoints;
- pipeline->graphics.prim_vertex_count.incr = 1;
- }
+ pipeline->graphics.tess_patch_control_points =
+ pCreateInfo->pTessellationState->patchControlPoints;
tess = calculate_tess_state(pipeline, pCreateInfo);
}
return 1 + ((num - info->min) / info->incr);
}
+static const struct radv_prim_vertex_count prim_size_table[] = {
+ [V_008958_DI_PT_NONE] = {0, 0},
+ [V_008958_DI_PT_POINTLIST] = {1, 1},
+ [V_008958_DI_PT_LINELIST] = {2, 2},
+ [V_008958_DI_PT_LINESTRIP] = {2, 1},
+ [V_008958_DI_PT_TRILIST] = {3, 3},
+ [V_008958_DI_PT_TRIFAN] = {3, 1},
+ [V_008958_DI_PT_TRISTRIP] = {3, 1},
+ [V_008958_DI_PT_LINELIST_ADJ] = {4, 4},
+ [V_008958_DI_PT_LINESTRIP_ADJ] = {4, 1},
+ [V_008958_DI_PT_TRILIST_ADJ] = {6, 6},
+ [V_008958_DI_PT_TRISTRIP_ADJ] = {6, 2},
+ [V_008958_DI_PT_RECTLIST] = {3, 3},
+ [V_008958_DI_PT_LINELOOP] = {2, 1},
+ [V_008958_DI_PT_POLYGON] = {3, 1},
+ [V_008958_DI_PT_2D_TRI_STRIP] = {0, 0},
+};
+
uint32_t
si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer,
bool instanced_draw, bool indirect_draw,
bool partial_es_wave = cmd_buffer->state.pipeline->graphics.ia_multi_vgt_param.partial_es_wave;
unsigned topology = cmd_buffer->state.pipeline->graphics.topology;
bool multi_instances_smaller_than_primgroup;
+ struct radv_prim_vertex_count prim_vertex_count = prim_size_table[topology];
+
+ if (radv_pipeline_has_tess(cmd_buffer->state.pipeline)) {
+ if (topology == V_008958_DI_PT_PATCH) {
+ prim_vertex_count.min = cmd_buffer->state.pipeline->graphics.tess_patch_control_points;
+ prim_vertex_count.incr = 1;
+ }
+ }
multi_instances_smaller_than_primgroup = indirect_draw;
if (!multi_instances_smaller_than_primgroup && instanced_draw) {
- uint32_t num_prims = radv_prims_for_vertices(&cmd_buffer->state.pipeline->graphics.prim_vertex_count, draw_vertex_count);
+ uint32_t num_prims = radv_prims_for_vertices(&prim_vertex_count, draw_vertex_count);
if (num_prims < cmd_buffer->state.pipeline->graphics.ia_multi_vgt_param.primgroup_size)
multi_instances_smaller_than_primgroup = true;
}
if (family == CHIP_HAWAII && ia_switch_on_eoi) {
bool set_vgt_flush = indirect_draw;
if (!set_vgt_flush && instanced_draw) {
- uint32_t num_prims = radv_prims_for_vertices(&cmd_buffer->state.pipeline->graphics.prim_vertex_count, draw_vertex_count);
+ uint32_t num_prims = radv_prims_for_vertices(&prim_vertex_count, draw_vertex_count);
if (num_prims <= 1)
set_vgt_flush = true;
}