From 88ee9bc9d1dd66ddb9721dc44574b8caaa26df70 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 5 Oct 2013 18:26:56 +1300 Subject: 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 Reviewed-by: Kenneth Graunke --- src/glsl/ir_reader.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/glsl/ir_reader.cpp') 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; -- cgit v1.2.3