radeonsi: read SPI_PS_INPUT_ADDR from LLVM if it returns it
authorMarek Olšák <marek.olsak@amd.com>
Wed, 6 Jan 2016 15:03:38 +0000 (16:03 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Feb 2016 20:19:51 +0000 (21:19 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index 68ce3871b7ec997b2941ca126def067c294cfaf5..85203e046fc65bb914c4ecbc7bf9c9497950df11 100644 (file)
@@ -3875,7 +3875,7 @@ void si_shader_binary_read_config(struct radeon_shader_binary *binary,
                        conf->spi_ps_input_ena = value;
                        break;
                case R_0286D0_SPI_PS_INPUT_ADDR:
-                       /* Not used yet, but will be in the future */
+                       conf->spi_ps_input_addr = value;
                        break;
                case R_0286E8_SPI_TMPRING_SIZE:
                case R_00B860_COMPUTE_TMPRING_SIZE:
@@ -3895,6 +3895,9 @@ void si_shader_binary_read_config(struct radeon_shader_binary *binary,
                        }
                        break;
                }
+
+               if (!conf->spi_ps_input_addr)
+                       conf->spi_ps_input_addr = conf->spi_ps_input_ena;
        }
 }
 
index 0d6a45a319a083caf30d3b5362080bf3177b584b..04b977af943f5fbb67c3c0de1b3e601bf688e5c5 100644 (file)
@@ -260,6 +260,7 @@ struct si_shader_config {
        unsigned                        num_vgprs;
        unsigned                        lds_size;
        unsigned                        spi_ps_input_ena;
+       unsigned                        spi_ps_input_addr;
        unsigned                        float_mode;
        unsigned                        scratch_bytes_per_wave;
        unsigned                        rsrc1;
index 59511c67ed02398eab933d87c738a1eee1da09ad..6e656b07ca1a576a6aae8b39d274d5d195dd8fcb 100644 (file)
@@ -527,7 +527,8 @@ static void si_shader_ps(struct si_shader *shader)
                spi_shader_col_format = V_028714_SPI_SHADER_32_R;
 
        si_pm4_set_reg(pm4, R_0286CC_SPI_PS_INPUT_ENA, input_ena);
-       si_pm4_set_reg(pm4, R_0286D0_SPI_PS_INPUT_ADDR, input_ena);
+       si_pm4_set_reg(pm4, R_0286D0_SPI_PS_INPUT_ADDR,
+                      shader->config.spi_ps_input_addr);
 
        /* Set interpolation controls. */
        has_centroid = G_0286CC_PERSP_CENTROID_ENA(shader->config.spi_ps_input_ena) ||