aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-03-20 21:29:36 +0100
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:43 +0200
commite9072863b18e4a8cf78e72bf25abbb433de1b486 (patch)
treebcfccf8df19f562104312b9fea8cdab5a4160c26 /src/gallium/auxiliary
parenta426b0d5bce24659a19c72af27a5aa4871782f9d (diff)
gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_build.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index ed725c53966..1d3c4bcdf71 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -496,11 +496,13 @@ tgsi_default_immediate( void )
static struct tgsi_immediate
tgsi_build_immediate(
- struct tgsi_header *header )
+ struct tgsi_header *header,
+ unsigned type )
{
struct tgsi_immediate immediate;
immediate = tgsi_default_immediate();
+ immediate.DataType = type;
header_bodysize_grow( header );
@@ -533,21 +535,6 @@ immediate_grow(
header_bodysize_grow( header );
}
-static union tgsi_immediate_data
-tgsi_build_immediate_float32(
- float value,
- struct tgsi_immediate *immediate,
- struct tgsi_header *header )
-{
- union tgsi_immediate_data immediate_data;
-
- immediate_data.Float = value;
-
- immediate_grow( immediate, header );
-
- return immediate_data;
-}
-
unsigned
tgsi_build_full_immediate(
const struct tgsi_full_immediate *full_imm,
@@ -563,7 +550,7 @@ tgsi_build_full_immediate(
immediate = (struct tgsi_immediate *) &tokens[size];
size++;
- *immediate = tgsi_build_immediate( header );
+ *immediate = tgsi_build_immediate( header, full_imm->Immediate.DataType );
assert( full_imm->Immediate.NrTokens <= 4 + 1 );
@@ -572,13 +559,12 @@ tgsi_build_full_immediate(
if( maxsize <= size )
return 0;
+
data = (union tgsi_immediate_data *) &tokens[size];
- size++;
+ *data = full_imm->u[i];
- *data = tgsi_build_immediate_float32(
- full_imm->u[i].Float,
- immediate,
- header );
+ immediate_grow( immediate, header );
+ size++;
}
return size;