Mesa (master): radv: fix geometry shader primitives query with ACO on GFX10

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 17 16:08:52 UTC 2020


Module: Mesa
Branch: master
Commit: fd6e44236c07583b3b838b2c7ed01fea27002ef9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd6e44236c07583b3b838b2c7ed01fea27002ef9

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Apr 16 16:15:45 2020 +0200

radv: fix geometry shader primitives query with ACO on GFX10

Fixes
dEQP-VK.query_pool.statistics_query.*.geometry_shader_primitives.*.

Fixes: c24d9522dae ("radv: Enable ACO for NGG VS/TES, but disable NGG for ACO GS.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4593>

---

 src/amd/vulkan/radv_device.c   | 2 ++
 src/amd/vulkan/radv_pipeline.c | 6 +-----
 src/amd/vulkan/radv_private.h  | 3 +++
 src/amd/vulkan/radv_query.c    | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 09b19ed0007..8e4fc861722 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -412,6 +412,8 @@ radv_physical_device_init(struct radv_physical_device *device,
 			  device->rad_info.family != CHIP_NAVI14 &&
 			  !(device->instance->debug_flags & RADV_DEBUG_NO_NGG);
 
+	/* TODO: Implement NGG GS with ACO. */
+	device->use_ngg_gs = device->use_ngg && !device->use_aco;
 	device->use_ngg_streamout = false;
 
 	/* Determine the number of threads per wave for all stages. */
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index f0b93878f3b..b10ee86ac7c 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2461,17 +2461,13 @@ radv_fill_shader_keys(struct radv_device *device,
 			keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = false;
 		}
 
-		if (device->physical_device->use_aco) {
-			/* Disable NGG GS when ACO is used */
+		if (!device->physical_device->use_ngg_gs) {
 			if (nir[MESA_SHADER_GEOMETRY]) {
 				if (nir[MESA_SHADER_TESS_CTRL])
 					keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = false;
 				else
 					keys[MESA_SHADER_VERTEX].vs_common_out.as_ngg = false;
 			}
-
-			/* NGG streamout not yet supported by ACO */
-			assert(!device->physical_device->use_ngg_streamout);
 		}
 
 		gl_shader_stage last_xfb_stage = MESA_SHADER_VERTEX;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 24a04c4e6a5..b56772e6edb 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -327,6 +327,9 @@ struct radv_physical_device {
 	/* Whether to enable NGG. */
 	bool use_ngg;
 
+	/* Whether to enable NGG GS. */
+	bool use_ngg_gs;
+
 	/* Whether to enable NGG streamout. */
 	bool use_ngg_streamout;
 
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index a0387c785fa..07a1c387187 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -1265,7 +1265,7 @@ radv_query_pool_needs_gds(struct radv_device *device,
 	 * TODO: fix use of NGG GS and non-NGG GS inside the same begin/end
 	 * query.
 	 */
-	return device->physical_device->use_ngg &&
+	return device->physical_device->use_ngg_gs &&
 	       (pool->pipeline_stats_mask & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT);
 }
 



More information about the mesa-commit mailing list