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 <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user