r300: fix transformation of abs modifiers with negate
authorPavel Ondračka <pavel.ondracka@gmail.com>
Mon, 7 Feb 2022 15:49:38 +0000 (16:49 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 8 Feb 2022 22:54:02 +0000 (22:54 +0000)
It is being overwritten by the memset. Just set the only remaining
member RelAddr explicitly.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14915>

src/gallium/drivers/r300/compiler/r3xx_vertprog.c

index 559a8ff..3626d29 100644 (file)
@@ -688,10 +688,10 @@ static int transform_nonnative_modifiers(
                        new_inst->U.I.SrcReg[1] = inst->U.I.SrcReg[i];
                        new_inst->U.I.SrcReg[1].Negate ^= RC_MASK_XYZW;
 
-                       memset(&inst->U.I.SrcReg[i], 0, sizeof(inst->U.I.SrcReg[i]));
                        inst->U.I.SrcReg[i].File = RC_FILE_TEMPORARY;
                        inst->U.I.SrcReg[i].Index = temp;
                        inst->U.I.SrcReg[i].Swizzle = RC_SWIZZLE_XYZW;
+                       inst->U.I.SrcReg[i].RelAddr = 0;
                }
        }
        return 1;