ac/spm: fix a crash with the RT counters on GFX10

They are only enabled on GFX10.3+.

Fixes: 8bc37d0d19 ("ac/spm: add support for Ray Tracing counters in RGP")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39127>
This commit is contained in:
Samuel Pitoiset 2026-01-02 17:12:25 +01:00 committed by Marge Bot
parent a057800300
commit 3722ef141c

View file

@ -1564,17 +1564,19 @@ ac_spm_get_derived_trace(const struct radeon_info *info,
ADD(MEM_UNIT_STALLED_CYCLES, mem_unit_stalled_cycles);
ADD(MEM_UNIT_STALLED, mem_unit_stalled);
/* Raytracing group. */
/* Ray box tests. */
const double ray_box_tests = OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_FP16_BOX_NODE) +
OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_FP32_BOX_NODE);
if (info->gfx_level >= GFX10_3) {
/* Raytracing group. */
/* Ray box tests. */
const double ray_box_tests = OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_FP16_BOX_NODE) +
OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_FP32_BOX_NODE);
ADD(RAY_BOX_TESTS, ray_box_tests);
ADD(RAY_BOX_TESTS, ray_box_tests);
/* Ray triangle tests. */
const double ray_tri_tests = OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_TRI_NODE);
/* Ray triangle tests. */
const double ray_tri_tests = OP_RAW(TD_PERF_SEL_RAY_TRACING_BVH4_TRI_NODE);
ADD(RAY_TRI_TESTS, ray_tri_tests);
ADD(RAY_TRI_TESTS, ray_tri_tests);
}
}
#undef ADD