radeonsi: Always pre-load separate VGPRs for centroid vs. center interpolation
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 19 Aug 2013 13:45:32 +0000 (15:45 +0200)
committerMichel Dänzer <michel@daenzer.net>
Tue, 20 Aug 2013 16:50:28 +0000 (18:50 +0200)
The LLVM R600 backend currently always uses separate VGPRs for these.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68162
(Centroid interpolation is identical to center interpolation without
multisampling, so the shader hardware was only pre-loading one set of
interpolation coefficients, and the pixel shader code was using
uninitialized values as the centroid interpolation coefficients)

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Laurent Carlier <lordheavym@gmail.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index 7ecaf77c00dc65ecd16786a2c0385902ea72a981..15cb87f32ae5481115ff29b72a769664fa0f3b5b 100644 (file)
@@ -183,7 +183,8 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
                exports_ps = 2;
        }
 
-       spi_ps_in_control = S_0286D8_NUM_INTERP(shader->shader.ninterp);
+       spi_ps_in_control = S_0286D8_NUM_INTERP(shader->shader.ninterp) |
+               S_0286D8_BC_OPTIMIZE_DISABLE(1);
 
        si_pm4_set_reg(pm4, R_0286E0_SPI_BARYC_CNTL, spi_baryc_cntl);
        spi_ps_input_ena = shader->spi_ps_input_ena;