summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_pc.h
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-09-09 19:17:55 +0200
committerChristoph Bumiller <[email protected]>2010-09-09 19:21:34 +0200
commit9cc80e25db3d0bfd38015a197de3a1a80b6733ab (patch)
treeb3ff6e9f8d6f5a645525dc19871efd6f0d6e8426 /src/gallium/drivers/nv50/nv50_pc.h
parentf30810cb68a53c4fef360778a230126ed0ee0ee3 (diff)
nv50: create value references with the right type
Since atm our OPs aren't typed but instead values are, we need to take care if they're used as different types (e.g. a load makes a value u32 by default). Maybe this should be changed (also to match TGSI), but it should work as well if done properly.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc.h')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc.h b/src/gallium/drivers/nv50/nv50_pc.h
index ba32ab08ab2..ccddae063ce 100644
--- a/src/gallium/drivers/nv50/nv50_pc.h
+++ b/src/gallium/drivers/nv50/nv50_pc.h
@@ -189,6 +189,7 @@ struct nv_reg {
int id;
ubyte file;
ubyte type; /* type of generating instruction's result */
+ ubyte as_type; /* default type for new references to this value */
union {
float f32;
double f64;
@@ -396,14 +397,16 @@ new_value(struct nv_pc *pc, ubyte file, ubyte type)
value->join = value;
value->reg.id = -1;
value->reg.file = file;
- value->reg.type = type;
+ value->reg.type = value->reg.as_type = type;
return value;
}
static INLINE struct nv_value *
new_value_like(struct nv_pc *pc, struct nv_value *like)
{
- return new_value(pc, like->reg.file, like->reg.type);
+ struct nv_value *val = new_value(pc, like->reg.file, like->reg.type);
+ val->reg.as_type = like->reg.as_type;
+ return val;
}
static INLINE struct nv_ref *
@@ -425,7 +428,7 @@ new_ref(struct nv_pc *pc, struct nv_value *val)
ref = pc->refs[pc->num_refs++];
ref->value = val;
- ref->typecast = val->reg.type;
+ ref->typecast = val->reg.as_type;
++val->refc;
return ref;