tgsi: silence compiler warning in fetch_sampler_unit()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 31 Mar 2016 08:54:18 +0000 (10:54 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 31 Mar 2016 21:16:24 +0000 (07:16 +1000)
The unit variable can be used uninitialized.

Fixes: 24e77cb09 ("tgsi: handle indirect sampler arrays. (v2)")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/tgsi/tgsi_exec.c

index 72d8c5a724746b87dc8266a05a7bdccffcb804ec..a595bbbc6d33c13b2843f0cdb57e2a8d8603aa41 100644 (file)
@@ -1996,7 +1996,7 @@ fetch_sampler_unit(struct tgsi_exec_machine *mach,
                    const struct tgsi_full_instruction *inst,
                    uint sampler)
 {
-   uint unit;
+   uint unit = 0;
    int i;
    if (inst->Src[sampler].Register.Indirect) {
       const struct tgsi_full_src_register *reg = &inst->Src[sampler];