Module: Mesa
Branch: main
Commit: 53a8dd1d42ee622d7feb8c8d9d085e30b22a88e1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=53a8dd1d42ee622d7feb8c8d9d085e30b22a88e1

Author: Samuel Pitoiset <[email protected]>
Date:   Tue Nov  1 16:48:18 2022 +0100

radv: move GDS counters after reserved GDS offsets for streamout

Otherwise, queries might return invalid data because they used
the same offsets as NGG streamout.

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19442>

---

 src/amd/vulkan/radv_constants.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_constants.h b/src/amd/vulkan/radv_constants.h
index 1e66dd03983..2cb211a7b4a 100644
--- a/src/amd/vulkan/radv_constants.h
+++ b/src/amd/vulkan/radv_constants.h
@@ -138,12 +138,13 @@
 #define PERF_CTR_BO_FENCE_OFFSET 8
 
 /* NGG GDS counters:
- *   offset  0           - pipeline statistics counter for all streams
- *   offset  4| 8|12|16  - generated primitive counter for stream 0|1|2|3
- *   offset 20|24|28|32  - written primitive counter for stream 0|1|2|3
+ *   offset  0| 4| 8|12  - reserved for NGG streamout counters
+ *   offset 16           - pipeline statistics counter for all streams
+ *   offset 20|24|28|32  - generated primitive counter for stream 0|1|2|3
+ *   offset 36|40|44|48  - written primitive counter for stream 0|1|2|3
  */
-#define RADV_NGG_QUERY_PIPELINE_STAT_OFFSET 0
-#define RADV_NGG_QUERY_PRIM_GEN_OFFSET(stream) (4 + stream * 4)
-#define RADV_NGG_QUERY_PRIM_XFB_OFFSET(stream) (20 + stream * 4)
+#define RADV_NGG_QUERY_PIPELINE_STAT_OFFSET 16
+#define RADV_NGG_QUERY_PRIM_GEN_OFFSET(stream) (20 + stream * 4)
+#define RADV_NGG_QUERY_PRIM_XFB_OFFSET(stream) (36 + stream * 4)
 
 #endif /* RADV_CONSTANTS_H */

Reply via email to