radeonsi: use tgsi_shader_info in si_shader_ps
authorMarek Olšák <marek.olsak@amd.com>
Sat, 4 Oct 2014 16:33:36 +0000 (18:33 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 12 Oct 2014 21:53:54 +0000 (23:53 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 692d2a9967ef28abf6037c556be0304f3774a89b..5ab9e55823ff08e2091269f1525858502a6e03bd 100644 (file)
@@ -246,7 +246,6 @@ static int si_store_shader_io_attribs(struct si_shader *shader,
                shader->input[i].sid = d->Semantic.Index;
                shader->input[i].index = d->Range.First;
                shader->input[i].interpolate = d->Interp.Interpolate;
-               shader->input[i].centroid = d->Interp.Location == TGSI_INTERPOLATE_LOC_CENTROID;
                return -1;
 
        case TGSI_FILE_OUTPUT:
index 8468e1a5eb93f31cc024a5b18a471fe6a6c810a0..80a3decebcdb73d6e36f46b2364fafc1cd5c80ac 100644 (file)
@@ -102,7 +102,6 @@ struct si_shader_input {
        unsigned                param_offset;
        unsigned                index;
        unsigned                interpolate;
-       bool                    centroid;
 };
 
 struct si_shader_output {
index c9e4353c3a42ba0e75ca9e1ec38975271111aad3..76162e565f33067a24bd9807195e0e7cb9c917e3 100644 (file)
@@ -228,6 +228,7 @@ static void si_shader_vs(struct pipe_context *ctx, struct si_shader *shader)
 static void si_shader_ps(struct pipe_context *ctx, struct si_shader *shader)
 {
        struct si_context *sctx = (struct si_context *)ctx;
+       struct tgsi_shader_info *info = &shader->selector->info;
        struct si_pm4_state *pm4;
        unsigned i, spi_ps_in_control;
        unsigned num_sgprs, num_user_sgprs;
@@ -240,10 +241,11 @@ static void si_shader_ps(struct pipe_context *ctx, struct si_shader *shader)
        if (pm4 == NULL)
                return;
 
-       for (i = 0; i < shader->ninput; i++) {
-               switch (shader->input[i].name) {
+       for (i = 0; i < info->num_inputs; i++) {
+               switch (info->input_semantic_name[i]) {
                case TGSI_SEMANTIC_POSITION:
-                       if (shader->input[i].centroid) {
+                       if (info->input_interpolate_loc[i] ==
+                           TGSI_INTERPOLATE_LOC_CENTROID) {
                                /* SPI_BARYC_CNTL.POS_FLOAT_LOCATION
                                 * Possible vaules:
                                 * 0 -> Position = pixel center (default)