st: Fix immediate construction.
authorMichal Krol <michal@tungstengraphics.com>
Mon, 18 Aug 2008 20:38:48 +0000 (22:38 +0200)
committerMichal Krol <michal@tungstengraphics.com>
Mon, 18 Aug 2008 22:44:13 +0000 (00:44 +0200)
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 198d406b59332af1356689507d0d429be280b26f..372e4672f6ad409fbc595cc97b89ae22d7defbf6 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -175,10 +175,11 @@ static struct tgsi_full_immediate
 make_immediate(const float *value, uint size)
 {
    struct tgsi_full_immediate imm;
-   imm.Immediate.Type = TGSI_TOKEN_TYPE_IMMEDIATE;
-   imm.Immediate.Size = 1 + size; /* one for the token itself */
+
+   imm = tgsi_default_full_immediate();
+   imm.Immediate.Size += size;
    imm.Immediate.DataType = TGSI_IMM_FLOAT32;
-   imm.u.ImmediateFloat32 = (struct tgsi_immediate_float32 *) value;
+   imm.u.Pointer = value;
    return imm;
 }