aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_reader.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-10-05 18:26:56 +1300
committerChris Forbes <[email protected]>2013-10-06 11:12:29 +1300
commit88ee9bc9d1dd66ddb9721dc44574b8caaa26df70 (patch)
tree703eea9eaceab52cb3820145fe9cc2036bbafb1e /src/glsl/ir_reader.cpp
parentf93a63bfccf22b64d5f0886b25fce833babdab1c (diff)
glsl: Add support for specifying the component in textureGather
ARB_gpu_shader5 introduces new variants of textureGather* which have an explicit component selector, rather than relying purely on the sampler's swizzle state. This patch adds the GLSL plumbing for the extra parameter. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r--src/glsl/ir_reader.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index ea0c09aebeb..00e2db9a3f0 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -934,6 +934,7 @@ ir_reader::read_texture(s_expression *expr)
s_list *s_shadow = NULL;
s_expression *s_lod = NULL;
s_expression *s_sample_index = NULL;
+ s_expression *s_component = NULL;
ir_texture_opcode op = ir_tex; /* silence warning */
@@ -948,7 +949,7 @@ ir_reader::read_texture(s_expression *expr)
s_pattern txs_pattern[] =
{ "txs", s_type, s_sampler, s_lod };
s_pattern tg4_pattern[] =
- { "tg4", s_type, s_sampler, s_coord, s_offset };
+ { "tg4", s_type, s_sampler, s_coord, s_offset, s_component };
s_pattern query_levels_pattern[] =
{ "query_levels", s_type, s_sampler };
s_pattern other_pattern[] =
@@ -1089,6 +1090,13 @@ ir_reader::read_texture(s_expression *expr)
}
break;
}
+ case ir_tg4:
+ tex->lod_info.component = read_rvalue(s_component);
+ if (tex->lod_info.component == NULL) {
+ ir_read_error(NULL, "when reading component in (tg4 ...)");
+ return NULL;
+ }
+ break;
default:
// tex and lod don't have any extra parameters.
break;