summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-03 15:07:34 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-09 11:14:57 -0700
commit56d3f6ad782e9819b40544494826954d3fcf978b (patch)
tree8a20d5ca82e423d6d775aa358288c1655610f2ef /ir.cpp
parentdd5b4a544bd53f192cc86441f4e7e95d93707382 (diff)
Set the type of ir_texture properly; infer it from the sampler type.
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/ir.cpp b/ir.cpp
index 9a71349..ca34c24 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -324,6 +324,26 @@ ir_texture::get_opcode(const char *str)
}
+void
+ir_texture::set_sampler(ir_dereference *sampler)
+{
+ assert(sampler != NULL);
+ this->sampler = sampler;
+
+ switch (sampler->type->sampler_type) {
+ case GLSL_TYPE_FLOAT:
+ this->type = glsl_type::vec4_type;
+ break;
+ case GLSL_TYPE_INT:
+ this->type = glsl_type::ivec4_type;
+ break;
+ case GLSL_TYPE_UINT:
+ this->type = glsl_type::uvec4_type;
+ break;
+ }
+}
+
+
ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z,
unsigned w, unsigned count)
: val(val)