From: Nicolai Hähnle <nicolai.haeh...@amd.com> --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index c7745ce..85ab329 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -394,26 +394,23 @@ scan_declaration(struct tgsi_shader_info *info, MAX2(info->const_file_max[buffer], (int)reg); } else if (file == TGSI_FILE_INPUT) { info->input_semantic_name[reg] = (ubyte) semName; info->input_semantic_index[reg] = (ubyte) semIndex; info->input_interpolate[reg] = (ubyte)fulldecl->Interp.Interpolate; info->input_interpolate_loc[reg] = (ubyte)fulldecl->Interp.Location; 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++; + info->num_inputs = MAX2(info->num_inputs, reg + 1); + if (info->processor != PIPE_SHADER_VERTEX) assert(reg < info->num_inputs); - } if (semName == TGSI_SEMANTIC_PRIMID) info->uses_primid = TRUE; else if (procType == PIPE_SHADER_FRAGMENT) { if (semName == TGSI_SEMANTIC_POSITION) info->reads_position = TRUE; else if (semName == TGSI_SEMANTIC_FACE) info->uses_frontface = TRUE; } } @@ -449,21 +446,21 @@ scan_declaration(struct tgsi_shader_info *info, info->uses_frontface = TRUE; break; case TGSI_SEMANTIC_SAMPLEMASK: info->reads_samplemask = TRUE; break; } } else if (file == TGSI_FILE_OUTPUT) { info->output_semantic_name[reg] = (ubyte) semName; info->output_semantic_index[reg] = (ubyte) semIndex; - info->num_outputs++; + info->num_outputs = MAX2(info->num_outputs, reg + 1); assert(reg < info->num_outputs); if (semName == TGSI_SEMANTIC_COLOR) info->colors_written |= 1 << semIndex; if (procType == PIPE_SHADER_VERTEX || procType == PIPE_SHADER_GEOMETRY || procType == PIPE_SHADER_TESS_CTRL || procType == PIPE_SHADER_TESS_EVAL) { switch (semName) { -- 2.7.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev