lima/ppir: fix lod bias register codegen
authorErico Nunes <nunes.erico@gmail.com>
Mon, 13 Apr 2020 13:22:53 +0000 (15:22 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 9 May 2020 11:30:07 +0000 (11:30 +0000)
The lod bias register is correctly run through the entire compilation
process, but in the end its allocated register value was never being
added to the instruction.
It seems that most programs were lucky enough that lod bias was assigned
register 0.x so that things worked anyway.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4535>

src/gallium/drivers/lima/ir/pp/codegen.c

index 892b124322bd20e514bba845cb9681a829b5efe6..ce2c10732ce2e33d0e112fd0223d250af88735ae 100644 (file)
@@ -130,7 +130,7 @@ static void ppir_codegen_encode_texld(ppir_node *node, void *code)
    f->lod_bias_en = ldtex->lod_bias_en;
    f->explicit_lod = ldtex->explicit_lod;
    if (ldtex->lod_bias_en)
-      ppir_target_get_src_reg_index(&ldtex->src[1]);
+      f->lod_bias = ppir_target_get_src_reg_index(&ldtex->src[1]);
 
    switch (ldtex->sampler_dim) {
    case GLSL_SAMPLER_DIM_2D: