r600g: take into account PSIZE output for spi mapping
authorVadim Girlin <vadimgirlin@gmail.com>
Wed, 2 Nov 2011 07:50:59 +0000 (11:50 +0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Nov 2011 13:47:10 +0000 (09:47 -0400)
Skip PSIZE and POSITION when counting VS outputs.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42435

Tested without regressions on evergreen.

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_shader.c

index e1939966216b938c3e91dc7e1476df5b9626da63..350ba3cb33296ef8f5679e27bd5ce521f5596573 100644 (file)
@@ -62,12 +62,15 @@ int r600_find_vs_semantic_index(struct r600_shader *vs,
                                struct r600_shader *ps, int id)
 {
        struct r600_shader_io *input = &ps->input[id];
+       int index = 0;
 
        for (int i = 0; i < vs->noutput; i++) {
                if (input->name == vs->output[i].name &&
-                       input->sid == vs->output[i].sid) {
-                       return i - 1;
-               }
+                               input->sid == vs->output[i].sid)
+                       return index;
+               else if (vs->output[i].name != TGSI_SEMANTIC_POSITION &&
+                                vs->output[i].name != TGSI_SEMANTIC_PSIZE)
+                       index++;
        }
        return 0;
 }