mesa: fix warning about possibly undefined var in GLSL compiler
authorBrian Paul <brianp@vmware.com>
Sat, 3 Jan 2009 00:30:08 +0000 (17:30 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 3 Jan 2009 00:30:08 +0000 (17:30 -0700)
src/mesa/shader/slang/slang_emit.c

index b7a3cfb6177ec58e9576f4449151544a4351aa64..1c0a7bbbd6e1c4eb99df45590759882251c04e2f 100644 (file)
@@ -310,24 +310,22 @@ storage_to_dst_reg(struct prog_dst_register *dst, const slang_ir_storage *st)
       dst->WriteMask = swizzle_to_writemask(swizzle);
    }
    else {
-      GLuint writemask;
       switch (size) {
       case 1:
-         writemask = WRITEMASK_X << GET_SWZ(st->Swizzle, 0);
+         dst->WriteMask = WRITEMASK_X << GET_SWZ(st->Swizzle, 0);
          break;
       case 2:
-         writemask = WRITEMASK_XY;
+         dst->WriteMask = WRITEMASK_XY;
          break;
       case 3:
-         writemask = WRITEMASK_XYZ;
+         dst->WriteMask = WRITEMASK_XYZ;
          break;
       case 4:
-         writemask = WRITEMASK_XYZW;
+         dst->WriteMask = WRITEMASK_XYZW;
          break;
       default:
          ; /* error would have been caught above */
       }
-      dst->WriteMask = writemask;
    }
 
    dst->RelAddr = relAddr;