r600/sfn: Fix use of scheduled_shader vs shader
authorGert Wollny <gert.wollny@collabora.com>
Sun, 24 Sep 2023 17:19:24 +0000 (19:19 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Sun, 24 Sep 2023 17:52:36 +0000 (19:52 +0200)
Thanks to Vitaliy Kuzmin for pointing this out.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25364>

src/gallium/drivers/r600/sfn/sfn_nir.cpp

index 9a5cf65..d03116c 100644 (file)
@@ -983,7 +983,7 @@ r600_shader_from_nir(struct r600_context *rctx,
    auto scheduled_shader = r600::schedule(shader);
    if (r600::sfn_log.has_debug_flag(r600::SfnLog::steps)) {
       std::cerr << "Shader after scheduling\n";
-      shader->print(std::cerr);
+      scheduled_shader->print(std::cerr);
    }
 
    if (!r600::sfn_log.has_debug_flag(r600::SfnLog::nomerge)) {
@@ -1026,7 +1026,7 @@ r600_shader_from_nir(struct r600_context *rctx,
 
    pipeshader->shader.bc.type = pipeshader->shader.processor_type;
    pipeshader->shader.bc.isa = rctx->isa;
-   pipeshader->shader.bc.ngpr = shader->required_registers();
+   pipeshader->shader.bc.ngpr = scheduled_shader->required_registers();
 
    r600::Assembler afs(&pipeshader->shader, *key);
    if (!afs.lower(scheduled_shader)) {