diff options
author | Nicolai Hähnle <[email protected]> | 2016-10-07 12:53:55 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-10-12 18:50:10 +0200 |
commit | f9a01f3872fa854c316b36351b166e2e4ebb5570 (patch) | |
tree | 40191800940173b3b051f2973f70d23979fa11bc | |
parent | 700a571f8963cff4bff230e8e9b25da0bdce4f54 (diff) |
tgsi/scan: fix num_inputs/num_outputs for shaders with overlapping arrays
v2: remove a tautological left-over assert (Marek)
Reviewed-by: Edward O'Callaghan <[email protected]> (v1)
Reviewed-by: Dave Airlie <[email protected]> (v1)
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index c7745ceba66..b86207883e1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -401,12 +401,7 @@ scan_declaration(struct tgsi_shader_info *info, info->input_cylindrical_wrap[reg] = (ubyte)fulldecl->Interp.CylindricalWrap; /* Vertex shaders can have inputs with holes between them. */ - if (info->processor == PIPE_SHADER_VERTEX) - info->num_inputs = MAX2(info->num_inputs, reg + 1); - else { - info->num_inputs++; - assert(reg < info->num_inputs); - } + info->num_inputs = MAX2(info->num_inputs, reg + 1); if (semName == TGSI_SEMANTIC_PRIMID) info->uses_primid = TRUE; @@ -456,8 +451,7 @@ scan_declaration(struct tgsi_shader_info *info, else if (file == TGSI_FILE_OUTPUT) { info->output_semantic_name[reg] = (ubyte) semName; info->output_semantic_index[reg] = (ubyte) semIndex; - info->num_outputs++; - assert(reg < info->num_outputs); + info->num_outputs = MAX2(info->num_outputs, reg + 1); if (semName == TGSI_SEMANTIC_COLOR) info->colors_written |= 1 << semIndex; |