radv: stop emulating number of generated primitives by GS on GFX11

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>
This commit is contained in:
Samuel Pitoiset 2022-11-01 10:24:36 +01:00 committed by Marge Bot
parent 97b3dd34c1
commit a9ab53fbe2
4 changed files with 11 additions and 3 deletions

View file

@ -874,6 +874,9 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
(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;

View file

@ -290,6 +290,9 @@ struct radv_physical_device {
/* 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;

View file

@ -1091,8 +1091,9 @@ radv_CreateQueryPool(VkDevice _device, const VkQueryPoolCreateInfo *pCreateInfo,
* 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) {

View file

@ -1205,7 +1205,8 @@ gfx10_get_ngg_query_info(const struct radv_device *device, struct radv_pipeline_
{
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;
}