According to RadeonSI, only GFX10 and GFX10.3 need to emulate.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19319>
(device->rad_info.gfx_level >= GFX11 ||
(device->instance->perftest_flags & RADV_PERFTEST_NGG_STREAMOUT));
+ device->emulate_ngg_gs_query_pipeline_stat =
+ device->use_ngg && device->rad_info.gfx_level < GFX11;
+
/* Determine the number of threads per wave for all stages. */
device->cs_wave_size = 64;
device->ps_wave_size = 64;
/* Whether to enable NGG streamout. */
bool use_ngg_streamout;
+ /* Whether to emulate the number of primitives generated by GS. */
+ bool emulate_ngg_gs_query_pipeline_stat;
+
/* Number of threads per wave. */
uint8_t ps_wave_size;
uint8_t cs_wave_size;
* hardware if GS uses the legacy path. When NGG GS is used, the hardware can't know the number
* of generated primitives and we have to increment it from the shader using a plain GDS atomic.
*/
- pool->uses_gds = device->physical_device->use_ngg &&
- ((pool->pipeline_stats_mask & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT) ||
+ pool->uses_gds = (device->physical_device->emulate_ngg_gs_query_pipeline_stat &&
+ (pool->pipeline_stats_mask & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT)) ||
+ (device->physical_device->use_ngg &&
pCreateInfo->queryType == VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT);
switch (pCreateInfo->queryType) {
{
struct radv_shader_info *info = gs_stage ? &gs_stage->info : &es_stage->info;
- info->gs.has_ngg_pipeline_stat_query = !!gs_stage;
+ info->gs.has_ngg_pipeline_stat_query =
+ device->physical_device->emulate_ngg_gs_query_pipeline_stat && !!gs_stage;
info->has_ngg_xfb_query = gs_stage ? !!gs_stage->nir->xfb_info : !!es_stage->nir->xfb_info;
info->has_ngg_prim_query = pipeline_key->primitives_generated_query || info->has_ngg_xfb_query;
}