Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes:
39c828cb9fd ("aco: remove aco::rt_stack variable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961>
uint16_t
get_extra_sgprs(Program* program)
{
- /* We don't use this register on GFX6-8 and it's removed on GFX10+. */
- bool needs_flat_scr = program->config->scratch_bytes_per_wave && program->gfx_level == GFX9;
+ /* We don't use this register on GFX6-8 and it's removed on GFX10+. RT uses scratch but we don't
+ * yet know how much.
+ */
+ bool needs_flat_scr =
+ (program->config->scratch_bytes_per_wave || program->stage == raytracing_cs) &&
+ program->gfx_level == GFX9;
if (program->gfx_level >= GFX10) {
assert(!program->dev.xnack_enabled);