summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-10-10 21:34:03 +1300
committerChris Forbes <[email protected]>2013-10-26 22:27:37 +1300
commita9de744a26bc575a1a269e133c550f813c95904f (patch)
tree31fe9a4efdaf0d0daac356536b2644ec05d60b84 /src/glsl/builtin_functions.cpp
parent3c98d77460df0e7dde7fb22beaa4c4e6dc8a3602 (diff)
glsl: add support for texture functions with offset arrays
This is needed for textureGatherOffsets() Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r--src/glsl/builtin_functions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index deedddbea5c..1b23677293a 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -507,6 +507,7 @@ private:
#define TEX_OFFSET 2
#define TEX_COMPONENT 4
#define TEX_OFFSET_NONCONST 8
+#define TEX_OFFSET_ARRAY 16
ir_function_signature *_texture(ir_texture_opcode opcode,
builtin_available_predicate avail,
@@ -3432,6 +3433,14 @@ builtin_builder::_texture(ir_texture_opcode opcode,
tex->offset = var_ref(offset);
}
+ if (flags & TEX_OFFSET_ARRAY) {
+ ir_variable *offsets =
+ new(mem_ctx) ir_variable(glsl_type::get_array_instance(glsl_type::ivec2_type, 4),
+ "offsets", ir_var_const_in);
+ sig->parameters.push_tail(offsets);
+ tex->offset = var_ref(offsets);
+ }
+
if (opcode == ir_tg4) {
if (flags & TEX_COMPONENT) {
ir_variable *component =