radeonsi: Fix parameter cache offsets for fragment shader inputs.
authorMichel Dänzer <michel.daenzer@amd.com>
Fri, 18 May 2012 13:01:10 +0000 (15:01 +0200)
committerMichel Dänzer <michel@daenzer.net>
Fri, 18 May 2012 13:01:10 +0000 (15:01 +0200)
src/gallium/drivers/radeonsi/evergreen_state.c
src/gallium/drivers/radeonsi/radeonsi_pipe.h
src/gallium/drivers/radeonsi/radeonsi_shader.c

index f943f088cd005ee6e3b9a18703ed75e9f1c1e792..c7bd6c1fe25e5740745f8c47eecf757a854792c7 100644 (file)
@@ -2238,7 +2238,7 @@ void si_update_spi_map(struct r600_context *rctx)
                for (j = 0; j < vs->noutput; j++) {
                        if (ps->input[i].name == vs->output[j].name &&
                            ps->input[i].sid == vs->output[j].sid) {
-                               tmp |= S_028644_OFFSET(ps->input[i].sid);
+                               tmp |= S_028644_OFFSET(vs->output[j].param_offset);
                                break;
                        }
                }
index 366dd0c51fd18483c6b4eeb9aec82d711865040e..7d6b13a4683b8da95b4aa85e4d3c09dd62afd772 100644 (file)
@@ -170,9 +170,9 @@ struct r600_shader_io {
        unsigned                gpr;
        unsigned                done;
        int                     sid;
+       unsigned                param_offset;
        unsigned                interpolate;
        boolean                 centroid;
-       unsigned                lds_pos; /* for evergreen */
 };
 
 struct r600_shader {
index 396b94ad357b1f546b29afac26657ddbaa1f3b99..e3623e02f4f6c4fa6d53a9b3681c37d543e45da9 100644 (file)
@@ -381,6 +381,7 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
                        case TGSI_SEMANTIC_COLOR:
                                if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX) {
                                        target = V_008DFC_SQ_EXP_PARAM + param_count;
+                                       shader->output[i].param_offset = param_count;
                                        param_count++;
                                } else {
                                        target = V_008DFC_SQ_EXP_MRT + color_count;
@@ -389,6 +390,7 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
                                break;
                        case TGSI_SEMANTIC_GENERIC:
                                target = V_008DFC_SQ_EXP_PARAM + param_count;
+                               shader->output[i].param_offset = param_count;
                                param_count++;
                                break;
                        default: