From c5a27b5939427bdc95c926b450ed3de1ff4baafb Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 8 Jan 2011 23:49:23 -0800 Subject: glsl: Change texel offsets to a single vector rvalue. Having these as actual integer values makes it difficult to implement the texture*Offset built-in functions, since the offset is actually a function parameter (which doesn't have a constant value). The original rationale was that some hardware needs these offset baked into the instruction opcode. However, at least i965 should be able to support non-constant offsets. Others should be able to rely on inlining and constant propagation. --- src/glsl/ir_hv_accept.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/ir_hv_accept.cpp') diff --git a/src/glsl/ir_hv_accept.cpp b/src/glsl/ir_hv_accept.cpp index be8b36a7cf..4a607dc874 100644 --- a/src/glsl/ir_hv_accept.cpp +++ b/src/glsl/ir_hv_accept.cpp @@ -187,6 +187,12 @@ ir_texture::accept(ir_hierarchical_visitor *v) return (s == visit_continue_with_parent) ? visit_continue : s; } + if (this->offset) { + s = this->offset->accept(v); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + } + switch (this->op) { case ir_tex: break; -- cgit v1.2.3